Class MenuItem
A clickable part of a menu.
Holds the menu items of a Menu, PopupMenu, or even another MenuItem.
Inheritance
Component | MenuItem 🡄 Component 🡄 Object |
Properties
... [] | Unknown property? |
Caption | Text of the menu item. |
Count | Number of children attached to this menuitem. |
Item [] | Array to access each child menuitem. |
Menu | The menu this item resides in. |
MenuIndex | The position this menu item is in it's parent. |
OnClick | Function to call when the menu item is activated. |
Parent | The menuitem this item hangs under. |
Shortcut | Shortcut in textform to trigger the menuitem. |
Methods
add ( menuitem ) | Adds a menuItem as a submenu item. |
delete ( index ) | |
doClick () | Executes the onClick method if one is assigned. |
getCaption () | Gets the caption of the menu item. |
getCount () | |
getItem ( index ) | Returns the menuitem object at the given index. |
getOnClick () | |
getShortcut () | Returns the shortcut for this menu item. |
insert ( index, menuitem ) | Adds a menuItem as a submenu item at the given index. |
setCaption ( caption ) | Sets the caption of the menu item. |
setOnClick ( function ) | Sets an onClick event. |
setShortcut ( shortcut ) | Sets the shortcut for this menuitem. |
Related Functions
createMenuItem ( ownermenu ) | Creates a menu item that gets added to the owner menu. |
Inheritance
Properties
- ... []
-
Unknown property?
Item []
See: source.
Type:
array - Caption
-
Text of the menu item.
Type:
- Count
-
Number of children attached to this menuitem.
Type:
int - Item []
-
Array to access each child menuitem.
Type:
array - Menu
-
The menu this item resides in.
Type:
- MenuIndex
-
The position this menu item is in it's parent.
Type:
int - OnClick
-
Function to call when the menu item is activated.
Type:
func - Parent
-
The menuitem this item hangs under.
Type:
- Shortcut
-
Shortcut in textform to trigger the menuitem.
Type:
Methods
- add ( menuitem )
-
Adds a menuItem as a submenu item.
Parameters:
- menuitem
- delete ( index )
-
Parameters:
- index int
- doClick ()
- Executes the onClick method if one is assigned.
- getCaption ()
- Gets the caption of the menu item.
- getCount ()
- getItem ( index )
-
Returns the menuitem object at the given index.
Parameters:
- index int
- getOnClick ()
- getShortcut ()
- Returns the shortcut for this menu item.
- insert ( index, menuitem )
-
Adds a menuItem as a submenu item at the given index.
Parameters:
- index int
- menuitem
- setCaption ( caption )
-
Sets the caption of the menu item.
Parameters:
- caption string
- setOnClick ( function )
-
Sets an onClick event.
Parameters:
- function func
- setShortcut ( shortcut )
-
Sets the shortcut for this menuitem.
A shortcut is a string in the form of ("ctrl+x").
Parameters:
- shortcut
Related Functions
- createMenuItem ( ownermenu )
-
Creates a menu item that gets added to the owner menu.
Parameters:
- ownermenu Menu