DzMenu Class Reference
[Interface Components]

Basic Menu construction class. More...

Inheritance diagram for DzMenu:

QObject Object List of all members.

Methods

Number addAction (DzAction action, Number menu=0)
Number addItem (String item, const QObject receiver, String member, Number menu=0)
Number addItem (String item, Number menu=0)
void addSeparator (Number menu=0)
Number addSubMenu (String label, Number menu=0)
Number exec (Point pos)
Number exec ()
Boolean isEmpty ()

Signals

void activated (Number id)

Detailed Description

Basic Menu construction class.


Member Function Documentation

void DzMenu::activated ( Number  id  )  [signal]

Emitted when the user selects an item in the menu, or one of its submenus.

Parameters:
id The item id of the item the user selected.

Number DzMenu::addAction ( DzAction  action,
Number  menu = 0 
)

Adds the DzAction to the given menu.

Parameters:
action A pointer to the action item to add to the menu.
menu The menu id of the menu to add the action to. If zero, the action will be added to the root menu.
Returns:
The item id of the action in the menu.

Number DzMenu::addItem ( String  item,
const QObject  receiver,
String  member,
Number  menu = 0 
)

Adds an entry to the given menu and connects it to a slot.

Parameters:
item The label that will appear in the menu for the user to activate the item.
receiver The QObject to connect the activate signal to.
member The slot/signal that will be connect to the activate signal.
menu The menu id of the menu to add the item to. If zero, the item will be added to the root menu.
Returns:
The item id of the new menu item.

Number DzMenu::addItem ( String  item,
Number  menu = 0 
)

Adds an entry to the given menu.

Parameters:
item The label that will appear in the menu for the user to activate the item.
menu The menu id of the menu to add the item to. If zero, the item will be added to the root menu.
Returns:
The item id of the new menu item.

void DzMenu::addSeparator ( Number  menu = 0  ) 

Adds a separator bar to the given menu.

Parameters:
menu The menu id of the menu to add the separator to. If zero, the separator will be added to the root menu.

Number DzMenu::addSubMenu ( String  label,
Number  menu = 0 
)

Creates a submenu with the given label, and adds it to the given menu.

Parameters:
label The text that will appear in the parent menu for the user to activate the submenu.
menu The menu id of the parent menu to add the submenu to. If zero, the submenu will be added to the root menu.
Returns:
The menu id of the new submenu.

Number DzMenu::exec ( Point  pos  ) 

Shows the menu to the user.

Parameters:
pos The global position that the menu will be displayed at.
Returns:
The item id of the item selected by the user, or -1 if the menu was closed without the user selecting an item.

int DzMenu::exec (  ) 

Shows the menu to the user.

Returns:
The item id of the item selected by the user, or -1 if the menu was closed without the user selecting an item.

Boolean DzMenu::isEmpty (  ) 

Returns:
true if no items or actions have been added to the menu.


Generated on Thu Sep 24 12:21:13 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.