User Tools

Site Tools


DzActionMenu

Class that encapsulates a popup menu that contains DzActionMenuItems.

More...

Inherits :

Enumerations

Properties

Methods

DAZ Script
voidappendItemsFromMenu ( DzActionMenu menu )
voidclear ()
voidexec ()
voidexec ( Point pos )
DzActionMenufindOrCreateSubMenu ( String path, Boolean asDefault=false )
DzActionMenufindSubMenu ( String path )
DzActionMenuItemgetItem ( Number i )
ArraygetItemList ()
NumbergetNumItems ()
DzActionMenuItemgetParentItem ()
StringgetPath ()
BooleanhasItems ()
voidinsertAction ( String identifier, Number i=-1 )
voidinsertCustomAction ( String guid, Number i=-1 )
voidinsertFileMergeAction ( String fileName, String label=“”, Number i=-1 )
voidinsertFileOpenAction ( String fileName, String label=“”, Number i=-1 )
voidinsertItem ( DzActionMenuItem item, Number i=-1 )
voidinsertMenu ( String label, DzActionMenu menu, Number i=-1 )
voidinsertSeparator ( Number i=-1 )
voidinsertSubMenu ( String label, DzActionMenu menu, Boolean asDefault=false, Number i=-1 )
voidmoveItem ( DzActionMenuItem item, Number i )
voidremoveItem ( DzActionMenuItem item )
voidsimplifySeparators ()

Signals

voiddefaultChanged ( Boolean yesNo )
voiditemListChanged ()

Detailed Description

Enumerations


: MenuType

TODO: Add description.

Properties


Boolean : isDefault

Holds whether or not this menu is considered to be created by the application (true) or created by the user (false).

Since:

  • 4.11.0.164

Number : menuType

Holds the type of this menu (Read Only until 4.6.0.74)

Methods


void : appendItemsFromMenu( DzActionMenu menu )

Appends menu items from the specified menu into this menu.

Parameter(s):

  • menu - The menu to copy items from.

Since:

  • 4.22.1.205

void : clear()

Removes all items from this menu.

Attention:

  • This call has no effect unless the type of this menu is CustomMenu.

void : exec()

Displays this menu to the user.


void : exec( Point pos )

Displays this menu to the user at a specified position.

Parameter(s):

  • pos - The global window coordinates at which to display the popup menu.

DzActionMenu : findOrCreateSubMenu( String path, Boolean asDefault=false )

Parameter(s):

  • path - The slash ('/') delimited path of the submenu to find or create.
  • asDefault - If true, any menus that are created will be marked as a default menu; created/placed by the application. If false (default), any menus created will be marked as a custom menu; created/placed by the user.

Return Value:

  • The submenu at the given path; if a menu along the path does not already exist, it is created.

Since:

  • 4.11.0.164

DzActionMenu : findSubMenu( String path )

Parameter(s):

  • path - The slash ('/') delimited path of the submenu to find.

Return Value:

  • The submenu with the given path (if any), otherwise null.

DzActionMenuItem : getItem( Number i )

Parameter(s):

  • i - The index of the item to return.

Return Value:

  • The menu item at the given index (if valid), otherwise null.

Array : getItemList()

Return Value:


Number : getNumItems()

Return Value:

  • The number of items in this menu.

DzActionMenuItem : getParentItem()

Return Value:

  • The item in a parent menu (if any) that causes this menu to be displayed, otherwise null.

Since:

  • 4.11.0.164

String : getPath()

Return Value:

  • The slash ('/') delimited path of this action menu (if any), otherwise an empty string.

Since:

  • 4.11.0.205

Boolean : hasItems()

Return Value:

  • true if there are items in this menu, otherwise false.

void : insertAction( String identifier, Number i=-1 )

Inserts an action into this menu at the specified position.

Parameter(s):

  • identifier - The name of the DzAction subclass to insert into this menu.
  • i - The index to insert the action at. If the index is invalid (default - i.e., i < 0, i > getNumItems()), the action is inserted at the last position in this menu.

void : insertCustomAction( String guid, Number i=-1 )

Inserts a custom action into this menu at the specified position.

Parameter(s):

  • guid - The globally unique identifier for the custom action to insert into this menu.
  • i - The index to insert the action at. If the index is invalid (default - i.e., i < 0, i > getNumItems()), the action is inserted at the last position in this menu.

Attention:

  • This call has no effect unless the type of this menu is CustomMenu.

void : insertFileMergeAction( String fileName, String label=“”, Number i=-1 )

Inserts a file merge action into this menu at the specified position.

Parameter(s):

  • fileName - The path of the file to insert into this menu.
  • label - The label to display within the interface; defaults to fileName if not specified.
  • i - The index to insert the action at. If the index is invalid (default - i.e., i < 0, i > getNumItems()), the action is inserted at the last position in this menu.

Attention:

  • This call has no effect unless the type of this menu is CustomMenu.

Since:

  • 4.6.0.76

void : insertFileOpenAction( String fileName, String label=“”, Number i=-1 )

Inserts a file open action into this menu at the specified position.

Parameter(s):

  • fileName - The path of the file to insert into this menu.
  • label - The label to display within the interface; defaults to fileName if not specified.
  • i - The index to insert the action at. If the index is invalid (default - i.e., i < 0, i > getNumItems()), the action is inserted at the last position in this menu.

Attention:

  • This call has no effect unless the type of this menu is CustomMenu.

Since:

  • 4.6.0.76

void : insertItem( DzActionMenuItem item, Number i=-1 )

Inserts a menu item into this menu at a specified position.

Parameter(s):

  • item - The item to insert into this menu.
  • i - The index to insert the menu item at. If the index is invalid (i.e., i < 0, i > getNumItems()), the item is inserted at the last position in this menu.

Attention:

  • This call has no effect unless the type of this menu is CustomMenu.

See Also:


void : insertMenu( String label, DzActionMenu menu, Number i=-1 )

Deprecated

Exists only to keep old code from crashing. Do not use in new code. Use insertSubMenu() instead.


void : insertSeparator( Number i=-1 )

Inserts a separator into this menu at the specified position.

Parameter(s):

  • i - The index to insert the separator at. If the index is invalid (default - i.e., i < 0, i > getNumItems()), the separator is inserted at the last position in this menu.

Attention:

  • This call has no effect unless the type of this menu is CustomMenu.

void : insertSubMenu( String label, DzActionMenu menu, Boolean asDefault=false, Number i=-1 )

Inserts a menu into this menu at the specified position as a submenu.

Parameter(s):

  • label - The label to display in this menu for the submenu item; the “/” character cannot be used.
  • menu - The submenu to insert into this menu; if null, a new menu is created at the given index.
  • asDefault - If true, this menu is inserted as a default menu. If false (default) this menu is inserted as a custom menu.
  • i - The index to insert the submenu at. If the index is invalid (default - i.e., i < 0, i > getNumItems()), the submenu is inserted at the last position in this menu.

Attention:

  • This call has no effect unless the type of this menu is CustomMenu.

See Also:

Since:

  • 4.11.0.164

void : moveItem( DzActionMenuItem item, Number i )

Moves a menu item in this menu to a specified position.

Parameter(s):

  • item - The menu item to move.
  • i - The index to move the menu item to. If the index is invalid (i.e., i < 0, i > getNumItems()), the item is moved to the last position in this menu.

Attention:

  • This call has no effect unless the type of this menu is CustomMenu. This call has no effect if item is not in this menu.

See Also:

Since:

  • 4.22.0.2

void : removeItem( DzActionMenuItem item )

Removes a menu item from this menu.

Parameter(s):

  • item - The menu item to remove.

Attention:

  • This call has no effect unless the type of this menu is CustomMenu.

void : simplifySeparators()

Removes any duplicate separators from this menu by replacing two or more adjacent separators with a single separator.

Signals


void : defaultChanged( Boolean yesNo )

Signature:“defaultChanged(bool)”

Emitted when the default state of this menu has been changed.

Parameter(s):

  • yesNo - The new default state for this menu.

Since:

  • 4.11.0.164

void : itemListChanged()

Signature:“itemListChanged()”

Emitted when items are added to or removed from this menu.