User Tools

Site Tools


DzPopupMenu

DAZScript wrapper for a popup QMenu.

More...

Inherits :

Properties

Constructors

DAZ Script
DzPopupMenu ( DzWidget parent )

Methods

DAZ Script
voidchangeItem ( Number id, String text )
voidchangeItem ( Number id, pixmap pixmap )
voidclear ()
BooleanconnectItem ( Number id, Object receiver, String member )
BooleandisconnectItem ( Number id, Object receiver, String member )
Numberexec ()
Numberexec ( Point pos, Number indexAtPoint )
NumberidAt ( Number index )
NumberidAt ( Point pos )
NumberinsertItem ( String text, DzPopupMenu popup, Number id=-1, Number index=-1 )
NumberinsertItem ( Pixmap pixmap, Number id=-1, Number index=-1 )
NumberinsertItem ( Pixmap pixmap, DzPopupMenu popup, Number id=-1, Number index=-1 )
NumberinsertItem ( String text, Number id=-1, Number index=-1 )
NumberinsertSeparator ( Number index=-1 )
BooleanisItemChecked ( Number id )
BooleanisItemEnabled ( Number id )
BooleanisItemVisible ( Number id )
NumberitemParameter ( Number id )
Pixmappixmap ( Number id )
voidpopup ( Point pos, Number indexAtPoint )
voidremoveItem ( Number id )
voidremoveItemAt ( Number index )
voidsetActiveItem ( Number id )
voidsetItemChecked ( Number id, Boolean check )
voidsetItemEnabled ( Number id, Boolean enable )
BooleansetItemParameter ( Number id, Number param )
voidsetItemVisible ( Number id, Boolean visible )
voidsetWhatsThis ( Number id, String text )
Stringtext ( Number id )
StringwhatsThis ( Number id )

Signals

voidaboutToHide ()
voidaboutToShow ()
voidactivated ( Number id )
voidhighlighted ( Number id )

Detailed Description

A DzPopupMenu provides a popup menu.

Properties


Boolean : checkable

This property holds whether 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.


Boolean : tearOff

This property holds whether 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.

Constructors


DzPopupMenu( DzWidget parent )

Creates a popup menu as a child of the given parent widget.

Parameter(s):

  • parent - The widget parent for the popup menu.

Methods


void : changeItem( Number id, String text )

Changes the text of the menu item id to text. If the item has an icon, the icon remains unchanged.


void : changeItem( Number id, pixmap pixmap )

TODO: Add description.


void : clear()

Removes all menu items.


Boolean : connectItem( Number id, Object receiver, String member )

TODO: Add description.


Boolean : disconnectItem( Number id, Object receiver, String member )

TODO: Add description.


Number : exec()

Executes this popup synchronously. In most situations you'll want to specify the position yourself, for example at the current mouse position.


Number : exec( Point pos, Number indexAtPoint )

Executes this popup synchronously. Opens the popup menu so that the item number indexAtPoint will be at the specified global position pos.


Number : idAt( Number index )

Return Value:

  • The identifier of the menu item at position index in the internal list, or -1 if index is out of range.

Number : idAt( Point pos )

Return Value:

  • The the id of the item at pos, or -1 if there is no item there or if it is a separator.

Number : insertItem( String text, DzPopupMenu popup, Number id=-1, Number index=-1 )

Inserts submenu popup, labeled text, with an optional id, and an optional index position.


Number : insertItem( Pixmap pixmap, Number id=-1, Number index=-1 )

Inserts a menu item with the Pixmappixmap, with an optional id, and an optional index position.


Number : insertItem( Pixmap pixmap, DzPopupMenu popup, Number id=-1, Number index=-1 )

Inserts submenu popup with the Pixmappixmap, with an optional id, and an optional index position.


Number : insertItem( String text, Number id=-1, Number index=-1 )

Inserts a menu item labeled text, with an optional id, and an optional index position.


Number : insertSeparator( Number index=-1 )

Inserts a separator at position index, and returns the menu identifier number allocated to it. The separator becomes the last menu item if index is negative.


Boolean : isItemChecked( Number id )

Return Value:

  • true if the menu item with the id id has been checked, otherwise false.

Boolean : isItemEnabled( Number id )

Return Value:

  • true if the item with identifier id is enabled, otherwise false.

Boolean : isItemVisible( Number id )

Return Value:

  • true if the menu item with the id id is visible, otherwise false.

Number : itemParameter( Number id )

Return Value:

  • The parameter of the activation signal of item id.

Pixmap : pixmap( Number id )

Return Value:

  • The pixmap that has been set for menu item id, or null if no pixmap has been set.

void : popup( Point pos, Number indexAtPoint )

Displays the popup menu so that the item number indexAtPoint will be at the specified global position pos.


void : removeItem( Number id )

Removes the menu item that has the identifier id.


void : removeItemAt( Number index )

Removes the menu item at position index.


void : setActiveItem( Number id )

Sets the currently active item to id and repaints as necessary.


void : setItemChecked( Number id, Boolean check )

If check is true, checks the menu item with id id, otherwise unchecks the menu item with id id. Calls DzPopupMenu::setCheckable( true ) if necessary.


void : setItemEnabled( Number id, Boolean enable )

If enable is true, enables the menu item with identifier id, otherwise disables the menu item with identifier id.


Boolean : setItemParameter( Number id, Number param )

Sets the parameter of the activation signal of item id to param.


void : setItemVisible( Number id, Boolean visible )

If visible is true, shows the menu item with id id, otherwise hides the menu item with id id.


void : setWhatsThis( Number id, String text )

Sets text as What's This help for the menu item with identifier id.


String : text( Number id )

Return Value:

  • The text that has been set for menu item id, or an empty string if no text has been set.

String : whatsThis( Number id )

Return Value:

  • The What's This help text for the item with identifier id or an empty string if no text has yet been defined.

Signals


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).


void : activated( Number id )

Signature:“activated(int)”

This signal is emitted when a menu item is selected.

Parameter(s):

  • id - The id of the selected item.

void : highlighted( Number id )

Signature:“highlighted(int)”

Emitted when a menu item is highlighted.

Parameter(s):

  • id - The id of the highlighted item.