$OPTIMIZE ON
$TYPECHECK ON
$INCLUDE "rapidq.inc"
$ESCAPECHARS ON
DECLARE SUB Canvas_OnPaint
DECLARE SUB Canvas_OnClick
CREATE Form AS QFORM
Height = 200
Width = 200
BorderStyle = bsNone
Center
CREATE Canvas AS QCANVAS
Top = 0
Left = 0
Height = 200
Width = 200
OnPaint = Canvas_OnPaint
OnClick = Canvas_OnClick
END CREATE
END CREATE
Canvas.RePaint
Form.SHOWMODAL
SUB Canvas_OnPaint
DIM x% AS INTEGER, y% AS INTEGER
FOR x% = 0 TO Canvas.Width
FOR y% = 0 TO Canvas.Height
Canvas.PSet(x%, y%, RGB(RND(256), RND(256), RND(256)))
NEXT y%
NEXT x%
END SUB
SUB Canvas_OnClick
IF MESSAGEDLG("Again?", mtConfirmation, mbYes OR mbNo, -1) = mrYes THEN
Canvas.RePaint
ELSE
END
END IF
END SUB
|