diff options
Diffstat (limited to 'libraries/irrlicht-1.8/source/Irrlicht/CGUIComboBox.h')
-rw-r--r-- | libraries/irrlicht-1.8/source/Irrlicht/CGUIComboBox.h | 234 |
1 files changed, 117 insertions, 117 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CGUIComboBox.h b/libraries/irrlicht-1.8/source/Irrlicht/CGUIComboBox.h index 3d020ac..969d698 100644 --- a/libraries/irrlicht-1.8/source/Irrlicht/CGUIComboBox.h +++ b/libraries/irrlicht-1.8/source/Irrlicht/CGUIComboBox.h | |||
@@ -1,117 +1,117 @@ | |||
1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt | 1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt |
2 | // This file is part of the "Irrlicht Engine". | 2 | // This file is part of the "Irrlicht Engine". |
3 | // For conditions of distribution and use, see copyright notice in irrlicht.h | 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h |
4 | 4 | ||
5 | #ifndef __C_GUI_COMBO_BOX_H_INCLUDED__ | 5 | #ifndef __C_GUI_COMBO_BOX_H_INCLUDED__ |
6 | #define __C_GUI_COMBO_BOX_H_INCLUDED__ | 6 | #define __C_GUI_COMBO_BOX_H_INCLUDED__ |
7 | 7 | ||
8 | #include "IrrCompileConfig.h" | 8 | #include "IrrCompileConfig.h" |
9 | #ifdef _IRR_COMPILE_WITH_GUI_ | 9 | #ifdef _IRR_COMPILE_WITH_GUI_ |
10 | 10 | ||
11 | #include "IGUIComboBox.h" | 11 | #include "IGUIComboBox.h" |
12 | #include "IGUIStaticText.h" | 12 | #include "IGUIStaticText.h" |
13 | #include "irrString.h" | 13 | #include "irrString.h" |
14 | #include "irrArray.h" | 14 | #include "irrArray.h" |
15 | 15 | ||
16 | namespace irr | 16 | namespace irr |
17 | { | 17 | { |
18 | namespace gui | 18 | namespace gui |
19 | { | 19 | { |
20 | class IGUIButton; | 20 | class IGUIButton; |
21 | class IGUIListBox; | 21 | class IGUIListBox; |
22 | 22 | ||
23 | //! Single line edit box for editing simple text. | 23 | //! Single line edit box for editing simple text. |
24 | class CGUIComboBox : public IGUIComboBox | 24 | class CGUIComboBox : public IGUIComboBox |
25 | { | 25 | { |
26 | public: | 26 | public: |
27 | 27 | ||
28 | //! constructor | 28 | //! constructor |
29 | CGUIComboBox(IGUIEnvironment* environment, IGUIElement* parent, | 29 | CGUIComboBox(IGUIEnvironment* environment, IGUIElement* parent, |
30 | s32 id, core::rect<s32> rectangle); | 30 | s32 id, core::rect<s32> rectangle); |
31 | 31 | ||
32 | //! Returns amount of items in box | 32 | //! Returns amount of items in box |
33 | virtual u32 getItemCount() const; | 33 | virtual u32 getItemCount() const; |
34 | 34 | ||
35 | //! returns string of an item. the idx may be a value from 0 to itemCount-1 | 35 | //! returns string of an item. the idx may be a value from 0 to itemCount-1 |
36 | virtual const wchar_t* getItem(u32 idx) const; | 36 | virtual const wchar_t* getItem(u32 idx) const; |
37 | 37 | ||
38 | //! Returns item data of an item. the idx may be a value from 0 to itemCount-1 | 38 | //! Returns item data of an item. the idx may be a value from 0 to itemCount-1 |
39 | virtual u32 getItemData(u32 idx) const; | 39 | virtual u32 getItemData(u32 idx) const; |
40 | 40 | ||
41 | //! Returns index based on item data | 41 | //! Returns index based on item data |
42 | virtual s32 getIndexForItemData( u32 data ) const; | 42 | virtual s32 getIndexForItemData( u32 data ) const; |
43 | 43 | ||
44 | //! adds an item and returns the index of it | 44 | //! adds an item and returns the index of it |
45 | virtual u32 addItem(const wchar_t* text, u32 data); | 45 | virtual u32 addItem(const wchar_t* text, u32 data); |
46 | 46 | ||
47 | //! Removes an item from the combo box. | 47 | //! Removes an item from the combo box. |
48 | virtual void removeItem(u32 id); | 48 | virtual void removeItem(u32 id); |
49 | 49 | ||
50 | //! deletes all items in the combo box | 50 | //! deletes all items in the combo box |
51 | virtual void clear(); | 51 | virtual void clear(); |
52 | 52 | ||
53 | //! returns the text of the currently selected item | 53 | //! returns the text of the currently selected item |
54 | virtual const wchar_t* getText() const; | 54 | virtual const wchar_t* getText() const; |
55 | 55 | ||
56 | //! returns id of selected item. returns -1 if no item is selected. | 56 | //! returns id of selected item. returns -1 if no item is selected. |
57 | virtual s32 getSelected() const; | 57 | virtual s32 getSelected() const; |
58 | 58 | ||
59 | //! sets the selected item. Set this to -1 if no item should be selected | 59 | //! sets the selected item. Set this to -1 if no item should be selected |
60 | virtual void setSelected(s32 idx); | 60 | virtual void setSelected(s32 idx); |
61 | 61 | ||
62 | //! sets the text alignment of the text part | 62 | //! sets the text alignment of the text part |
63 | virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical); | 63 | virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical); |
64 | 64 | ||
65 | //! Set the maximal number of rows for the selection listbox | 65 | //! Set the maximal number of rows for the selection listbox |
66 | virtual void setMaxSelectionRows(u32 max); | 66 | virtual void setMaxSelectionRows(u32 max); |
67 | 67 | ||
68 | //! Get the maximimal number of rows for the selection listbox | 68 | //! Get the maximimal number of rows for the selection listbox |
69 | virtual u32 getMaxSelectionRows() const; | 69 | virtual u32 getMaxSelectionRows() const; |
70 | 70 | ||
71 | //! called if an event happened. | 71 | //! called if an event happened. |
72 | virtual bool OnEvent(const SEvent& event); | 72 | virtual bool OnEvent(const SEvent& event); |
73 | 73 | ||
74 | //! draws the element and its children | 74 | //! draws the element and its children |
75 | virtual void draw(); | 75 | virtual void draw(); |
76 | 76 | ||
77 | //! Writes attributes of the element. | 77 | //! Writes attributes of the element. |
78 | virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const; | 78 | virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const; |
79 | 79 | ||
80 | //! Reads attributes of the element | 80 | //! Reads attributes of the element |
81 | virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options); | 81 | virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options); |
82 | 82 | ||
83 | private: | 83 | private: |
84 | 84 | ||
85 | void openCloseMenu(); | 85 | void openCloseMenu(); |
86 | void sendSelectionChangedEvent(); | 86 | void sendSelectionChangedEvent(); |
87 | 87 | ||
88 | IGUIButton* ListButton; | 88 | IGUIButton* ListButton; |
89 | IGUIStaticText* SelectedText; | 89 | IGUIStaticText* SelectedText; |
90 | IGUIListBox* ListBox; | 90 | IGUIListBox* ListBox; |
91 | IGUIElement *LastFocus; | 91 | IGUIElement *LastFocus; |
92 | 92 | ||
93 | 93 | ||
94 | struct SComboData | 94 | struct SComboData |
95 | { | 95 | { |
96 | SComboData ( const wchar_t * text, u32 data ) | 96 | SComboData ( const wchar_t * text, u32 data ) |
97 | : Name (text), Data ( data ) {} | 97 | : Name (text), Data ( data ) {} |
98 | 98 | ||
99 | core::stringw Name; | 99 | core::stringw Name; |
100 | u32 Data; | 100 | u32 Data; |
101 | }; | 101 | }; |
102 | core::array< SComboData > Items; | 102 | core::array< SComboData > Items; |
103 | 103 | ||
104 | s32 Selected; | 104 | s32 Selected; |
105 | EGUI_ALIGNMENT HAlign, VAlign; | 105 | EGUI_ALIGNMENT HAlign, VAlign; |
106 | u32 MaxSelectionRows; | 106 | u32 MaxSelectionRows; |
107 | bool HasFocus; | 107 | bool HasFocus; |
108 | }; | 108 | }; |
109 | 109 | ||
110 | 110 | ||
111 | } // end namespace gui | 111 | } // end namespace gui |
112 | } // end namespace irr | 112 | } // end namespace irr |
113 | 113 | ||
114 | #endif // _IRR_COMPILE_WITH_GUI_ | 114 | #endif // _IRR_COMPILE_WITH_GUI_ |
115 | 115 | ||
116 | #endif // __C_GUI_COMBO_BOX_H_INCLUDED__ | 116 | #endif // __C_GUI_COMBO_BOX_H_INCLUDED__ |
117 | 117 | ||