LIBRARY rexxgui, rxgdi
gdierr = "SYNTAX"
gdiheading = 1
totalunits = 10
startx = 5
starty = 5
january = 2
march = 5
july = 10
guierr = "SYNTAX"
guiheading = 1
guiwindowdefaults(, , 0, 'VREDRAW|HREDRAW')
guicreatewindow('NORMAL')
again:
DO FOREVER
guigetmsg()
CATCH SYNTAX
CONDITION('M')
SIGNAL again
CATCH HALT
FINALLY
guidestroywindow()
END
RETURN
wm_paint:
gdipaint('Paint', guiwindow)
DO
guigetctlplacement(guiwindow, , , 'Width', 'Height')
gdistockobj("WHITE_BRUSH", "Brush")
brush = gdisetobj(paint1, brush)
gdirect(paint1, 0, 0, width, height)
gdisetobj(paint1, brush)
gdistockobj("GUI_FONT", "FontHandle")
gdisetobj(paint1, fonthandle)
gditext(paint1, "Ij", , 'Height', 'CALCRECT')
height = height + 5
gditext(paint1, totalunits, 'Width', , 'CALCRECT')
gdibkmode(paint1)
gditextcolor(paint1, gdicolorvalue(200, 70, 40))
i = 0
DO totalunits
gditext(paint1, totalunits - i, startx, (height * i) + starty, '1LINE|RIGHT', width)
i = i + 1
END
width = width + 10 + startx
xaxis = (height * totalunits) + starty
gdiline(paint1, width, starty, width, xaxis)
xaxis = xaxis + 5
janx = 5 + width
gditext(paint1, "January", janx, xaxis, '1LINE')
gditext(paint1, "January", 'JanWidth', , 'CALCRECT|1LINE')
marx = 40 + janx + janwidth
gditext(paint1, "March", marx, xaxis, '1LINE')
gditext(paint1, "March", 'MarWidth', , 'CALCRECT|1LINE')
julx = 40 + marx + marwidth
gditext(paint1, "July", julx, xaxis, '1LINE')
gditext(paint1, "July", 'JulWidth', , 'CALCRECT|1LINE')
xaxis = xaxis - 5
gdiline(paint1, width, xaxis, julx + julwidth + 5, xaxis)
gdistockobj("DKGRAY_BRUSH", "Brush")
brush = gdisetobj(paint1, brush)
IF janwidth > 20 THEN janx = janx + (janwidth % 2) - 10
gdirect(paint1, janx, (height * (totalunits - january)) + starty, janx + 20, xaxis)
IF marwidth > 20 THEN marx = marx + (marwidth % 2) - 10
gdirect(paint1, marx, (height * (totalunits - march)) + starty, marx + 20, xaxis)
IF julwidth > 20 THEN julx = julx + (julwidth % 2) - 10
gdirect(paint1, julx, (height * (totalunits - july)) + starty, julx + 20, xaxis)
gdisetobj(paint1, brush)
CATCH SYNTAX
BEEP()
FINALLY
gdipaint(paint)
END
RETURN "" |
|