Table of Contents

TTMSFNCToolBarButton Class

Toolbar button that can show a bitmap, a text label, and an optional drop-down popup. Supports normal, compact, and large layout modes.

API unit family: TMSFNCToolBar Inherits from: TTMSFNCCustomToolBarButton

Syntax

TTMSFNCToolBarButton = class(TTMSFNCCustomToolBarButton)

Properties

Name Description
Appearance Appearance settings controlling fill, stroke, and style for each interaction state. (inherited from TTMSFNCDefaultToolBarButton)
AutoBitmapSize When True, the bitmap is sized automatically based on the button height. (inherited from TTMSFNCDefaultToolBarButton)
AutoOptionsMenuText Caption used for this button's entry in the toolbar overflow (options) menu. (inherited from TTMSFNCCustomToolBarButton)
BitmapContainer Shared bitmap container used to look up button bitmaps by name. Set this to avoid embedding bitmaps in each button individually. (inherited from TTMSFNCDefaultToolBarButton)
BitmapPosition Position of the bitmap relative to the button caption. (inherited from TTMSFNCDefaultToolBarButton)
BitmapSize Width and height of the button bitmap in pixels. Leave unset to use the default size derived from the button height. (inherited from TTMSFNCDefaultToolBarButton)
BitmapVisible When True, the button bitmap is visible. Set to False to show only the text label. (inherited from TTMSFNCDefaultToolBarButton)
Bitmaps Bitmaps shown in the normal state. Scale entries are chosen automatically based on screen DPI. (inherited from TTMSFNCDefaultToolBarButton)
CanCopy When True, this element can be copied to the compact popup toolbar. Set to False to exclude it from the compact view. (inherited from TTMSFNCCustomToolBarElement)
CompactLayout Layout applied when the toolbar is in compact mode and this button is shown in the compact popup. (inherited from TTMSFNCDefaultToolBarButton)
ControlIndex Zero-based index of this control within the toolbar's control list. Set internally during layout; do not change at runtime. (inherited from TTMSFNCCustomToolBarElement)
DisabledBitmaps Bitmaps shown when the button is disabled. (inherited from TTMSFNCDefaultToolBarButton)
DisabledFontColor Caption font color when the button is disabled. Defaults to gcNull. (inherited from TTMSFNCDefaultToolBarButton)
DownFontColor Caption font color when the button is in the pressed (down) state. Defaults to gcNull. (inherited from TTMSFNCDefaultToolBarButton)
DownState Programmatic down (pressed) state of the button. Set to True to keep the button visually pressed. (inherited from TTMSFNCDefaultToolBarButton)
DropDownAutoWidth When True, the drop-down popup width matches the button width automatically. (inherited from TTMSFNCDefaultToolBarButton)
DropDownControl Custom control to embed inside the button's drop-down popup. Assign any TControl descendant to show a custom picker or panel. (inherited from TTMSFNCDefaultToolBarButton)
DropDownHeight Fixed height of the drop-down popup in pixels. Leave unset to use the content height. (inherited from TTMSFNCDefaultToolBarButton)
DropDownKind Controls how the drop-down area of the button is rendered and activated. (inherited from TTMSFNCCustomToolBarButton)
DropDownPosition Side of the button where the drop-down arrow is placed when DropDownKind is ddkDropDownButton. (inherited from TTMSFNCCustomToolBarButton)
DropDownWidth Fixed width of the drop-down popup in pixels. Leave unset to use the content width (or DropDownAutoWidth). (inherited from TTMSFNCDefaultToolBarButton)
Font Font used to render the button caption. (inherited from TTMSFNCDefaultToolBarButton)
Hidden When True, the button is not shown in the main toolbar but may still appear in the overflow menu. (inherited from TTMSFNCCustomToolBarButton)
HorizontalTextAlign Horizontal alignment of the button caption. (inherited from TTMSFNCDefaultToolBarButton)
HoverBitmaps Bitmaps shown when the mouse hovers over the button. (inherited from TTMSFNCDefaultToolBarButton)
HoverFontColor Caption font color when the mouse hovers over the button. Defaults to gcNull (use the default style color). (inherited from TTMSFNCDefaultToolBarButton)
LargeLayoutAutoBitmapSize When True, the large-layout bitmap size is calculated automatically based on the button height. (inherited from TTMSFNCDefaultToolBarButton)
LargeLayoutBitmapSize Width and height of the bitmap when the button is in large-layout (bblLarge) mode. (inherited from TTMSFNCDefaultToolBarButton)
LargeLayoutBitmaps Bitmaps shown in the large-layout (bblLarge) state at normal scale. (inherited from TTMSFNCDefaultToolBarButton)
LargeLayoutDisabledBitmaps Bitmaps shown in the large-layout state when the button is disabled. (inherited from TTMSFNCDefaultToolBarButton)
LargeLayoutHoverBitmaps Bitmaps shown in the large-layout state when the mouse hovers over the button. (inherited from TTMSFNCDefaultToolBarButton)
LastElement When True, this is the last element in the toolbar; used internally for layout boundary calculations. (inherited from TTMSFNCCustomToolBarElement)
Layout Current layout override for this button. bblNone means the toolbar controls the layout. (inherited from TTMSFNCDefaultToolBarButton)
MaximumLayout Largest layout this button may adopt when the toolbar has room to expand. Defaults to bblLarge. (inherited from TTMSFNCDefaultToolBarButton)
MinimumLayout Smallest layout this button may adopt when the toolbar is shrinking. Defaults to bblBitmap. (inherited from TTMSFNCDefaultToolBarButton)
PopupPlacement Anchor side of the screen where the drop-down popup appears relative to the button. (inherited from TTMSFNCDefaultToolBarButton)
ShowFocus When True, a focus rectangle is drawn around the button when it has keyboard focus. (inherited from TTMSFNCDefaultToolBarButton)
State Display state of this toolbar element — normal or large. (inherited from TTMSFNCCustomToolBarElement)
StretchBitmapIfNoText When True and no text is assigned, the bitmap is stretched to fill the button area. (inherited from TTMSFNCDefaultToolBarButton)
StretchText When True, the caption is stretched horizontally to fill the button width. (inherited from TTMSFNCDefaultToolBarButton)
Text Caption text shown on the button face. Supports HTML markup. (inherited from TTMSFNCDefaultToolBarButton)
TextVisible When True, the button caption is visible. Set to False to show only the bitmap. (inherited from TTMSFNCDefaultToolBarButton)
Trimming Text trimming applied when the caption does not fit within the button bounds. (inherited from TTMSFNCDefaultToolBarButton)
VerticalTextAlign Vertical alignment of the button caption. (inherited from TTMSFNCDefaultToolBarButton)
WordWrapping When True, long captions wrap to a second line instead of being trimmed. (inherited from TTMSFNCDefaultToolBarButton)

Methods

Name Description
CloseDropDown Closes the drop-down popup if it is open. (inherited from TTMSFNCDefaultToolBarButton)
Draw Renders the button onto the given graphics canvas within the specified rectangle. (inherited from TTMSFNCDefaultToolBarButton)
DropDown Opens the drop-down popup associated with this button. (inherited from TTMSFNCDefaultToolBarButton)
GetBitmap Returns the first bitmap from the Bitmaps collection, or nil if none is set. (inherited from TTMSFNCDefaultToolBarButton)
GetDropDownButtonControl Returns the companion drop-down button rendered when DropDownKind is ddkDropDownButton, or nil otherwise. Returns the companion drop-down button rendered when DropDownKind is ddkDropDownButton, or nil otherwise. (inherited from TTMSFNCCustomToolBarButton)
GetPopupControl Returns the internal popup control used for drop-down content. (inherited from TTMSFNCDefaultToolBarButton)
LoadSettingsFromFile Loads button settings from a JSON file. (inherited from TTMSFNCCustomToolBarButton)
LoadSettingsFromStream Loads button settings from a stream containing JSON. (inherited from TTMSFNCCustomToolBarButton)

Events

Name Description
OnBeforeDropDown Fires before the drop-down popup opens. Use it to update popup content dynamically. (inherited from TTMSFNCDefaultToolBarButton)
OnCloseDropDown Fires when the drop-down popup closes. (inherited from TTMSFNCDefaultToolBarButton)
OnDropDown Fires when the drop-down popup opens. (inherited from TTMSFNCDefaultToolBarButton)

Used by