GenericMenu is the base class for menus.
Override the build() method to create the menu, making a call to addItem() for every item appearing in the menu.
#include
<class_generic_menu_1_1_generic_menu.h>
Public Member Functions |
|
__init__ () | |
__del__ () | |
getParentWindow () | |
Returns the window to which this menu is
parented. |
|
getMenuId () | |
getLabel () | |
Returns the name of this menu. |
|
build () | |
Builds the menu by adding the items and
their respective actions on highlight and selection. |
|
appendMenuItem () | |
You may have already created a menu item,
and now you want to add it. |
|
appendItem () | |
Adds an item with 'label' as the label.
|
|
appendCheckItem () | |
Adds a check item with 'label' as the label.
|
|
appendRadioItem () | |
Adds a radio item with 'label' as the label.
|
|
appendSeparator () | |
Appends a separator. |
|
appendMenu () | |
Adds the given menu with 'label' as the
label. |
|
select () | |
enableMenuItems () | |
checkMenuItems () | |
resetMenu () | |
insertMenuItem () | |
Inserts an item with 'label' as the label.
|
|
insertItem () | |
Inserts the item at the given position.
|
|
removeItemById () | |
Removes the item with the given id, but does
not delete it. |
|
destroyItemById () | |
Destroy the item with the given id. |
|
hasItemWithId () | |
Returns True if an item with the given id
belongs to this menu; False otherwise. |
|
getPositionById () | |
Returns the index of the item with the given
id. |
|
generateMenu () | |
validInMenuItems () | |
generateActionCallback () | |
generateCheckCallback () | |
Public Attributes |
|
allowActionInvocation |
GenericMenu.GenericMenu.__init__ | ( | ) |
Reimplemented in GenericMenu.GenericMenu2, and GenericPopupMenu.GenericPopupMenu.
GenericMenu.GenericMenu.__del__ | ( | ) |
GenericMenu.GenericMenu.getParentWindow | ( | ) |
Returns the window to which this menu is parented.
GenericMenu.GenericMenu.getMenuId | ( | ) |
GenericMenu.GenericMenu.getLabel | ( | ) |
Returns the name of this menu.
This method must be overridden by derived classes and return a string representing the name of the menu
GenericMenu.GenericMenu.build | ( | ) |
Builds the menu by adding the items and their respective actions on highlight and selection.
Override this method in the subclass, calling addItem() for every menu item to appear in the menu.
Reimplemented in GenericPopupMenu.GenericPopupMenu.
GenericMenu.GenericMenu.appendMenuItem | ( | ) |
You may have already created a menu item, and now you want to add it.
Fine.
GenericMenu.GenericMenu.appendItem | ( | ) |
Adds an item with 'label' as the label.
When a select callback function is provided, it will be executed when the item is selected. When a highlight callback is provided, it will be executed when the item is highlighted. Each callback must be a function that takes a single event argument.
When a help string is provided, this string will be displayed on the status bar on highlighting this item.
Specify the initial enable/disable state using 'enable'. By default, this is True.
GenericMenu.GenericMenu.appendCheckItem | ( | ) |
Adds a check item with 'label' as the label.
When a select callback function is provided, it will be executed when the item is selected. When a highlight callback is provided, it will be executed when the item is highlighted. Each callback must be a function that takes a single event argument.
When a help string is provided, this string will be displayed on the status bar on highlighting this item.
Specify the initial enable/disable state using 'enable'. By default, this is True.
Specify the initial checked/unchecked state using 'check'. By default, this is True.
GenericMenu.GenericMenu.appendRadioItem | ( | ) |
Adds a radio item with 'label' as the label.
When a select callback function is provided, it will be executed when the item is selected. When a highlight callback is provided, it will be executed when the item is highlighted. Each callback must be a function that takes a single event argument.
When a help string is provided, this string will be displayed on the status bar on highlighting this item.
Specify the initial enable/disable state using 'enable'. By default, this is True.
GenericMenu.GenericMenu.appendSeparator | ( | ) |
Appends a separator.
GenericMenu.GenericMenu.appendMenu | ( | ) |
Adds the given menu with 'label' as the label.
When a help string is provided, this string will be displayed on the status bar on highlighting this item.
Specify the initial enable/disable state using 'enable'. By default, this is True.
GenericMenu.GenericMenu.select | ( | ) |
GenericMenu.GenericMenu.enableMenuItems | ( | ) |
GenericMenu.GenericMenu.checkMenuItems | ( | ) |
GenericMenu.GenericMenu.resetMenu | ( | ) |
GenericMenu.GenericMenu.insertMenuItem | ( | ) |
Inserts an item with 'label' as the label.
When a select callback function is provided, it will be executed when the item is selected. When a highlight callback is provided, it will be executed when the item is highlighted. Each callback must be a function that takes a single event argument.
When a help string is provided, this string will be displayed on the status bar on highlighting this item.
Specify the initial enable/disable state using 'enable'. By default, this is True.
GenericMenu.GenericMenu.insertItem | ( | ) |
Inserts the item at the given position.
GenericMenu.GenericMenu.removeItemById | ( | ) |
Removes the item with the given id, but does not delete it.
Returns the removed item; the item can be re-inserted using insertItem().
GenericMenu.GenericMenu.destroyItemById | ( | ) |
Destroy the item with the given id.
GenericMenu.GenericMenu.hasItemWithId | ( | ) |
Returns True if an item with the given id belongs to this menu; False otherwise.
GenericMenu.GenericMenu.getPositionById | ( | ) |
Returns the index of the item with the given id.
Returns -1 if the item is not found.
GenericMenu.GenericMenu.generateMenu | ( | ) |
GenericMenu.GenericMenu.validInMenuItems | ( | ) |
GenericMenu.GenericMenu.generateActionCallback | ( | ) |
GenericMenu.GenericMenu.generateCheckCallback | ( | ) |