Computer Science Canada

radio buttons

Author:  kit-kat-kid [ Wed May 05, 2004 10:42 am ]
Post subject:  radio buttons

code:
import GUI in "%oot/lib/GUI"
View.Set ("graphics:500;500")

var x, y, x1, y1, size, angle, clr : int := 0
put "Please enter the x,y,x1,y1,size,clr"
get x, y, x1, y1, size, clr
cls
proc Square
    Draw.FillBox (0, 0, maxx, maxy, white)
    Draw.Box (x, y, x1, y1, clr)
    GUI.Refresh
end Square
proc Circle
    Draw.FillBox (0, 0, maxx, maxy, white)
    Draw.Oval (x, y, x1, y1, clr)
    GUI.Refresh
end Circle
proc Star
    Draw.FillBox (0, 0, maxx, maxy, white)
    Draw.Star (x, y, x1, y1, clr)
    GUI.Refresh
end Star
proc Ball
    Draw.FillBox (0, 0, maxx, maxy, white)
    Draw.FillOval (x, y, x1, y1, clr)
    GUI.Refresh
end Ball
proc MapleLeaf
    Draw.FillBox (0, 0, maxx, maxy, white)
    Draw.MapleLeaf (x, y, x1, y1, clr)
    GUI.Refresh
end MapleLeaf
proc Block
    Draw.FillBox (0, 0, maxx, maxy, white)
    Draw.FillBox (x, y, x1, y1, clr)
    GUI.Refresh
end Block
var radioButton : array 1 .. 6 of int
radioButton (1) := GUI.CreateRadioButton (33, maxy - 50, "Square", 0, Square)
radioButton (2) := GUI.CreateRadioButton ( - 1, - 1, "Circle",
    radioButton (1), Circle)
radioButton (3) := GUI.CreateRadioButton ( - 1, - 1, "Star",
    radioButton (2), Star)
radioButton (4) := GUI.CreateRadioButton ( - 1, - 1, "Ball",
    radioButton (3), Ball)
radioButton (5) := GUI.CreateRadioButton ( - 1, - 1, "MapleLeaf",
    radioButton (4), MapleLeaf)
radioButton (6) := GUI.CreateRadioButton ( - 1, - 1, "Block",
    radioButton (5), Block)
loop
    exit when GUI.ProcessEvent
end loop

Author:  Paul [ Wed May 05, 2004 7:51 pm ]
Post subject: 

Hey, this isn't bad, could be useful. + 5 bits

Author:  kit-kat-kid [ Wed May 05, 2004 8:07 pm ]
Post subject: 

thanks glad you like it Very Happy


: