class
GUIMenu
Class that allows creation of menus with drop down functionality.
Menu consists out of a number of top level elements, each of which opens a drop down menu which may internally hold a deeper hierarchy of menus.
Public
Constructors
GUIMenu
Methods
~GUIMenu
AddMenuItem
Adds a new menu item with the specified callback.
- path
- Path that determines where to add the element. See class information on how to specify paths. All sub-elements of a path will be added automatically.
- callback
- Callback that triggers when the path element is selected.
- priority
- Priority determines the position of the menu item relative to its siblings. Higher priority means it will be placed earlier in the menu.
- key
- Keyboard shortcut that can be used for triggering the menu item.
Returns: A menu item object that you may use for removing the menu item later. Its lifetime is managed internally.
AddSeparator
Adds a new separator menu item with the specified callback.
- path
- Path that determines where to add the element. See class information on how to specify paths. All sub-elements of a path will be added automatically.
- priority
- Priority determines the position of the menu item relative to its siblings. Higher priority means it will be placed earlier in the menu.
Returns: A menu item object that you may use for removing the menu item later. Its lifetime is managed internally.
GetMenuItem
Returns a menu item at the specified path, or null if one is not found.
RemoveMenuItem
Removes the specified menu item from the path.
If the menu item has any sub-menus they will also be removed.
SetLocalizedName
Normally menu items use values from their paths as their names.
However path labels don't provide a way of localizing the menu item. This method allows you to set specific names (different from path labels) to each menu item. All the values are localized so they will also be updated according to the string table.
- menuItemLabel
- The menu item label. (for example if you have a menu like "View/Toolbars/Find, this parameter would be either "View", "Toolbars" or "Find" depending which entry you want to localize)
- localizedName
- Localized string with the name.
GetDropDownData
Returns data used for initializing a drop down list, for all elements.
Protected
Methods
AddMenuItemInternal
Adds a menu item at the specified path, as a normal button or as a separator.
GetDropDownDataInternal
Return drop down data for the specified menu.