[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Re-implements drawing the glyph for the control to use the selected color.
Source position: dialogs.pp line 348
protected function TColorButton.DrawGlyph( |
ACanvas: TCanvas; |
const AClient: TRect; |
const AOffset: TPoint; |
AState: TButtonState; |
ATransparent: Boolean; |
BiDiFlags: LongInt |
):TRect; override; |
ACanvas |
|
Drawing surface where the control is drawn. |
AClient |
|
Client rectangle where the button face / color block is rendered. |
AOffset |
|
TPoint with horizontal and vertical offsets in AClient where the glyph is drawn. |
AState |
|
Button state for the glyph; bsDisabled draws the disabled pattern for the button control. |
ATransparent |
|
Not used in the method. |
BiDiFlags |
|
Not used in the method. |
Rectangle where the color block is drawn for the control.
DrawGlyph is an overridden method in TColorButton. It re-implements the ancestor method to draw the button face and color block (or swatch) for the control using the arguments passed to the method.
The value in AState determines the appearance for the glyph (color swatch). When set to bsDisabled, a bitmap with a disabled pattern (dotted lines) is drawn using the Color for the button face. Otherwise, the value in ButtonColor is used to draw the glyph. GetGlyphSize is called to get the dimensions for the glyph based on the settings in ButtonColorAutoSize and ButtonColorSize.
The return value is a TRect instance with the bounds affected in the drawing operation.
DrawGlyph calls the Rectangle method for the TCanvas instance in the Canvas argument using the return value for the method as an argument.
DrawGlyph does not call the inherited method which draws the glyph image for the speed button.
DrawGlyph is called from the MeasureDraw method in the ancestor class.
|
The Color of the control itself, i.e. the parts that are not the color display block; edges, background etc. |
|
|
The TColor value selected in the button control. |
|
|
True if the color block for the button can be automatically resized to fill the unused client area. |
|
|
Size of the color block (or swatch) on the button control. |
|
|
Gets the size for the glyph (color block / swatch) on the button control. |
|
|
Draws the glyph image on the canvas at a given offset in the specified client rectangle. |
|
|
Draws the glyph image on the canvas at a given offset in the specified client rectangle. |
|
|
A set of constants to define the state of a SpeedButton. |
Version 4.0 | Generated 2025-05-03 | Home |