Sign in Join
FPDoc Onlineexperiment

TColorButton.GetGlyphSize function

Member of TColorButtonprotectedIn unit Dialogs

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

Declaration

pascal
function GetGlyphSize(Drawing: Boolean; PaintRect: TRect): TSize
 ; override

Arguments

DrawingTrue 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

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.