User Tools

Site Tools


DzActionMenu

Class that encapsulates a popup menu that contains DzActionMenuItems.

More...

Inherits :

Enumerations

Properties

Methods

DAZ Script
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 )
voidremoveItem ( DzActionMenuItem item )
voidsimplifySeparators ()

Signals

voiddefaultChanged ( Boolean yesNo )
voiditemListChanged ()

Detailed Description

Enumerations


: MenuType

TODO: Add description.

Properties


Boolean : isDefault

Holds whether or not the 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 the menu (Read Only until 4.6.0.74)

Methods


void : clear()

Removes all items from the menu.


void : exec()

Displays the menu to the user.


void : exec( Point pos )

Displays the menu to the user at the given 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 the 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 the given action into the menu at the given location.

Parameter(s):

  • identifier - The name of the DzAction subclass to insert into the menu.
  • i - The index at which to insert the item, if the index is invalid (the default) the item is appended to the end of the menu.

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

Inserts the given custom action into the menu at the given location.

Parameter(s):

  • guid - The globally unique identifier for the custom action to insert into the menu.
  • i - The index at which to insert the item, if the index is invalid (the default) the item is appended to the end of the menu.

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

Inserts the given file merge action into the menu at the given location.

Parameter(s):

  • fileName - The path of the file to insert into the menu.
  • label - The label to display within the interface; defaults to fileName if not specified.
  • i - The index at which to insert the item, if the index is invalid (the default) the item is appended to the end of the menu.

Since:

  • 4.6.0.76

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

Inserts the given file open action into the menu at the given location.

Parameter(s):

  • fileName - The path of the file to insert into the menu.
  • label - The label to display within the interface; defaults to fileName if not specified
  • i - The index at which to insert the item, if the index is invalid (the default) the item is appended to the end of the menu.

Since:

  • 4.6.0.76

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

Inserts the given item into the menu at the given location.

Parameter(s):

  • item - The item to insert into the menu.
  • i - The index at which to insert the item, if the index is invalid (the default) the item is appended to the end of the menu.

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 the menu at the given location.

Parameter(s):

  • i - The index at which to insert the item, if the index is invalid (the default) the item is appended to the end of the menu.

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

Inserts the given menu into the menu at the given location 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, the menu is inserted as a default menu. If false (default) the menu is inserted as a custom menu.
  • i - The index at which to insert the item, if the index is invalid (the default) the item is appended to the end of the menu.

See Also:

Since:

  • 4.11.0.164

void : removeItem( DzActionMenuItem item )

Remove the given item from the menu.

Parameter(s):

  • item - The item to remove from the menu.

void : simplifySeparators()

Removes any duplicate separators from the 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.