[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Controls' (#lcl)

TGraphicControl

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TGraphicControl is the base class for all lightweight controls.

Declaration

Source position: controls.pp line 2285

type TGraphicControl = class(TControl) end;

protected

  class procedure WSRegisterClass; override;

  

Registers this component class with the current WidgetSet.

  procedure FontChanged(); override;

  

Handles changes of the Font property.

  procedure Paint; virtual;

  

Override this method with your own painting code.

  procedure DoOnChangeBounds; override;

  

Invokes the OnChangeBounds event handler

  procedure DoOnParentHandleDestruction; override;

  property OnPaint: TNotifyEvent; [rw]

  

Supply your own OnPaint handler for painting the control.

  procedure CMCursorChanged(); message;

public

  constructor Create(); override;

  destructor Destroy; override;

  property Canvas: TCanvas; [r]

  

A clipped window into the parent Canvas.

Inheritance

TGraphicControl

  

TGraphicControl is the base class for all lightweight controls.

|

TControl

  

The base class for visible controls.

|

TLCLComponent

  

The base class for LCL components associated with widgets.

|

TComponent

?

TObject

Description

TGraphicControl supports simple lightweight controls that do not need the ability to accept keyboard input or contain other controls.

If you want to accept keyboard input, or need to support child controls, use a TCustomControl instead.

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.

See also

#lcl.Controls.TCustomControl

  

The base class for windowed controls which paint themselves.

TGraphicControl.Paint

  

Override this method with your own painting code.

TGraphicControl.OnPaint

  

Supply your own OnPaint handler for painting the control.

#lcl.Graphics.TCanvas

  

TCanvas represents a drawing surface which might be attached to a visual control which might be displayed on the screen or to an offscreen bitmap. It contains a number of drawing functions.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.