Difference between revisions of "TGraphicControl"
From Lazarus wiki
Jump to navigationJump to searchLine 10: | Line 10: | ||
If you want to accept keyboard input, or need to support child controls, use a [[TCustomControl]] instead. | If you want to accept keyboard input, or need to support child controls, use a [[TCustomControl]] instead. | ||
+ | |||
+ | Most important members: | ||
+ | [[procedure Paint]]; | ||
+ | [[property OnPaint]]: [[TNotifyEvent]]; | ||
+ | [[property Canvas]]: [[TCanvas]]; | ||
==See also== | ==See also== |
Revision as of 15:32, 13 March 2017
TGraphicControl is a base class for lightweight components like TBevel.
It supports simple lightweight controls that do not need the ability to accept keyboard input or contain other controls.
Since lightweight controls do not wrap GUI widgets, they use fewer resources than controls based on TWinControl.
TGraphicControl provides a Canvas property for access to the control's drawing surface and a virtual Paint method and an OnPaint handler, called in response to paint requests received by the parent control.
Override the Paint method or supply your own OnPaint handler, to do the actual drawing of the control.
If you want to accept keyboard input, or need to support child controls, use a TCustomControl instead.
Most important members:
procedure Paint; property OnPaint: TNotifyEvent; property Canvas: TCanvas;
See also