DAZ Script |
---|
DzPopupMenu ( DzWidget parent ) |
void | aboutToHide () |
void | aboutToShow () |
void | activated ( Number id ) |
void | highlighted ( Number id ) |
Provides a menu widget for use in context menus and other popup menus.
A menu consists of a list of items. There are three kinds of items: separators, items that show a submenu, and items that perform an action.
Submenu items and action items have an identifier (id) and a position (index). Separators have a position (index) and a common identifier (-1).
Separators are inserted with insertSeparator(). Submenus are inserted with insertSubmenuItem(), insertTextSubmenuItem(), or insertPixmapSubmenuItem(). All other items are considered action items, and are inserted with insertItem(), insertTextItem() or insertPixmapItem().
Submenu items and action items can have text, a pixmap, or both.
Clearing an entire menu is accomplished with clear() and removing individual items is accomplished with removeItem() or removeItemAt().
To make a menu visible on the screen, use exec() or popup() - do not use show().
Holds whether or not the display of check marks on menu items is enabled. When true
, the display of check marks on menu items is enabled. Checking is always enabled when in Windows-style.
Holds whether or not the menu supports being torn off. When true
, the menu contains a special tear-off item (often shown as a dashed line at the top of the menu) that creates a copy of the menu when it is triggered.
This “torn-off” copy lives in a separate window. It contains the same menu items as the original menu, with the exception of the tear-off handle.
DzPopupMenu( DzWidget parent )
Creates a popup menu as a child of the given parent widget.
Parameter(s):
void : clear()
Removes all menu items.
Boolean : connectItem( Number id, Object receiver, String member )
Connects the menu item with the specified identifier to a function.
Parameter(s):
receiver
to execute when the menu item is activated. Prior to 4.15.0.24, the signature of this function must have no parameters, or a single parameter of the 'int' type.Return Value:
true
if the connection is successfully established, otherwise false
.Boolean : connectItem( Number id, Object thisObject, Function functionRef )
Connects the menu item with the specified identifier to a function.
Parameter(s):
Return Value:
true
if the connection is successfully established, otherwise false
.Since:
Boolean : disconnectItem( Number id, Object receiver, String member )
Disconnects the menu item with the specified identifier from a function.
Parameter(s):
receiver
to disconnect from.Return Value:
true
if the connection is successfully removed, otherwise false
.Attention:
Boolean : disconnectItem( Number id, Object thisObject, Function functionRef )
Disconnects the menu item with the specified identifier from a function.
Parameter(s):
Return Value:
true
if the connection is successfully removed, otherwise false
.Attention:
Since:
Executes this menu synchronously. In most situations you will want to specify the position yourself, for example at the current mouse position.
Return Value:
Number : exec( Point pos, Number indexAtPoint )
Executes this menu synchronously. Opens the popup menu so that the item number indexAtPoint
will be at the specified global position pos
.
Parameter(s):
pos
.Return Value:
See Also:
Parameter(s):
Return Value:
Parameter(s):
Return Value:
See Also:
Number : insertItem( Pixmap pixmap, String text, Number id=-1, Number index=-1 )
Inserts a menu item, with a pixamp, and text into this menu.
Parameter(s):
Return Value:
Since:
Number : insertPixmapItem( Pixmap pixmap, Number id=-1, Number index=-1 )
Inserts a menu item, with a pixmap, into this menu.
Parameter(s):
Return Value:
Since:
Number : insertPixmapSubmenuItem( Pixmap pixmap, DzPopupMenu popup, Number id=-1, Number index=-1 )
Inserts a submenu item, with a pixmap, into this menu.
Parameter(s):
Return Value:
Since:
Number : insertSeparator( Number index=-1 )
Inserts a separator at the specified index position.
Parameter(s):
Return Value:
Number : insertSubmenuItem( Pixmap pixmap, String text, DzPopupMenu popup, Number id=-1, Number index=-1 )
Inserts a submenu item, with a pixmap and text, into this menu.
Parameter(s):
Return Value:
Since:
Number : insertTextItem( String text, Number id=-1, Number index=-1 )
Inserts a menu item, with text, into this menu.
Parameter(s):
Return Value:
Since:
Number : insertTextSubmenuItem( String text, DzPopupMenu popup, Number id=-1, Number index=-1 )
Inserts a submenu item, with text, into this menu.
Parameter(s):
Return Value:
Since:
Boolean : isItemCheckable( Number id )
Parameter(s):
Return Value:
true
if the menu item with the specified identifier is checkable, otherwise false
.Since:
Boolean : isItemChecked( Number id )
Parameter(s):
Return Value:
true
if the menu item with the specified identifier is checked, otherwise false
.Boolean : isItemEnabled( Number id )
Parameter(s):
Return Value:
true
if the menu item with the specified identifier is enabled, otherwise false
.Boolean : isItemVisible( Number id )
Parameter(s):
Return Value:
true
if the menu item with the specified identifier is visible, otherwise false
.Number : itemParameter( Number id )
Parameter(s):
Return Value:
id
.Return Value:
Since:
Parameter(s):
Return Value:
void : popup( Point pos, Number indexAtPoint )
Displays this menu synchronously.
Parameter(s):
pos
.See Also:
void : removeItem( Number id )
Removes the menu item with the specified identifier from the menu.
Parameter(s):
void : removeItemAt( Number index )
Removes the menu item at the specified index position.
Parameter(s):
void : setActiveItem( Number id )
Sets the currently active item to id
and repaints as necessary.
void : setItemCheckable( Number id, Boolean yesNo )
Sets the checkable state of the menu item with the specified identifier.
Parameter(s):
true
, the item is made checkable.Since:
void : setItemChecked( Number id, Boolean yesNo )
Sets the checked state of the menu item with the specified identifier.
Parameter(s):
true
, the item is checked.void : setItemEnabled( Number id, Boolean yesNo )
Sets the enabled state of the menu item with the specified identifier.
Parameter(s):
true
, the item is enabled.Boolean : setItemParameter( Number id, Number param )
Sets the parameter of the activation signal for the menu item with the specified identifier.
Parameter(s):
void : setItemVisible( Number id, Boolean yesNo )
Sets the visible state of the menu item with the specified identifier.
Parameter(s):
true
, the item is made visible.void : setPixmap( Number id, Pixmap pixmap )
Sets the pixmap of the menu item with the specified identifier.
Parameter(s):
Attention:
Since:
void : setText( Number id, String text )
Sets the text of the menu item with the specified identifier.
Parameter(s):
Attention:
Since:
void : setWhatsThis( Number id, String text )
Sets the “What's This” help text for the menu item with the specified identifier.
Parameter(s):
Parameter(s):
Return Value:
String : whatsThis( Number id )
Parameter(s):
Return Value:
Number : insertTearOffHandle()
Deprecated
Exists only to keep old code working. Do not use in new code. Use the tearOff property instead.
Number : insertItem( String text, Number id=-1, Number index=-1 )
Deprecated
Exists only to keep old code working. Do not use in new code. Use insertTextItem() instead.
Number : insertItem( Pixmap pixmap, Number id=-1, Number index=-1 )
Deprecated
Exists only to keep old code working. Do not use in new code. Use insertPixmapItem() instead.
Number : insertItem( String text, DzPopupMenu popup, Number id=-1, Number index=-1 )
Deprecated
Exists only to keep old code working. Do not use in new code. Use insertTextSubmenuItem() instead.
Number : insertItem( Pixmap pixmap, DzPopupMenu popup, Number id=-1, Number index=-1 )
Deprecated
Exists only to keep old code working. Do not use in new code. Use insertPixmapSubmenuItem() instead.
void : changeItem( Number id, String text )
Deprecated
Exists only to keep old code working. Do not use in new code. Use setText() instead.
void : changeItem( Number id, Pixmap pixmap )
Deprecated
Exists only to keep old code working. Do not use in new code. Use setPixmap() instead.
void : updateItem( Number id )
Deprecated
Exists only to keep old code working. Do not use in new code. Does nothing.
void : aboutToHide()
Signature:“aboutToHide()”
This signal is emitted just before the popup menu is hidden after it has been displayed.
void : aboutToShow()
Signature:“aboutToShow()”
This signal is emitted just before the popup menu is displayed. You can connect it to any slot that sets up the menu contents (e.g. to ensure that the right items are enabled).
Signature:“activated(int)”
This signal is emitted when a menu item is selected.
Parameter(s):
void : highlighted( Number id )
Signature:“highlighted(int)”
Emitted when a menu item is highlighted.
Parameter(s):