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

TToolButton.Paint

Draws the tool bar button to the Canvas for the control.

Declaration

Source position: comctrls.pp line 2128

protected procedure TToolButton.Paint; override;

Description

Paint is an overridden method in TToolButton, and provides nested routines used to draw the the tool button using the style, caption, and image for the control. Paint requires ToolBar to be assigned before it can render the button control using the routines in the overridden method. When ToolBar is unassigned, only the inherited Paint method is called.

Paint calculates the area display area for the button, and calls GetButtonDrawDetail to get the Theme Element Details for the control.

When an OnPaintButton event handler has been assigned for the ToolBar, it is used to render the button using the theme details. No additional actions are performed in the method.

When OnPaintButton is unassigned, the default drawing routines are used to render the button on the Canvas for the control. This includes decorations like a drop-down indicator, an image using the required state, the Caption text, button relief, and dividers or separators. Methods in ThemeServices are called to render the control to the Handle for the Canvas.

Paint calls the inherited method prior to exit to signal the OnPaint event handler (when assigned).

See also

TGraphicControl.Canvas

  

A clipped window into the parent Canvas.

TGraphicControl.Paint

  

Implements the default handler used to draw the control.

TGraphicControl.OnPaint

  

Event handler signalled to paint the control.

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