User Tools

Site Tools


DzActionMenuItem

Class that encapsulates an 'Action Menu Item'.

More...

Inherits :

Enumerations

Properties

Methods

Detailed Description

Action Menu Items are registered with a DzActionMenu and are available to access via methods on that class.

Enumerations


: Type

The types of action menu items.

  • Separator - A menu separator (i.e., horizontal divider).
  • Action - A menu item that activates a DzAction object.
  • CustomAction - A menu item that activates a custom action. See Also: DzActionMgr - for more about custom actions.
  • SubMenu - A menu item that opens a submenu.
  • FileOpenAction - A menu item that opens a file, replacing the contents of the current scene. See Also: DzContentMgr::openFile() - for more about opening a file.
  • FileMergeAction - A menu item that merges a file with the current scene. See Also: DzContentMgr::openFile() - for more about merging a file.

Properties


String : action

Holds the identifier for the Action (classname), CustomAction (GUID), FileOpenAction or FileMergeAction (file path) to perform.


Boolean : isDefault

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

Since:

  • 4.6.0.83

String : label

Holds the label displayed for the item.

Since:

  • 4.6.0.76 - Note: Prior to 4.12.1.68, items of the Action and CustomAction type would yeild an empty string.

Type : type

Holds the type of this menu item. (Read Only)

Methods


DzActionMenu : getParentMenu()

Return Value:

  • The menu that this item is in.

Since:

  • 4.11.0.164

DzActionMenu : getSubMenu()

Return Value:

  • The submenu that is displayed by this menu item (if any), otherwise null.

void : loadFile()

Causes the file for a FileOpenAction or FileMergeAction item to load.

Attention:

  • If the [Ctrl/Cmd] key is pressed when this method is called, the path of the file will be opened in the OS native file browser instead of being opened/merged (since 4.7.1.107). If the type of this item is FileOpenAction and the [Shift] key is pressed when this method is called, the file will be treated as though the type of this item is FileMergeAction (since 4.22.0.3).

Since:

  • 4.6.0.44

void : setSubMenu( DzActionMenu menu )

Sets the menu that is displayed as a submenu when this menu item is activated.

Parameter(s):

  • menu - The menu that is displayed as a submenu when this menu item is activated. The menu item takes ownership of this menu - this menu will be deleted when this item is destroyed.

Attention:

  • This call has no effect unless the type of this item is SubMenu.