Irrlicht 3D Engine: irr::gui::IGUIComboBox Class Reference

| Irrlicht 3D Engine |

Public Member Functions
irr::gui::IGUIComboBox Class Reference

Combobox widget. More...

`#include <IGUIComboBox.h>`

Inheritance diagram for irr::gui::IGUIComboBox:

List of all members.

## Public Member Functions

- IGUIComboBox (IGUIEnvironment *environment, IGUIElement *parent, s32 id, core::rect< s32 > rectangle)
    constructor
- virtual u32 addItem (const wchar_t *text, u32 data=0)=0
    Adds an item and returns the index of it.
- virtual void clear ()=0
    Deletes all items in the combo box.
- virtual s32 getIndexForItemData (u32 data) const =0
    Returns index based on item data.
- virtual const wchar_t * getItem (u32 idx) const =0
    Returns string of an item. the idx may be a value from 0 to itemCount-1.
- virtual u32 getItemCount () const =0
    Returns amount of items in box.
- virtual u32 getItemData (u32 idx) const =0
    Returns item data of an item. the idx may be a value from 0 to itemCount-1.
- virtual u32 getMaxSelectionRows () const =0
    Get the maximimal number of rows for the selection listbox.
- virtual s32 getSelected () const =0
    Returns id of selected item. returns -1 if no item is selected.
- virtual void removeItem (u32 idx)=0
    Removes an item from the combo box.
- virtual void setMaxSelectionRows (u32 max)=0
    Set the maximal number of rows for the selection listbox.
- virtual void setSelected (s32 idx)=0
    Sets the selected item. Set this to -1 if no item should be selected.
- virtual void setTextAlignment (EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical)=0
    Sets text justification of the text area.

## Detailed Description

Combobox widget.

This element can create the following events of type EGUI_EVENT_TYPE:
  - EGET_COMBO_BOX_CHANGED

Definition at line 19 of file IGUIComboBox.h.

## Constructor & Destructor Documentation

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

constructor

Definition at line 24 of file IGUIComboBox.h.

## Member Function Documentation

virtual u32 irr::gui::IGUIComboBox::addItem | ( | const wchar_t * | text,
|  | u32 | data = `0`
| ) |  | `[pure virtual]`

Adds an item and returns the index of it.

virtual void irr::gui::IGUIComboBox::clear | ( |  | ) | `[pure virtual]`

Deletes all items in the combo box.

virtual s32 irr::gui::IGUIComboBox::getIndexForItemData | ( | u32 | data | ) | const`[pure virtual]`

Returns index based on item data.

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

Returns string of an item. the idx may be a value from 0 to itemCount-1.

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

Returns amount of items in box.

virtual u32 irr::gui::IGUIComboBox::getItemData | ( | u32 | idx | ) | const`[pure virtual]`

Returns item data of an item. the idx may be a value from 0 to itemCount-1.

virtual u32 irr::gui::IGUIComboBox::getMaxSelectionRows | ( |  | ) | const`[pure virtual]`

Get the maximimal number of rows for the selection listbox.

virtual s32 irr::gui::IGUIComboBox::getSelected | ( |  | ) | const`[pure virtual]`

Returns id of selected item. returns -1 if no item is selected.

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

Removes an item from the combo box.

Warning. This will change the index of all following items

virtual void irr::gui::IGUIComboBox::setMaxSelectionRows | ( | u32 | max | ) | `[pure virtual]`

Set the maximal number of rows for the selection listbox.

virtual void irr::gui::IGUIComboBox::setSelected | ( | s32 | idx | ) | `[pure virtual]`

Sets the selected item. Set this to -1 if no item should be selected.

virtual void irr::gui::IGUIComboBox::setTextAlignment | ( | EGUI_ALIGNMENT | horizontal,
|  | EGUI_ALIGNMENT | vertical
| ) |  | `[pure virtual]`

Sets text justification of the text area.

Parameters:

  horizontal,: | EGUIA_UPPERLEFT for left justified (default), EGUIA_LOWEERRIGHT for right justified, or EGUIA_CENTER for centered text.
  vertical,: | EGUIA_UPPERLEFT to align with top edge, EGUIA_LOWEERRIGHT for bottom edge, or EGUIA_CENTER for centered text (default).

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

- IGUIComboBox.h