[Overview][Constants][Types][Classes][Procedures and functions][Index] |
Draws the tool bar button to the Canvas for the control.
Source position: comctrls.pp line 2139
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 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).
|
A clipped window into the parent Canvas. |
|
|
Implements the default handler used to draw the control. |
|
|
Event handler signalled to paint the control. |