pymel.core.uitypes.MenuEditor

Inheritance diagram of MenuEditor

class MenuEditor

class counterpart of mel function menuEditor

A menuEditor displays the contents of a popup menu and allows the menu’s items to be edited. Menu items are represented by labelled icons which can be dragged around within the editor to change the menu’s layout. Various objects can be dragged and dropped into the menuEditor to create new menu items: toolButtons from the shelf or toolbox, shelfButtons from the shelf, iconTextButtons with attached commands, and scripts from the command window. When editing a Marking Menu, the radial menu items correspond to 8 icons arranged in a circle within the menuEditor. Overflow items in the Marking Menu (or linear items in a normal menu) are displayed in a column below the radial items. To edit a submenu of a popup menu, a new menuEditor instance must be created (typically within its own window) and attached to its parent menuEditor. Some flags require the position of a menu item to be passed in as an argument. For these, positions are specified with a (string,int) pair, where the string corresponds to a radial position (possibily “None”) and the int corresponds to a linear position (possibly equal to 0 for none). Radial positions are specified by one of (“N”,0), (“NE”,0), (“E”,0), (“SE”,0), (“S”,0), (“SW”,0), (“W”,0) or (“NW”,0). Overflow, or linear positions, are specified with (“None”,i), where i is a 1-based index giving the position of the item within the overflow column.Note:This command in not meant to be called explicitly. It was created to support the Marking Menu editor. It is recommended that you use that editor to modify marking menus.

cellWidthHeight(val=True, **kwargs)

The width and height of the icons in the menuEditor.

Derived from mel command maya.cmds.menuEditor

dragCallback(val=True, **kwargs)

Adds a callback that is called when the middle mouse button is pressed. The MEL version of the callback is of the form: global proc string[] callbackName(string $dragControl, int $x, int $y, int $mods) The proc returns a string array that is transferred to the drop site. By convention the first string in the array describes the user settable message type. Controls that are application defined drag sources may ignore the callback. $mods allows testing for the key modifiers CTL and SHIFT. Possible values are 0 == No modifiers, 1 == SHIFT, 2 == CTL, 3 == CTL + SHIFT. In Python, it is similar, but there are two ways to specify the callback. The recommended way is to pass a Python function object as the argument. In that case, the Python callback should have the form: def callbackName( dragControl, x, y, modifiers ): The values of these arguments are the same as those for the MEL version above. The other way to specify the callback in Python is to specify a string to be executed. In that case, the string will have the values substituted into it via the standard Python format operator. The format values are passed in a dictionary with the keys “dragControl”, “x”, “y”, “modifiers”. The “dragControl” value is a string and the other values are integers (eg the callback string could be “print ‘%(dragControl)s %(x)d %(y)d %(modifiers)d’”)

Derived from mel command maya.cmds.menuEditor

dropCallback(val=True, **kwargs)

Adds a callback that is called when a drag and drop operation is released above the drop site. The MEL version of the callback is of the form: global proc callbackName(string $dragControl, string $dropControl, string $msgs[], int $x, int $y, int $type) The proc receives a string array that is transferred from the drag source. The first string in the msgs array describes the user defined message type. Controls that are application defined drop sites may ignore the callback. $type can have values of 1 == Move, 2 == Copy, 3 == Link. In Python, it is similar, but there are two ways to specify the callback. The recommended way is to pass a Python function object as the argument. In that case, the Python callback should have the form: def pythonDropTest( dragControl, dropControl, messages, x, y, dragType ): The values of these arguments are the same as those for the MEL version above. The other way to specify the callback in Python is to specify a string to be executed. In that case, the string will have the values substituted into it via the standard Python format operator. The format values are passed in a dictionary with the keys “dragControl”, “dropControl”, “messages”, “x”, “y”, “type”. The “dragControl” value is a string and the other values are integers (eg the callback string could be “print ‘%(dragControl)s %(dropControl)s %(messages)r %(x)d %(y)d %(type)d’”)

Derived from mel command maya.cmds.menuEditor

getAnnotation(**kwargs)

Annotate the control with an extra string value.

Derived from mel command maya.cmds.menuEditor

getBackgroundColor(**kwargs)

The background color of the control. The arguments correspond to the red, green, and blue color components. Each component ranges in value from 0.0 to 1.0.When setting backgroundColor, the background is automatically enabled, unless enableBackground is also specified with a false value.

Derived from mel command maya.cmds.menuEditor

getCellHeight(**kwargs)

The height of the icons in the menuEditor.

Derived from mel command maya.cmds.menuEditor

getCellWidth(**kwargs)

The width of the icons in the menuEditor.

Derived from mel command maya.cmds.menuEditor

getCheckBoxPresent(**kwargs)

This controls whether a menu item has a check box or not. The arguments are a flag indicating presence, followed by the position of the menu item. This flag is ignored if the menu item is a submenu item. If queried, an array of booleans is returned containing all the flags. The first 8 entries of the array correspond to radial items (in order, “N”, “NE”, ... “NW”), and all later entries correspond to overflow (or linear) menu items.

Derived from mel command maya.cmds.menuEditor

getCheckBoxState(**kwargs)

The state of the check box associated with a menu item. The arguments are a flag indicating state, followed by the position of the menu item. This flag is ignored if the menu item does not have a check box. If queried, an array of booleans is returned containing all the flags. The first 8 entries of the array correspond to radial items (in order, “N”, “NE”, ... “NW”), and all later entries correspond to overflow (or linear) menu items.

Derived from mel command maya.cmds.menuEditor

getCommand(**kwargs)

The command or script executed by a menu item. The arguments are the command string or script name, followed by the position of the menu item. This flag is ignored if the menu item is a submenu item or a separator item. If queried, an array of strings is returned containing all the commands. The first 8 entries of the array correspond to radial items (in order, “N”, “NE”, ... “NW”), and all later entries correspond to overflow (or linear) menu items.

Derived from mel command maya.cmds.menuEditor

getDocTag(**kwargs)

Add a documentation flag to the control. The documentation flag has a directory structure like hierarchy. Eg. -dt render/multiLister/createNode/material

Derived from mel command maya.cmds.menuEditor

getEnable(**kwargs)

The enable state of the control. By default, this flag is set to true and the control is enabled. Specify false and the control will appear dimmed or greyed-out indicating it is disabled.

Derived from mel command maya.cmds.menuEditor

getEnableBackground(**kwargs)

Enables the background color of the control.

Derived from mel command maya.cmds.menuEditor

getFullPathName(**kwargs)

Return the full path name of the widget, which includes all the parents

Derived from mel command maya.cmds.menuEditor

getHeight(**kwargs)

The height of the control. The control will attempt to be this size if it is not overruled by parent layout conditions.

Derived from mel command maya.cmds.menuEditor

getImage(**kwargs)

The filename of the icon associated with a menu item. This icon is displayed by the menuEditor to represent the menu item. The arguments are the icon filename, followed by the position of the menu item. If queried, an array of strings is returned containing all the icon filenames. The first 8 entries of the array correspond to radial items (in order, “N”, “NE”, ... “NW”), and all later entries correspond to overflow (or linear) menu items.

Derived from mel command maya.cmds.menuEditor

getIsObscured(**kwargs)

Return whether the control can actually be seen by the user. The control will be obscured if its state is invisible, if it is blocked (entirely or partially) by some other control, if it or a parent layout is unmanaged, or if the control’s window is invisible or iconified.

Derived from mel command maya.cmds.menuEditor

getLabel(**kwargs)

The label of a menu item. The arguments are the label text, followed by the position of the menu item. If queried, an array of strings is returned containing all the labels. The first 8 entries of the array correspond to radial items (in order, “N”, “NE”, ... “NW”), and all later entries correspond to overflow (or linear) menu items.

Derived from mel command maya.cmds.menuEditor

getManage(**kwargs)

Manage state of the control. An unmanaged control is not visible, nor does it take up any screen real estate. All controls are created managed by default.

Derived from mel command maya.cmds.menuEditor

getMenuItemTypes(**kwargs)

This is a query only flag. Returns an array of strings indicating the type of contents in each cell of the menuEditor. Cells can be “vacant”, or may contain a regular menu “item”, or a “separator”, or a “submenu” item. In each case, the corresponding string is returned. The first 8 entries of the array correspond to radial items (in order, “N”, “NE”, ... “NW”), and all later entries correspond to overflow (or linear) menu items.

Derived from mel command maya.cmds.menuEditor

getNumberOfPopupMenus(**kwargs)

Return the number of popup menus attached to this control.

Derived from mel command maya.cmds.menuEditor

getOptionBoxCommand(**kwargs)

The command or script executed by a menu item’s associated option box item. The arguments are the command string or script name, followed by the position of the menu item. This flag is ignored if the menu item does not have an associated option box item. If queried, an array of strings is returned containing all the commands. The first 8 entries of the array correspond to radial items (in order, “N”, “NE”, ... “NW”), and all later entries correspond to overflow (or linear) menu items.

Derived from mel command maya.cmds.menuEditor

getOptionBoxPresent(**kwargs)

This controls whether a menu item has an associated option box item or not. The arguments are a flag indicating presence, followed by the position of the menu item. This flag is ignored if the menu item is a submenu item. If queried, an array of booleans is returned containing all the flags. The first 8 entries of the array correspond to radial items (in order, “N”, “NE”, ... “NW”), and all later entries correspond to overflow (or linear) menu items.

Derived from mel command maya.cmds.menuEditor

getPopupMenuArray(**kwargs)

Return the names of all the popup menus attached to this control.

Derived from mel command maya.cmds.menuEditor

getPreventOverride(**kwargs)

If true, this flag disallows overriding the control’s attribute via the control’s right mouse button menu.

Derived from mel command maya.cmds.menuEditor

getRadioButtonPresent(**kwargs)

This controls whether a menu item has a radio button or not. The arguments are a flag indicating presence, followed by the position of the menu item. This flag is ignored if the menu item is a submenu item. If queried, an array of booleans is returned containing all the flags. The first 8 entries of the array correspond to radial items (in order, “N”, “NE”, ... “NW”), and all later entries correspond to overflow (or linear) menu items.

Derived from mel command maya.cmds.menuEditor

getRadioButtonState(**kwargs)

The state of the radio button associated with a menu item. The arguments are a flag indicating state, followed by the position of the menu item. This flag is ignored if the menu item does not have a radio button. If queried, an array of booleans is returned containing all the flags. The first 8 entries of the array correspond to radial items (in order, “N”, “NE”, ... “NW”), and all later entries correspond to overflow (or linear) menu items.

Derived from mel command maya.cmds.menuEditor

getSeparator(**kwargs)

In edit mode this adds a separator to the menuEditor at the specified position. The parameters are the radialPosition and the overflowRow. If queried, an array of booleans is returned indicating if the item is a separator item. The first 8 entries of the array correspond to radial items (in order, “N”, “NE”, ... “NW”), and all later entries correspond to overflow (or linear) menu items.

Derived from mel command maya.cmds.menuEditor

getStyle(**kwargs)

This is the style of icons within the menuEditor. Valid styles are “iconOnly”, “textOnly”, “iconAndTextHorizontal” and “iconAndTextVertical”.

Derived from mel command maya.cmds.menuEditor

getSubMenuEditorsOpen(**kwargs)

This is a query only flag. Returns an array of booleans, each of which indicates if a sub-menuEditor is open and attached to the menu item in a particular cell. One boolean is returned for each cell in the menuEditor, even if the cell is vacant or contains a non-submenu item (false will be returned in both these cases). Only when a cell contains a submenu item can true possibily be returned. The first 8 entries of the array correspond to radial items (in order, “N”, “NE”, ... “NW”), and all later entries correspond to overflow (or linear) menu items.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.menuEditor

getTopLevelMenu(**kwargs)

The popup menu to attach to the editor. All editing operations performed in the editor (i.e. inserting/deleting/moving an item) will be immediately reflected in this menu. This flag is ignored if the editor is a sub-menuEditor. The editor will update gracefully if the value of the flag is changed from its initial value.

Derived from mel command maya.cmds.menuEditor

getVisible(**kwargs)

The visible state of the control. A control is created visible by default. Note that a control’s actual appearance is also dependent on the visible state of its parent layout(s).

Derived from mel command maya.cmds.menuEditor

getVisibleChangeCommand(**kwargs)

Command that gets executed when visible state of the control changes.

Derived from mel command maya.cmds.menuEditor

getWidth(**kwargs)

The width of the control. The control will attempt to be this size if it is not overruled by parent layout conditions.

Derived from mel command maya.cmds.menuEditor

setAnnotation(val=True, **kwargs)

Annotate the control with an extra string value.

Derived from mel command maya.cmds.menuEditor

setBackgroundColor(val=True, **kwargs)

The background color of the control. The arguments correspond to the red, green, and blue color components. Each component ranges in value from 0.0 to 1.0.When setting backgroundColor, the background is automatically enabled, unless enableBackground is also specified with a false value.

Derived from mel command maya.cmds.menuEditor

setCellHeight(val=True, **kwargs)

The height of the icons in the menuEditor.

Derived from mel command maya.cmds.menuEditor

setCellWidth(val=True, **kwargs)

The width of the icons in the menuEditor.

Derived from mel command maya.cmds.menuEditor

setCheckBoxPresent(val=True, **kwargs)

This controls whether a menu item has a check box or not. The arguments are a flag indicating presence, followed by the position of the menu item. This flag is ignored if the menu item is a submenu item. If queried, an array of booleans is returned containing all the flags. The first 8 entries of the array correspond to radial items (in order, “N”, “NE”, ... “NW”), and all later entries correspond to overflow (or linear) menu items.

Derived from mel command maya.cmds.menuEditor

setCheckBoxState(val=True, **kwargs)

The state of the check box associated with a menu item. The arguments are a flag indicating state, followed by the position of the menu item. This flag is ignored if the menu item does not have a check box. If queried, an array of booleans is returned containing all the flags. The first 8 entries of the array correspond to radial items (in order, “N”, “NE”, ... “NW”), and all later entries correspond to overflow (or linear) menu items.

Derived from mel command maya.cmds.menuEditor

setCommand(val=True, **kwargs)

The command or script executed by a menu item. The arguments are the command string or script name, followed by the position of the menu item. This flag is ignored if the menu item is a submenu item or a separator item. If queried, an array of strings is returned containing all the commands. The first 8 entries of the array correspond to radial items (in order, “N”, “NE”, ... “NW”), and all later entries correspond to overflow (or linear) menu items.

Derived from mel command maya.cmds.menuEditor

setDocTag(val=True, **kwargs)

Add a documentation flag to the control. The documentation flag has a directory structure like hierarchy. Eg. -dt render/multiLister/createNode/material

Derived from mel command maya.cmds.menuEditor

setEnable(val=True, **kwargs)

The enable state of the control. By default, this flag is set to true and the control is enabled. Specify false and the control will appear dimmed or greyed-out indicating it is disabled.

Derived from mel command maya.cmds.menuEditor

setEnableBackground(val=True, **kwargs)

Enables the background color of the control.

Derived from mel command maya.cmds.menuEditor

setHeight(val=True, **kwargs)

The height of the control. The control will attempt to be this size if it is not overruled by parent layout conditions.

Derived from mel command maya.cmds.menuEditor

setImage(val=True, **kwargs)

The filename of the icon associated with a menu item. This icon is displayed by the menuEditor to represent the menu item. The arguments are the icon filename, followed by the position of the menu item. If queried, an array of strings is returned containing all the icon filenames. The first 8 entries of the array correspond to radial items (in order, “N”, “NE”, ... “NW”), and all later entries correspond to overflow (or linear) menu items.

Derived from mel command maya.cmds.menuEditor

setLabel(val=True, **kwargs)

The label of a menu item. The arguments are the label text, followed by the position of the menu item. If queried, an array of strings is returned containing all the labels. The first 8 entries of the array correspond to radial items (in order, “N”, “NE”, ... “NW”), and all later entries correspond to overflow (or linear) menu items.

Derived from mel command maya.cmds.menuEditor

setManage(val=True, **kwargs)

Manage state of the control. An unmanaged control is not visible, nor does it take up any screen real estate. All controls are created managed by default.

Derived from mel command maya.cmds.menuEditor

setOptionBoxCommand(val=True, **kwargs)

The command or script executed by a menu item’s associated option box item. The arguments are the command string or script name, followed by the position of the menu item. This flag is ignored if the menu item does not have an associated option box item. If queried, an array of strings is returned containing all the commands. The first 8 entries of the array correspond to radial items (in order, “N”, “NE”, ... “NW”), and all later entries correspond to overflow (or linear) menu items.

Derived from mel command maya.cmds.menuEditor

setOptionBoxPresent(val=True, **kwargs)

This controls whether a menu item has an associated option box item or not. The arguments are a flag indicating presence, followed by the position of the menu item. This flag is ignored if the menu item is a submenu item. If queried, an array of booleans is returned containing all the flags. The first 8 entries of the array correspond to radial items (in order, “N”, “NE”, ... “NW”), and all later entries correspond to overflow (or linear) menu items.

Derived from mel command maya.cmds.menuEditor

setPreventOverride(val=True, **kwargs)

If true, this flag disallows overriding the control’s attribute via the control’s right mouse button menu.

Derived from mel command maya.cmds.menuEditor

setRadioButtonPresent(val=True, **kwargs)

This controls whether a menu item has a radio button or not. The arguments are a flag indicating presence, followed by the position of the menu item. This flag is ignored if the menu item is a submenu item. If queried, an array of booleans is returned containing all the flags. The first 8 entries of the array correspond to radial items (in order, “N”, “NE”, ... “NW”), and all later entries correspond to overflow (or linear) menu items.

Derived from mel command maya.cmds.menuEditor

setRadioButtonState(val=True, **kwargs)

The state of the radio button associated with a menu item. The arguments are a flag indicating state, followed by the position of the menu item. This flag is ignored if the menu item does not have a radio button. If queried, an array of booleans is returned containing all the flags. The first 8 entries of the array correspond to radial items (in order, “N”, “NE”, ... “NW”), and all later entries correspond to overflow (or linear) menu items.

Derived from mel command maya.cmds.menuEditor

setSeparator(val=True, **kwargs)

In edit mode this adds a separator to the menuEditor at the specified position. The parameters are the radialPosition and the overflowRow. If queried, an array of booleans is returned indicating if the item is a separator item. The first 8 entries of the array correspond to radial items (in order, “N”, “NE”, ... “NW”), and all later entries correspond to overflow (or linear) menu items.

Derived from mel command maya.cmds.menuEditor

setStyle(val=True, **kwargs)

This is the style of icons within the menuEditor. Valid styles are “iconOnly”, “textOnly”, “iconAndTextHorizontal” and “iconAndTextVertical”.

Derived from mel command maya.cmds.menuEditor

setTopLevelMenu(val=True, **kwargs)

The popup menu to attach to the editor. All editing operations performed in the editor (i.e. inserting/deleting/moving an item) will be immediately reflected in this menu. This flag is ignored if the editor is a sub-menuEditor. The editor will update gracefully if the value of the flag is changed from its initial value.

Derived from mel command maya.cmds.menuEditor

setVisible(val=True, **kwargs)

The visible state of the control. A control is created visible by default. Note that a control’s actual appearance is also dependent on the visible state of its parent layout(s).

Derived from mel command maya.cmds.menuEditor

setVisibleChangeCommand(val=True, **kwargs)

Command that gets executed when visible state of the control changes.

Derived from mel command maya.cmds.menuEditor

setWidth(val=True, **kwargs)

The width of the control. The control will attempt to be this size if it is not overruled by parent layout conditions.

Derived from mel command maya.cmds.menuEditor

subMenuAt(val=True, **kwargs)

Creates a submenu item at the given position. A submenu item created within the radial portion of a menu will overwrite whatever item (if any) is currently at the given position. A submenu item created within the overflow (linear) portion of a menu will be inserted before the item currently at the given position.

Derived from mel command maya.cmds.menuEditor

Previous topic

pymel.core.uitypes.MenuBarLayout

Next topic

pymel.core.uitypes.MenuSet

Core

Core Modules

Other Modules

This Page