TToolButton.Paint procedure
Draws the tool bar button to the Canvas for the control.
Declaration
procedure Paint; overrideDescription
Paint is an overridden method in
TToolButton, and
provides nested routines used to draw 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).
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
