LIBRARY rexxgui, rxconsole
guierr = "SYNTAX"
guiheading = 1
backcolor = 1
textcolor = 1
pullcolor = 1
guicreatewindow('NORMAL')
again:
DO FOREVER
guigetmsg()
CATCH SYNTAX
CONDITION()
SIGNAL again
CATCH HALT
FINALLY
guidestroywindow()
END
RETURN
wm_initdialog:
guigetctlplacement(guiwindow, , , "width", "height")
guigetctlplacement('TextColor', "SayX", "SayY", "SayWidth", "SayHeight")
sayy = sayy + sayheight
height = height - sayy
concreate(, guiwindow, "CHILD", , sayy, width, height)
RETURN ""
wm_click_say1:
consay(, "Button 1 was clicked")
RETURN
wm_click_say2:
consay(, "Button 2 was clicked")
RETURN
wm_click_clear:
conclear()
RETURN
wm_click_textcolor:
textcolor = textcolor + 1
IF textcolor > 3 THEN textcolor = 1
SELECT textcolor
WHEN 1 THEN DO
red = 180
green = 40
blue = 40
END
WHEN 2 THEN DO
red = 40
green = 180
blue = 40
END
OTHERWISE DO
red = 40
green = 40
blue = 180
END
END
consetcolor(, , red, green, blue)
RETURN
wm_click_pullcolor:
pullcolor = pullcolor + 1
IF pullcolor > 3 THEN pullcolor = 1
SELECT pullcolor
WHEN 1 THEN DO
red = 180
green = 40
blue = 40
END
WHEN 2 THEN DO
red = 40
green = 180
blue = 40
END
OTHERWISE DO
red = 40
green = 40
blue = 180
END
END
consetcolor(, "PULL", red, green, blue)
RETURN
wm_click_backcolor:
guigetctlvalue('BackColor')
SELECT backcolor
WHEN 1 THEN str = "BLACK"
WHEN 2 THEN str = "WHITE"
WHEN 3 THEN str = "LIGHTGRAY"
WHEN 4 THEN str = "DARKGRAY"
OTHERWISE str = "GRAY"
END
consetcolor(, "BACK", str)
RETURN
wm_click_pull:
consay(, "Enter some text, then press ENTER")
text = conpull()
consay(, text)
RETURN
wm_click_changefont:
consetfont(, "")
RETURN
wm_click_setfont:
consetfont(, "Courier New", 16, "BOLD")
RETURN
wm_click_pull1:
consay(, "Press a key")
text = conpull(, 1)
consay(, "You pressed the ", "NOBREAK")
consay(, text, "NOBREAK")
consay(, " key")
RETURN |