diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/irrlicht-1.8/include/IGUIListBox.h | 276 |
1 files changed, 138 insertions, 138 deletions
diff --git a/libraries/irrlicht-1.8/include/IGUIListBox.h b/libraries/irrlicht-1.8/include/IGUIListBox.h index 0af7d7c..de922ce 100644 --- a/libraries/irrlicht-1.8/include/IGUIListBox.h +++ b/libraries/irrlicht-1.8/include/IGUIListBox.h | |||
@@ -1,138 +1,138 @@ | |||
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 __I_GUI_LIST_BOX_H_INCLUDED__ | 5 | #ifndef __I_GUI_LIST_BOX_H_INCLUDED__ |
6 | #define __I_GUI_LIST_BOX_H_INCLUDED__ | 6 | #define __I_GUI_LIST_BOX_H_INCLUDED__ |
7 | 7 | ||
8 | #include "IGUIElement.h" | 8 | #include "IGUIElement.h" |
9 | #include "SColor.h" | 9 | #include "SColor.h" |
10 | 10 | ||
11 | namespace irr | 11 | namespace irr |
12 | { | 12 | { |
13 | namespace gui | 13 | namespace gui |
14 | { | 14 | { |
15 | class IGUISpriteBank; | 15 | class IGUISpriteBank; |
16 | 16 | ||
17 | //! Enumeration for listbox colors | 17 | //! Enumeration for listbox colors |
18 | enum EGUI_LISTBOX_COLOR | 18 | enum EGUI_LISTBOX_COLOR |
19 | { | 19 | { |
20 | //! Color of text | 20 | //! Color of text |
21 | EGUI_LBC_TEXT=0, | 21 | EGUI_LBC_TEXT=0, |
22 | //! Color of selected text | 22 | //! Color of selected text |
23 | EGUI_LBC_TEXT_HIGHLIGHT, | 23 | EGUI_LBC_TEXT_HIGHLIGHT, |
24 | //! Color of icon | 24 | //! Color of icon |
25 | EGUI_LBC_ICON, | 25 | EGUI_LBC_ICON, |
26 | //! Color of selected icon | 26 | //! Color of selected icon |
27 | EGUI_LBC_ICON_HIGHLIGHT, | 27 | EGUI_LBC_ICON_HIGHLIGHT, |
28 | //! Not used, just counts the number of available colors | 28 | //! Not used, just counts the number of available colors |
29 | EGUI_LBC_COUNT | 29 | EGUI_LBC_COUNT |
30 | }; | 30 | }; |
31 | 31 | ||
32 | 32 | ||
33 | //! Default list box GUI element. | 33 | //! Default list box GUI element. |
34 | /** \par This element can create the following events of type EGUI_EVENT_TYPE: | 34 | /** \par This element can create the following events of type EGUI_EVENT_TYPE: |
35 | \li EGET_LISTBOX_CHANGED | 35 | \li EGET_LISTBOX_CHANGED |
36 | \li EGET_LISTBOX_SELECTED_AGAIN | 36 | \li EGET_LISTBOX_SELECTED_AGAIN |
37 | */ | 37 | */ |
38 | class IGUIListBox : public IGUIElement | 38 | class IGUIListBox : public IGUIElement |
39 | { | 39 | { |
40 | public: | 40 | public: |
41 | //! constructor | 41 | //! constructor |
42 | IGUIListBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) | 42 | IGUIListBox(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle) |
43 | : IGUIElement(EGUIET_LIST_BOX, environment, parent, id, rectangle) {} | 43 | : IGUIElement(EGUIET_LIST_BOX, environment, parent, id, rectangle) {} |
44 | 44 | ||
45 | //! returns amount of list items | 45 | //! returns amount of list items |
46 | virtual u32 getItemCount() const = 0; | 46 | virtual u32 getItemCount() const = 0; |
47 | 47 | ||
48 | //! returns string of a list item. the may id be a value from 0 to itemCount-1 | 48 | //! returns string of a list item. the may id be a value from 0 to itemCount-1 |
49 | virtual const wchar_t* getListItem(u32 id) const = 0; | 49 | virtual const wchar_t* getListItem(u32 id) const = 0; |
50 | 50 | ||
51 | //! adds an list item, returns id of item | 51 | //! adds an list item, returns id of item |
52 | virtual u32 addItem(const wchar_t* text) = 0; | 52 | virtual u32 addItem(const wchar_t* text) = 0; |
53 | 53 | ||
54 | //! adds an list item with an icon | 54 | //! adds an list item with an icon |
55 | /** \param text Text of list entry | 55 | /** \param text Text of list entry |
56 | \param icon Sprite index of the Icon within the current sprite bank. Set it to -1 if you want no icon | 56 | \param icon Sprite index of the Icon within the current sprite bank. Set it to -1 if you want no icon |
57 | \return The id of the new created item */ | 57 | \return The id of the new created item */ |
58 | virtual u32 addItem(const wchar_t* text, s32 icon) = 0; | 58 | virtual u32 addItem(const wchar_t* text, s32 icon) = 0; |
59 | 59 | ||
60 | //! Removes an item from the list | 60 | //! Removes an item from the list |
61 | virtual void removeItem(u32 index) = 0; | 61 | virtual void removeItem(u32 index) = 0; |
62 | 62 | ||
63 | //! get the the id of the item at the given absolute coordinates | 63 | //! get the the id of the item at the given absolute coordinates |
64 | /** \return The id of the listitem or -1 when no item is at those coordinates*/ | 64 | /** \return The id of the listitem or -1 when no item is at those coordinates*/ |
65 | virtual s32 getItemAt(s32 xpos, s32 ypos) const = 0; | 65 | virtual s32 getItemAt(s32 xpos, s32 ypos) const = 0; |
66 | 66 | ||
67 | //! Returns the icon of an item | 67 | //! Returns the icon of an item |
68 | virtual s32 getIcon(u32 index) const = 0; | 68 | virtual s32 getIcon(u32 index) const = 0; |
69 | 69 | ||
70 | //! Sets the sprite bank which should be used to draw list icons. | 70 | //! Sets the sprite bank which should be used to draw list icons. |
71 | /** This font is set to the sprite bank of the built-in-font by | 71 | /** This font is set to the sprite bank of the built-in-font by |
72 | default. A sprite can be displayed in front of every list item. | 72 | default. A sprite can be displayed in front of every list item. |
73 | An icon is an index within the icon sprite bank. Several | 73 | An icon is an index within the icon sprite bank. Several |
74 | default icons are available in the skin through getIcon. */ | 74 | default icons are available in the skin through getIcon. */ |
75 | virtual void setSpriteBank(IGUISpriteBank* bank) = 0; | 75 | virtual void setSpriteBank(IGUISpriteBank* bank) = 0; |
76 | 76 | ||
77 | //! clears the list, deletes all items in the listbox | 77 | //! clears the list, deletes all items in the listbox |
78 | virtual void clear() = 0; | 78 | virtual void clear() = 0; |
79 | 79 | ||
80 | //! returns id of selected item. returns -1 if no item is selected. | 80 | //! returns id of selected item. returns -1 if no item is selected. |
81 | virtual s32 getSelected() const = 0; | 81 | virtual s32 getSelected() const = 0; |
82 | 82 | ||
83 | //! sets the selected item. Set this to -1 if no item should be selected | 83 | //! sets the selected item. Set this to -1 if no item should be selected |
84 | virtual void setSelected(s32 index) = 0; | 84 | virtual void setSelected(s32 index) = 0; |
85 | 85 | ||
86 | //! sets the selected item. Set this to 0 if no item should be selected | 86 | //! sets the selected item. Set this to 0 if no item should be selected |
87 | virtual void setSelected(const wchar_t *item) = 0; | 87 | virtual void setSelected(const wchar_t *item) = 0; |
88 | 88 | ||
89 | //! set whether the listbox should scroll to newly selected items | 89 | //! set whether the listbox should scroll to newly selected items |
90 | virtual void setAutoScrollEnabled(bool scroll) = 0; | 90 | virtual void setAutoScrollEnabled(bool scroll) = 0; |
91 | 91 | ||
92 | //! returns true if automatic scrolling is enabled, false if not. | 92 | //! returns true if automatic scrolling is enabled, false if not. |
93 | virtual bool isAutoScrollEnabled() const = 0; | 93 | virtual bool isAutoScrollEnabled() const = 0; |
94 | 94 | ||
95 | //! set all item colors at given index to color | 95 | //! set all item colors at given index to color |
96 | virtual void setItemOverrideColor(u32 index, video::SColor color) = 0; | 96 | virtual void setItemOverrideColor(u32 index, video::SColor color) = 0; |
97 | 97 | ||
98 | //! set all item colors of specified type at given index to color | 98 | //! set all item colors of specified type at given index to color |
99 | virtual void setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, video::SColor color) = 0; | 99 | virtual void setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, video::SColor color) = 0; |
100 | 100 | ||
101 | //! clear all item colors at index | 101 | //! clear all item colors at index |
102 | virtual void clearItemOverrideColor(u32 index) = 0; | 102 | virtual void clearItemOverrideColor(u32 index) = 0; |
103 | 103 | ||
104 | //! clear item color at index for given colortype | 104 | //! clear item color at index for given colortype |
105 | virtual void clearItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) = 0; | 105 | virtual void clearItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) = 0; |
106 | 106 | ||
107 | //! has the item at index its color overwritten? | 107 | //! has the item at index its color overwritten? |
108 | virtual bool hasItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const = 0; | 108 | virtual bool hasItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const = 0; |
109 | 109 | ||
110 | //! return the overwrite color at given item index. | 110 | //! return the overwrite color at given item index. |
111 | virtual video::SColor getItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const = 0; | 111 | virtual video::SColor getItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const = 0; |
112 | 112 | ||
113 | //! return the default color which is used for the given colorType | 113 | //! return the default color which is used for the given colorType |
114 | virtual video::SColor getItemDefaultColor(EGUI_LISTBOX_COLOR colorType) const = 0; | 114 | virtual video::SColor getItemDefaultColor(EGUI_LISTBOX_COLOR colorType) const = 0; |
115 | 115 | ||
116 | //! set the item at the given index | 116 | //! set the item at the given index |
117 | virtual void setItem(u32 index, const wchar_t* text, s32 icon) = 0; | 117 | virtual void setItem(u32 index, const wchar_t* text, s32 icon) = 0; |
118 | 118 | ||
119 | //! Insert the item at the given index | 119 | //! Insert the item at the given index |
120 | /** \return The index on success or -1 on failure. */ | 120 | /** \return The index on success or -1 on failure. */ |
121 | virtual s32 insertItem(u32 index, const wchar_t* text, s32 icon) = 0; | 121 | virtual s32 insertItem(u32 index, const wchar_t* text, s32 icon) = 0; |
122 | 122 | ||
123 | //! Swap the items at the given indices | 123 | //! Swap the items at the given indices |
124 | virtual void swapItems(u32 index1, u32 index2) = 0; | 124 | virtual void swapItems(u32 index1, u32 index2) = 0; |
125 | 125 | ||
126 | //! set global itemHeight | 126 | //! set global itemHeight |
127 | virtual void setItemHeight( s32 height ) = 0; | 127 | virtual void setItemHeight( s32 height ) = 0; |
128 | 128 | ||
129 | //! Sets whether to draw the background | 129 | //! Sets whether to draw the background |
130 | virtual void setDrawBackground(bool draw) = 0; | 130 | virtual void setDrawBackground(bool draw) = 0; |
131 | }; | 131 | }; |
132 | 132 | ||
133 | 133 | ||
134 | } // end namespace gui | 134 | } // end namespace gui |
135 | } // end namespace irr | 135 | } // end namespace irr |
136 | 136 | ||
137 | #endif | 137 | #endif |
138 | 138 | ||