Back to Devexpress

TcxButtonImageOptions.Glyph Property

vcl-cxbuttons-dot-tcxbuttonimageoptions.md

latest4.4 KB
Original Source

TcxButtonImageOptions.Glyph Property

Specifies one or more glyphs that the button can display.

Declaration

delphi
property Glyph: TdxSmartGlyph read; write;

Property Value

TypeDescription
TdxSmartGlyph

The Smart Image container with one or more glyphs in one source image. If the source image contains multiple glyphs, different glyphs correspond to different button states.

The NumGlyphs property specifies the number of glyphs in the source image.

|

Remarks

Use Glyph or ImageIndex/Images to display a glyph within the button if its PaintStyle property is set to bpsDefault or bpsGlyph.

You can use the Glyph property to load an image that contains up to 4 identically-sized glyphs (in a row from left to right). The NumGlyphs property specifies the number of glyphs stored in the source image.

Glyph Order and Button States

If the source image loaded into the image container accessible through the Glyph property consists of multiple images, the image order defines their corresponding button states as follows:

Normal

The first glyph in the source image always corresponds to the normal (base) button state (when the button is not pressed, activated, or disabled).

If the source image contains only one glyph (the NumGlyphs property value is 1 ( default )), the button always uses the Normal glyph for all its states.

Disabled

The second glyph in the source image corresponds to the disabled (non-interactive) button state.

The state-specific glyph is available if the NumGlyphs property value is 2 or more.

Clicked

The third glyph in the source image corresponds to the clicked state.

The state-specific glyph is available if the NumGlyphs property value is 3 or more.

Down/Pressed

The fourth glyph in the source image corresponds to the down (or pressed/held down) button state.

The state-specific glyph is available if the NumGlyphs property value is 4.

Button Layout Customization

You can use the following properties to modify caption and glyph positions within the button:

LayoutAllows you to switch between four predefined button content layouts (horizontal and vertical).MarginSpecifies the distance between the displayed glyph and the nearest button border (depending on the current Layout property value).SpacingAllows you to adjust the distance between the glyph and the caption (regardless of the current Layout property value).

Glyph Background Transparency

The Glyph property uses a TdxSmartGlyph object as an image container. All transparent pixels in the loaded image should use the alpha channel.

Glyph Property and Other Glyph Sources

The Glyph property has higher priority than the ImageIndex(TcxButtonImageOptions.ImageIndex) property and the ImageIndex(TContainedAction.ImageIndex) of the associated Action object.

See Also

TcxCustomCheckGroupProperties.Glyph Property

TcxButtonImageOptions Class

TcxButtonImageOptions Members

cxButtons Unit