Skip to content

class_popupmenu

reduz edited this page Feb 23, 2014 · 10 revisions

PopupMenu

####Inherits: Popup ####Category: Core

Brief Description

PopupMenu displays a list of options.

Member Functions

Signals

  • item&#95pressed ( int ID )

Description

PopupMenu is the typical Control that displays a list of options. They are popular in toolbars or context menus.

Member Function Description

Add a new item with text "label" and icon "texture. An id can optonally be provided, as well as an accelerator. If no id is provided, one will be created from the index.

Add a new item with text "label". An id can optonally be provided, as well as an accelerator. If no id is provided, one will be created from the index.

  • void add&#95icon&#95check&#95item ( Object texture, String label, int id=-1, int accel=0 )

Add a new checkable item with text "label" and icon "texture. An id can optonally be provided, as well as an accelerator. If no id is provided, one will be created from the index. Note that checkable items just display a checkmark, but don"apos;t have any built-in checking behavior and must be checked/unchecked manually.

  • void add&#95check&#95item ( String label, int id=-1, int accel=0 )

Add a new checkable item with text "label". An id can optonally be provided, as well as an accelerator. If no id is provided, one will be created from the index. Note that checkable items just display a checkmark, but don"apos;t have any built-in checking behavior and must be checked/unchecked manually.

  • void set&#95item&#95text ( int idx, String text )

Set the text of the item at index "idx".

  • void set&#95item&#95icon ( int idx, Object icon )

Set the icon of the item at index "idx".

  • void set&#95item&#95accelerator ( int idx, int accel )

Set the accelerator of the item at index "idx". Accelerators are special combinations of keys that activate the item, no matter which control is fucused.

  • void set&#95item&#95checked ( int idx, bool arg1 )

Set the checkstate status of the item at index "idx".

  • void set&#95item&#95ID ( int idx, int id )

Set the id of the item at index "idx".

  • String get&#95item&#95text ( int idx ) const

Return the text of the item at index "idx".

  • Object get&#95item&#95icon ( int idx ) const

Return the icon of the item at index "idx".

  • int get&#95item&#95accelerator ( int idx ) const

Return the accelerator of the item at index "idx". Accelerators are special combinations of keys that activate the item, no matter which control is fucused.

  • bool is&#95item&#95checked ( int idx ) const

Return the checkstate status of the item at index "idx".

  • int get&#95item&#95ID ( int idx ) const

Return the id of the item at index "idx".

  • int get&#95item&#95index ( int id ) const

Find and return the index of the item containing a given id.

  • int get&#95item&#95count ( ) const

Return the amount of items.

  • void add&#95separator ( )

Add a separator between items. Separators also occupy an index.

  • void clear ( )

Clear the popup menu.

Clone this wiki locally