arsa  2.7
IGUIComboBox.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2012 Nikolaus Gebhardt
2 // This file is part of the "Irrlicht Engine".
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
4 
5 #ifndef __I_GUI_COMBO_BOX_H_INCLUDED__
6 #define __I_GUI_COMBO_BOX_H_INCLUDED__
7 
8 #include "IGUIElement.h"
9 
10 namespace irr
11 {
12 namespace gui
13 {
14 
16 
19  class IGUIComboBox : public IGUIElement
20  {
21  public:
22 
24  IGUIComboBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
25  : IGUIElement(EGUIET_COMBO_BOX, environment, parent, id, rectangle) {}
26 
28  virtual u32 getItemCount() const = 0;
29 
31  virtual const wchar_t* getItem(u32 idx) const = 0;
32 
34  virtual u32 getItemData(u32 idx) const = 0;
35 
37  virtual s32 getIndexForItemData(u32 data ) const = 0;
38 
40  virtual u32 addItem(const wchar_t* text, u32 data = 0) = 0;
41 
43 
44  virtual void removeItem(u32 idx) = 0;
45 
47  virtual void clear() = 0;
48 
50  virtual s32 getSelected() const = 0;
51 
53  virtual void setSelected(s32 idx) = 0;
54 
56 
60  virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) = 0;
61 
63  virtual void setMaxSelectionRows(u32 max) = 0;
64 
66  virtual u32 getMaxSelectionRows() const = 0;
67  };
68 
69 
70 } // end namespace gui
71 } // end namespace irr
72 
73 #endif
74 
virtual u32 getMaxSelectionRows() const =0
Get the maximal number of rows for the selection listbox.
GLuint id
virtual void setSelected(s32 idx)=0
Sets the selected item. Set this to -1 if no item should be selected.
virtual u32 addItem(const wchar_t *text, u32 data=0)=0
Adds an item and returns the index of it.
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974
Combobox widget.
Definition: IGUIComboBox.h:19
Everything in the Irrlicht Engine can be found in this namespace.
Definition: CARSADPad.h:6
A combo box (IGUIComboBox)
GUI Environment. Used as factory and manager of all other GUI elements.
virtual u32 getItemCount() const =0
Returns amount of items in box.
virtual s32 getIndexForItemData(u32 data) const =0
Returns index based on item data.
signed int s32
32 bit signed variable.
Definition: irrTypes.h:70
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.
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
virtual void clear()=0
Deletes all items in the combo box.
Base class of all GUI elements.
Definition: IGUIElement.h:23
virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical)=0
Sets text justification of the text area.
virtual void removeItem(u32 idx)=0
Removes an item from the combo box.
IGUIComboBox(IGUIEnvironment *environment, IGUIElement *parent, s32 id, core::rect< s32 > rectangle)
constructor
Definition: IGUIComboBox.h:24
virtual void setMaxSelectionRows(u32 max)=0
Set the maximal number of rows for the selection listbox.
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 s32 getSelected() const =0
Returns id of selected item. returns -1 if no item is selected.