Cortex
10.0.0-a4
|
The MenuItemDefinition class defines the contents of a menu item for use with the MenuDefinition class. More...
Public Member Functions | |
def | __init__ (self, dictionary=None, kwArgs) |
def | __repr__ (self) |
Public Attributes | |
command | |
secondaryCommand | |
divider | |
active | |
description | |
subMenu | |
checkBox | |
blindData | |
The MenuItemDefinition class defines the contents of a menu item for use with the MenuDefinition class.
It does nothing towards actually implementing a user interface, but instead defines content for a user interface implementation to realise. This allows menus to be defined in a UI agnostic way and then used with different toolkits.
The MenuItemDefinition has the following attributes :
command : a callable object invoked when the user selects the menu item
secondaryCommand : a callable object invoked when the user selects the menu item in some other way. this is toolkit dependent - for instance in maya this command would be used when the option box is selected.
divider : True if the menu item is a divider, False otherwise.
active : if False then the menu item is unselectable. may also be a callable object which returns a boolean value to allow dynamic activation
description : a string with help for the menu item
subMenu : a callable object which returns a MenuDefinition, to produce a dynamically generated submenu.
checkBox : A callable item to return True or False for checkBox state, or None for no checkBox at all. When checkBox is not None, the callable specified by the command attribute will be called whenever the checkBox is toggled.