menuEditor is undoable, queryable, and editable.
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.
In query mode, return type is based on queried flag.
Long name (short name) |
Argument types |
Properties |
|
-annotation(-ann)
|
string
|
|
|
Annotate the control with an extra string value.
|
|
-backgroundColor(-bgc)
|
float float float
|
|
|
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.
|
|
-cellHeight(-ch)
|
int
|
|
|
The height of the icons in the menuEditor.
|
|
-cellWidth(-cw)
|
int
|
|
|
The width of the icons in the menuEditor.
|
|
-cellWidthHeight(-cwh)
|
int int
|
|
|
The width and height of the icons in the menuEditor.
|
|
-checkBoxPresent(-cbp)
|
boolean string int
|
|
|
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.
|
|
-checkBoxState(-cbs)
|
boolean string int
|
|
|
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.
|
|
-childArray(-ca)
|
|
|
|
Returns a string array of the names of the layout's
immediate children.
|
|
-command(-c)
|
string string int
|
|
|
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.
|
|
-defineTemplate(-dt)
|
string
|
|
|
Puts the command in a mode where any other flags and arguments are
parsed and added to the command template specified in the argument.
They will be used as default arguments in any subsequent
invocations of the command when templateName is set as the
current template.
|
|
-delete(-d)
|
string int
|
|
|
Deletes the menu item at the given position, removing it from
the menu. If the menu item has a submenu, and a sub-menuEditor is
open and attached to it, then the sub-menuEditor's window and
all its child menuEditor windows will be closed recursively.
|
|
-docTag(-dtg)
|
string
|
|
|
Add a documentation flag to the control. The documentation flag
has a directory structure.
(e.g., -dt render/multiLister/createNode/material)
|
|
-dragCallback(-dgc)
|
script
|
|
|
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 CTRL and
SHIFT. Possible values are 0 == No modifiers, 1 == SHIFT, 2 == CTRL,
3 == CTRL + 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'")
|
|
-dropCallback(-dpc)
|
script
|
|
|
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'")
|
|
-enable(-en)
|
boolean
|
|
|
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.
|
|
-enableBackground(-ebg)
|
boolean
|
|
|
Enables the background color of the control.
|
|
-enableKeyboardFocus(-ekf)
|
boolean
|
|
|
If enabled, the user can navigate to the control with the tab key and select values with the keyboard or mouse.
This flag would typically be used to turn off focus support from controls that get it by default, like Edit and List controls.
If disabled, text in text fields can still be selected with the mouse but cannot be copied (except on Linux when "Middle Click Paste" is enabled).
|
|
-exists(-ex)
|
|
|
|
Returns whether the
specified object exists or not. Other flags are ignored.
|
|
-fullPathName(-fpn)
|
|
|
|
Return the full path name of the widget, which includes all the parents.
|
|
-height(-h)
|
int
|
|
|
The height of the control. The control will attempt to
be this size if it is not overruled by parent layout conditions.
|
|
-highlightColor(-hlc)
|
float float float
|
|
|
The highlight 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.
|
|
-iconMenuCallback(-imc)
|
string
|
|
|
This is the name of a MEL callback procedure that is called to
create the popup menus attached to icons in the menuEditor. The
callback is called once for each newly created icon, and once each
time an icon is moved within the menuEditor. Popup menus created
by the callback should contain commands for editing the menu item
associated with the icon. Operations accessible through the menu
should include deletion of the item, editing of the
item's label/command/image/checkbox/optionbox, creation of a submenu,
and popping up a sub-menuEditor.
The arguments to the callback must match this form:
callbackProc(string $menuEditorName, string $parentIconName, string $menuTitle, string $radialPosition, int $overflowRow);
The popup menu's parent should be $parentIconName.
Note that when a sub-menuEditor is created, this flag need not be
re-specified as it adopts a default value equal to the value of
its parent menuEditor's -imc/iconMenuCallback flag.
|
|
-image(-i)
|
string string int
|
|
|
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.
|
|
-isObscured(-io)
|
|
|
|
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.
|
|
-label(-l)
|
string string int
|
|
|
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.
|
|
-manage(-m)
|
boolean
|
|
|
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.
|
|
-menuItemTypes(-mit)
|
|
|
|
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.
|
|
-noBackground(-nbg)
|
boolean
|
|
|
Clear/reset the control's background.
Passing true means the background should not be drawn at all, false means the background should be drawn. The state of this flag is inherited by children of this control.
|
|
-numberOfChildren(-nch)
|
|
|
|
Returns in an int the number of immediate children of the layout.
|
|
-numberOfPopupMenus(-npm)
|
|
|
|
Return the number of popup menus attached to this control.
|
|
-optionBoxCommand(-obc)
|
string string int
|
|
|
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.
|
|
-optionBoxPresent(-obp)
|
boolean string int
|
|
|
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.
|
|
-parent(-p)
|
string
|
|
|
The parent layout for this control.
|
|
-popupMenuArray(-pma)
|
|
|
|
Return the names of all the popup menus attached to this
control.
|
|
-preventOverride(-po)
|
boolean
|
|
|
If true, this flag prevents overriding the control's
attribute via the control's right mouse button menu.
|
|
-radioButtonPresent(-rbp)
|
boolean string int
|
|
|
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.
|
|
-radioButtonState(-rbs)
|
boolean string int
|
|
|
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.
|
|
-separator(-sp)
|
string int
|
|
|
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.
|
|
-statusBarMessage(-sbm)
|
string
|
|
|
Extra string to display in the status bar when the mouse is over the control.
|
|
-style(-st)
|
string
|
|
|
This is the style of icons within the menuEditor. Valid styles
are "iconOnly", "textOnly", "iconAndTextHorizontal"
and "iconAndTextVertical".
|
|
-subMenuAt(-sma)
|
string int
|
|
|
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.
|
|
-subMenuEditorWindow(-sew)
|
string
|
|
|
The name of the window which contains a sub-menuEditor. Only use
when creatitg a sub-menuEditor. This window will automatically be
closed if a parent menuEditor is closed or if a parent menu item
is deleted.
|
|
-subMenuEditorsOpen(-seo)
|
|
|
|
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.
|
|
-subMenuOf(-smo)
|
string string int
|
|
|
Attaches a sub-menuEditor to its parent menuEditor. Only use when
creatitg a sub-menuEditor. The arguments are the name
of the parent menuEditor, followed by the position of a submenu item
within the parent. A submenu item must already exist within the parent
at the given position. A submenu item cannot have multiple
sub-menuEditors attached to it.
|
|
-topLevelMenu(-tlm)
|
string
|
|
|
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.
|
|
-useTemplate(-ut)
|
string
|
|
|
Forces the command to use a command template other than
the current one.
|
|
-visible(-vis)
|
boolean
|
|
|
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).
|
|
-visibleChangeCommand(-vcc)
|
script
|
|
|
Command that gets executed when visible state of the control changes.
|
|
-width(-w)
|
int
|
|
|
The width of the control. The control will attempt to
be this size if it is not overruled by parent layout conditions.
|
|