This sample illustrates how to use form graphics methods (PSet, Line, and Circle) and properties (DrawMode, DrawStyle, DrawWidth) to make it possible for a user to draw figures and shapes on a form in different colors and different pen widths.
The sample includes a toolbar (defined in Fdproc.prg) and a form (based on frmFD in Fd.vcx). The user can select settings in the toolbar that affect the graphics properties of the form. When the form is set to accept user drawing, the MousePointer is set to 2 (cross-hairs).
The drawing functionality is coded in the methods associated with the MouseDown and MouseMove events of the form.
* MouseDown PARAMETERS nButton, nShift, nXCoord, nYCoord IF THIS.MousePointer = 2 THIS.PSet(nXCoord, nYCoord) ENDIF * MouseMove PARAMETERS nButton, nShift, nXCoord, nYCoord IF THIS.MousePointer = 2 THISFORM.LINE(nXCoord, nYCoord) ENDIF