Compile and run this sample:
Code: Select all
#INCLUDE "dcdialog.CH"
FUNCTION Main()
LOCAL GetList[0], oGraStatic, bPaint
bPaint := {|a,b,o|PaintGraStuff(oGraStatic)}
@ 5,5 DCSTATIC TYPE XBPSTATIC_TYPE_TEXT OBJECT oGraStatic SIZE 600,600 PIXEL ;
EVAL {|o|o:paint := bPaint} ;
COLOR nil, GRA_CLR_BACKGROUND
DCSETPARENT TO oGraStatic
@ 40,40 DCPUSHBUTTONXP CAPTION 'Button 1' SIZE 200,200 PIXEL ;
EVAL {|o|o:paint := bPaint} ;
RADIUS 200
@ 290,40 DCPUSHBUTTONXP CAPTION 'Button 2' SIZE 200,200 PIXEL ;
EVAL {|o|o:paint := bPaint} ;
RADIUS 200
@ 40,290 DCPUSHBUTTONXP CAPTION 'Button 3' SIZE 200,200 PIXEL ;
EVAL {|o|o:paint := bPaint} ;
RADIUS 200
@ 290,290 DCPUSHBUTTONXP CAPTION 'Button 4' SIZE 200,200 PIXEL ;
EVAL {|o|o:paint := bPaint} ;
RADIUS 200
DCREAD GUI FIT
RETURN nil
PROC appsys ; RETURN
* ----------
STATIC FUNCTION PaintGraStuff( oDrawingArea )
LOCAL aLineAttrib, oPS
aLineAttrib := Array( GRA_AL_COUNT )
aLineAttrib[GRA_AL_WIDTH] := 3
aLineAttrib[GRA_AL_COLOR] := 28555199
oPS := oDrawingArea:lockPS()
graSetAttrLine( oPS, aLineAttrib )
graLine( oPS, { 50,50 },{ 500,500 } )
oDrawingArea:unlockPS()
RETURN nil