[Overview][Constants][Types][Classes][Procedures and functions][Index] |
Draws the tool bar button to the Canvas for the control.
Source position: comctrls.pp line 2146
protected procedure TToolButton.Paint; override; |
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 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, and dividers or separators for the button. Space is reserved as padding between the icon and text on the control (when both are used). The value in the cHorIconTextDist or cVerIconTextDist constant is scaled to the PPI setting for the control Font, and applied to the text position based on the setting in List. cHorIconTextDist is used when List is True. 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).
|
Implements an application tool bar with buttons or other visual controls. |
|
|
A clipped window into the parent Canvas. |
|
|
Implements the default handler used to draw the control. |
|
|
Event handler signalled to paint the control. |
|
|
Fills members in the theme element details. |
|
|
Draws a theme element using the specified theme element details. |
|
|
Record type with a theme element, part, and state values. |
|
|
Provides access to the Theme Services singleton for the widgetset. |
Version 3.2 | Generated 2024-02-25 | Home |