Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials

# irr::gui::IGUIContextMenu Class Reference

GUI Context menu interface. More...

`#include <IGUIContextMenu.h>`

Inheritance diagram for irr::gui::IGUIContextMenu:

List of all members.

## Public Member Functions
virtual u32 | addItem (const wchar_t *text, s32 commandId=-1, bool enabled=true, bool hasSubMenu=false, bool checked=false)=0
| Adds a menu item.
virtual void | addSeparator ()=0
| Adds a separator item to the menu.
virtual s32 | getItemCommandId (u32 idx) const =0
| Get the command id of a menu item.
virtual u32 | getItemCount () const =0
| Get amount of menu items.
virtual const wchar_t * | getItemText (u32 idx) const =0
| Get text of the menu item.
virtual s32 | getSelectedItem () const =0
| Get the selected item in the menu.
virtual IGUIContextMenu * | getSubMenu (u32 idx) const =0
| Get a pointer to the submenu of an item.
| IGUIContextMenu (IGUIEnvironment *environment, IGUIElement *parent, s32 id, core::rect< s32 > rectangle)
| constructor
virtual bool | isItemChecked (u32 idx) const =0
| Check if a menu item is checked.
virtual bool | isItemEnabled (u32 idx) const =0
| Check if a menu item is enabled.
virtual void | removeAllItems ()=0
| Removes all menu items.
virtual void | removeItem (u32 idx)=0
| Removes a menu item.
virtual void | setItemChecked (u32 idx, bool enabled)=0
| Sets if the menu item should be checked.
virtual void | setItemCommandId (u32 idx, s32 id)=0
| Sets the command id of a menu item.
virtual void | setItemEnabled (u32 idx, bool enabled)=0
| Sets if the menu item should be enabled.
virtual void | setItemText (u32 idx, const wchar_t *text)=0
| Sets text of the menu item.

## Detailed Description

GUI Context menu interface.

Definition at line 16 of file IGUIContextMenu.h.

## Constructor & Destructor Documentation

irr::gui::IGUIContextMenu::IGUIContextMenu | ( | IGUIEnvironment * | environment,
|  | IGUIElement * | parent,
|  | s32 | id,
|  | core::rect< s32 > | rectangle |
| ) |  |  | `[inline]`

constructor

Definition at line 21 of file IGUIContextMenu.h.

## Member Function Documentation

virtual u32 irr::gui::IGUIContextMenu::addItem | ( | const wchar_t * | text,
|  | s32 | commandId = `-1`,
|  | bool | enabled = `true`,
|  | bool | hasSubMenu = `false`,
|  | bool | checked = `false` |
| ) |  |  | `[pure virtual]`

Adds a menu item.

Parameters:

  | text,: | Text of menu item. Set this to 0 to create an separator instead of a real item, which is the same like calling addSeparator();
  | commandId,: | Command id of menu item, a simple id you may set to whatever you want.
  | enabled,: | Specifies if the menu item should be enabled.
  | hasSubMenu,: | Set this to true if there should be a submenu at this item. You can acess this submenu via getSubMenu().
  | checked,: | Specifies if the menu item should be initially checked.

Returns:
  Returns the index of the new item

virtual void irr::gui::IGUIContextMenu::addSeparator | ( |  | ) | `[pure virtual]`

Adds a separator item to the menu.

virtual s32 irr::gui::IGUIContextMenu::getItemCommandId | ( | u32 | idx | ) | const`[pure virtual]`

Get the command id of a menu item.

Parameters:

  | idx,: | Zero based index of the menu item

virtual u32 irr::gui::IGUIContextMenu::getItemCount | ( |  | ) | const`[pure virtual]`

Get amount of menu items.

virtual const wchar_t* irr::gui::IGUIContextMenu::getItemText | ( | u32 | idx | ) | const`[pure virtual]`

Get text of the menu item.

Parameters:

  | idx,: | Zero based index of the menu item

virtual s32 irr::gui::IGUIContextMenu::getSelectedItem | ( |  | ) | const`[pure virtual]`

Get the selected item in the menu.

Returns:
  Index of the selected item, -1 if none selected.

virtual IGUIContextMenu* irr::gui::IGUIContextMenu::getSubMenu | ( | u32 | idx | ) | const`[pure virtual]`

Get a pointer to the submenu of an item.

0 is returned if there is no submenu

Parameters:

  | idx,: | Zero based index of the menu item

Returns:
  Returns a pointer to the submenu of an item.

virtual bool irr::gui::IGUIContextMenu::isItemChecked | ( | u32 | idx | ) | const`[pure virtual]`

Check if a menu item is checked.

Parameters:

  | idx,: | Zero based index of the menu item

virtual bool irr::gui::IGUIContextMenu::isItemEnabled | ( | u32 | idx | ) | const`[pure virtual]`

Check if a menu item is enabled.

Parameters:

  | idx,: | Zero based index of the menu item

virtual void irr::gui::IGUIContextMenu::removeAllItems | ( |  | ) | `[pure virtual]`

Removes all menu items.

virtual void irr::gui::IGUIContextMenu::removeItem | ( | u32 | idx | ) | `[pure virtual]`

Removes a menu item.

Parameters:

  | idx,: | Zero based index of the menu item

virtual void irr::gui::IGUIContextMenu::setItemChecked | ( | u32 | idx,
|  | bool | enabled |
| ) |  |  | `[pure virtual]`

Sets if the menu item should be checked.

Parameters:

  | idx,: | Zero based index of the menu item
  | enabled,: | True if it is enabled, otherwise false.

virtual void irr::gui::IGUIContextMenu::setItemCommandId | ( | u32 | idx,
|  | s32 | id |
| ) |  |  | `[pure virtual]`

Sets the command id of a menu item.

Parameters:

  | idx,: | Zero based index of the menu item
  | id,: | Command id of menu item, a simple id you may set to whatever you want.

virtual void irr::gui::IGUIContextMenu::setItemEnabled | ( | u32 | idx,
|  | bool | enabled |
| ) |  |  | `[pure virtual]`

Sets if the menu item should be enabled.

Parameters:

  | idx,: | Zero based index of the menu item
  | enabled,: | True if it is enabled, otherwise false.

virtual void irr::gui::IGUIContextMenu::setItemText | ( | u32 | idx,
|  | const wchar_t * | text |
| ) |  |  | `[pure virtual]`

Sets text of the menu item.

Parameters:

  | idx,: | Zero based index of the menu item
  | text,: | New text of the item.

The documentation for this class was generated from the following file:

- IGUIContextMenu.h

| The Irrlicht Engine Documentation © 2003-2009 by Nikolaus Gebhardt. Generated on Sun Jan 10 09:24:10 2010 by Doxygen (1.5.6)