Menu

The Menu object lets you manipulate an individual popup menu and menu items.  See also MenuManager.

Properties:

ItemId(index)

type: Integer

index: Integer

 

Description: Returns the menu item id at the specified index.  Returns -1 if the item is a separator, or 0 if it is a popup menu.

 

ItemCount

type: Integer

 

Description: Returns the number of items in this menu, including separators and popup menus.

Methods:

InsertItem(index, name)

index: Integer

name: String

Returns: Integer

 

Description: Insert a menu item into this menu at the specified index.  The integer returned is the menu item id which will be sent with the OnMenuItemSelected callback in the event manager.  The menu item id should therefore be stored.

 

InsertSeparator(index)

index: Integer

Returns: Boolean

 

Description: Inserts a separator into this menu at the specified index.  The returned value is True if the insert was successful.

 

InsertMenu(index, name)

index: Integer

name: String

Returns: Menu object

 

Description: Inserts a popup menu into this menu at the specified index.

 

DeleteItem(index)

index: Integer

Returns: Boolean

 

Description: Remove a menu item at the specified index.  The returned value is True if the removal was successful.

 

Find(name)

name: String

Returns: Integer

 

Description: Find the menu item with the specified name in this menu.  Note that the name does not have to have an ampersand in it to designate the accelerator key character, this is automatically removed by the comparison routine.  The value returned is the index of the item in the menu, or -1 if the item was not found in this menu.

 

IsSubMenu(index)

index: Integer

Returns: Boolean

 

Description: Determine if the menu item at the specified index is a submenu.

 

GetSubMenu(index)

index: Integer

Returns: Menu object

 

Description: Retrieve the submenu at the specified index.  The returned object is Nothing if the item is not a submenu.