Data model for a single menu item, holding text, bitmap, sub-items, and event handler for the popup menu.
API unit family: TMSFNCPopupMenu
Inherits from: TCollectionItem
Syntax
TTMSFNCMenuItem = class(TCollectionItem)
Properties
| Name |
Description |
| Action |
Action linked to this menu item; routes clicks to the action's OnExecute handler and synchronises the item's caption and enabled state. |
| Appearance |
Visual appearance overrides for this item; inherits defaults from the popup menu's appearance. |
| Bitmap |
Bitmap displayed in the item's image area. |
| BitmapName |
Name of the bitmap in the parent menu's BitmapContainer to use as the item image. |
| Checked |
When True, a check mark is displayed in the item's accessory area. Default is False. |
| Control |
Optional embedded control rendered inside this item. |
| ControlAlignment |
How the embedded control is aligned within the item. Default is caNone. |
| ControlPosition |
Position of the embedded control within the item. Default is cpCenterLeft. |
| DataInteger |
Optional integer value associated with this item for application use. |
| DataString |
Optional string value associated with this item for application use. |
| Enabled |
When False, the item is grayed and cannot be clicked or selected. Default is True. |
| GroupName |
Group name used for radio-style mutual exclusion with other check items sharing the same group. |
| Hint |
Hint text shown when the user hovers over this item. |
| ItemType |
Controls the rendering and interaction style of this item. Default is mitDefault. |
| Items |
Collection of child items that appear in this item's sub-menu. |
| Note |
Secondary note text shown alongside the item text. |
| Selectable |
When True, the item can be selected by mouse or keyboard. Default is True. |
| ShortCut |
Keyboard shortcut displayed alongside the item text. |
| ShowHint |
When True, the Hint text is displayed on hover. Default is False. |
| Tag |
Integer tag for application-specific identification of this item. |
| Text |
Display text of the menu item. |
Methods
| Name |
Description |
| AddBitmap |
Assigns the given bitmap as the item image. |
| AddMenuItem |
Adds a child menu item with the specified text and type, and returns it. |
| AddMenuSeparatorItem |
Adds a separator item as a child of this item and returns it. |
Events
| Name |
Description |
| OnClick |
Fires when the user clicks the item. |