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

# TColorButton.GetGlyphSize

Gets the size for the glyph (color block / swatch) on the button control.

## Declaration

Source position: dialogs.pp line 351

`protected function TColorButton.GetGlyphSize(`
`Drawing: Boolean;`
`PaintRect: TRect`
`):TSize; override;`

## Arguments

`Drawing` |  | True if a drawing operation is active; never set to False in LCL code.
`PaintRect` |  | TRect instance with the display area for the button control.

## Function result

TSize instance with the dimensions for the glyph (color block).

## Description

GetGlyphSize is an overridden TSize function used to get the dimensions for the glyph (color block / swatch) displayed on the button control. Values in ButtonColorAutoSize and ButtonColorSize determine the height and width used for the color block displayed on the control.

When ButtonColorAutoSize is set to True, the color block is auto-sized to fill the unused client area for the control specified in the PaintRect argument. Space is reserved for the Caption (color name), Spacing, BorderWidth, and Margin properties assigned to the control.

When ButtonColorAutoSize is False, ButtonColorSize is used as both the width and height for the color block.

The return value is a TSize instance where the width and height for the color block are stored in the CX and CY members (respectively). Layout determines whether spacing is reserved in the horizontal (blGlyphLeft, blGlyphRight) or vertical (blGlyphTop, blGlyphBottom) dimensions.

## See also

TColorButton.ButtonColorAutoSize |  | True if the color block for the button can be automatically resized to fill the unused client area.
TColorButton.ButtonColorSize |  | Size of the color block (or swatch) on the button control.
TColorButton.BorderWidth |  | Width for the borders on the button control.
TCustomSpeedButton.GetTextSize
TCustomSpeedButton.Spacing
TCustomSpeedButton.Layout
TCustomSpeedButton.Margin
TControl.Caption |  | The text displayed for the control.