diff options
Diffstat (limited to 'libraries/irrlicht-1.8/include/IGUIEnvironment.h')
-rw-r--r-- | libraries/irrlicht-1.8/include/IGUIEnvironment.h | 1240 |
1 files changed, 620 insertions, 620 deletions
diff --git a/libraries/irrlicht-1.8/include/IGUIEnvironment.h b/libraries/irrlicht-1.8/include/IGUIEnvironment.h index 0291107..219e419 100644 --- a/libraries/irrlicht-1.8/include/IGUIEnvironment.h +++ b/libraries/irrlicht-1.8/include/IGUIEnvironment.h | |||
@@ -1,620 +1,620 @@ | |||
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_ENVIRONMENT_H_INCLUDED__ | 5 | #ifndef __I_GUI_ENVIRONMENT_H_INCLUDED__ |
6 | #define __I_GUI_ENVIRONMENT_H_INCLUDED__ | 6 | #define __I_GUI_ENVIRONMENT_H_INCLUDED__ |
7 | 7 | ||
8 | #include "IReferenceCounted.h" | 8 | #include "IReferenceCounted.h" |
9 | #include "IGUISkin.h" | 9 | #include "IGUISkin.h" |
10 | #include "rect.h" | 10 | #include "rect.h" |
11 | #include "EMessageBoxFlags.h" | 11 | #include "EMessageBoxFlags.h" |
12 | #include "IEventReceiver.h" | 12 | #include "IEventReceiver.h" |
13 | #include "IXMLReader.h" | 13 | #include "IXMLReader.h" |
14 | #include "path.h" | 14 | #include "path.h" |
15 | 15 | ||
16 | namespace irr | 16 | namespace irr |
17 | { | 17 | { |
18 | class IOSOperator; | 18 | class IOSOperator; |
19 | class IEventReceiver; | 19 | class IEventReceiver; |
20 | 20 | ||
21 | namespace io | 21 | namespace io |
22 | { | 22 | { |
23 | class IXMLWriter; | 23 | class IXMLWriter; |
24 | class IReadFile; | 24 | class IReadFile; |
25 | class IWriteFile; | 25 | class IWriteFile; |
26 | class IFileSystem; | 26 | class IFileSystem; |
27 | } // end namespace io | 27 | } // end namespace io |
28 | namespace video | 28 | namespace video |
29 | { | 29 | { |
30 | class IVideoDriver; | 30 | class IVideoDriver; |
31 | class ITexture; | 31 | class ITexture; |
32 | } // end namespace video | 32 | } // end namespace video |
33 | 33 | ||
34 | namespace gui | 34 | namespace gui |
35 | { | 35 | { |
36 | 36 | ||
37 | class IGUIElement; | 37 | class IGUIElement; |
38 | class IGUIFont; | 38 | class IGUIFont; |
39 | class IGUISpriteBank; | 39 | class IGUISpriteBank; |
40 | class IGUIScrollBar; | 40 | class IGUIScrollBar; |
41 | class IGUIImage; | 41 | class IGUIImage; |
42 | class IGUIMeshViewer; | 42 | class IGUIMeshViewer; |
43 | class IGUICheckBox; | 43 | class IGUICheckBox; |
44 | class IGUIListBox; | 44 | class IGUIListBox; |
45 | class IGUITreeView; | 45 | class IGUITreeView; |
46 | class IGUIImageList; | 46 | class IGUIImageList; |
47 | class IGUIFileOpenDialog; | 47 | class IGUIFileOpenDialog; |
48 | class IGUIColorSelectDialog; | 48 | class IGUIColorSelectDialog; |
49 | class IGUIInOutFader; | 49 | class IGUIInOutFader; |
50 | class IGUIStaticText; | 50 | class IGUIStaticText; |
51 | class IGUIEditBox; | 51 | class IGUIEditBox; |
52 | class IGUISpinBox; | 52 | class IGUISpinBox; |
53 | class IGUITabControl; | 53 | class IGUITabControl; |
54 | class IGUITab; | 54 | class IGUITab; |
55 | class IGUITable; | 55 | class IGUITable; |
56 | class IGUIContextMenu; | 56 | class IGUIContextMenu; |
57 | class IGUIComboBox; | 57 | class IGUIComboBox; |
58 | class IGUIToolBar; | 58 | class IGUIToolBar; |
59 | class IGUIButton; | 59 | class IGUIButton; |
60 | class IGUIWindow; | 60 | class IGUIWindow; |
61 | class IGUIElementFactory; | 61 | class IGUIElementFactory; |
62 | 62 | ||
63 | //! GUI Environment. Used as factory and manager of all other GUI elements. | 63 | //! GUI Environment. Used as factory and manager of all other GUI elements. |
64 | /** \par This element can create the following events of type EGUI_EVENT_TYPE (which are passed on to focused sub-elements): | 64 | /** \par This element can create the following events of type EGUI_EVENT_TYPE (which are passed on to focused sub-elements): |
65 | \li EGET_ELEMENT_FOCUS_LOST | 65 | \li EGET_ELEMENT_FOCUS_LOST |
66 | \li EGET_ELEMENT_FOCUSED | 66 | \li EGET_ELEMENT_FOCUSED |
67 | \li EGET_ELEMENT_LEFT | 67 | \li EGET_ELEMENT_LEFT |
68 | \li EGET_ELEMENT_HOVERED | 68 | \li EGET_ELEMENT_HOVERED |
69 | */ | 69 | */ |
70 | class IGUIEnvironment : public virtual IReferenceCounted | 70 | class IGUIEnvironment : public virtual IReferenceCounted |
71 | { | 71 | { |
72 | public: | 72 | public: |
73 | 73 | ||
74 | //! Draws all gui elements by traversing the GUI environment starting at the root node. | 74 | //! Draws all gui elements by traversing the GUI environment starting at the root node. |
75 | virtual void drawAll() = 0; | 75 | virtual void drawAll() = 0; |
76 | 76 | ||
77 | //! Sets the focus to an element. | 77 | //! Sets the focus to an element. |
78 | /** Causes a EGET_ELEMENT_FOCUS_LOST event followed by a | 78 | /** Causes a EGET_ELEMENT_FOCUS_LOST event followed by a |
79 | EGET_ELEMENT_FOCUSED event. If someone absorbed either of the events, | 79 | EGET_ELEMENT_FOCUSED event. If someone absorbed either of the events, |
80 | then the focus will not be changed. | 80 | then the focus will not be changed. |
81 | \param element Pointer to the element which shall get the focus. | 81 | \param element Pointer to the element which shall get the focus. |
82 | \return True on success, false on failure */ | 82 | \return True on success, false on failure */ |
83 | virtual bool setFocus(IGUIElement* element) = 0; | 83 | virtual bool setFocus(IGUIElement* element) = 0; |
84 | 84 | ||
85 | //! Returns the element which holds the focus. | 85 | //! Returns the element which holds the focus. |
86 | /** \return Pointer to the element with focus. */ | 86 | /** \return Pointer to the element with focus. */ |
87 | virtual IGUIElement* getFocus() const = 0; | 87 | virtual IGUIElement* getFocus() const = 0; |
88 | 88 | ||
89 | //! Returns the element which was last under the mouse cursor | 89 | //! Returns the element which was last under the mouse cursor |
90 | /** NOTE: This information is updated _after_ the user-eventreceiver | 90 | /** NOTE: This information is updated _after_ the user-eventreceiver |
91 | received it's mouse-events. To find the hovered element while catching | 91 | received it's mouse-events. To find the hovered element while catching |
92 | mouse events you have to use instead: | 92 | mouse events you have to use instead: |
93 | IGUIEnvironment::getRootGUIElement()->getElementFromPoint(mousePos); | 93 | IGUIEnvironment::getRootGUIElement()->getElementFromPoint(mousePos); |
94 | \return Pointer to the element under the mouse. */ | 94 | \return Pointer to the element under the mouse. */ |
95 | virtual IGUIElement* getHovered() const = 0; | 95 | virtual IGUIElement* getHovered() const = 0; |
96 | 96 | ||
97 | //! Removes the focus from an element. | 97 | //! Removes the focus from an element. |
98 | /** Causes a EGET_ELEMENT_FOCUS_LOST event. If the event is absorbed | 98 | /** Causes a EGET_ELEMENT_FOCUS_LOST event. If the event is absorbed |
99 | then the focus will not be changed. | 99 | then the focus will not be changed. |
100 | \param element Pointer to the element which shall lose the focus. | 100 | \param element Pointer to the element which shall lose the focus. |
101 | \return True on success, false on failure */ | 101 | \return True on success, false on failure */ |
102 | virtual bool removeFocus(IGUIElement* element) = 0; | 102 | virtual bool removeFocus(IGUIElement* element) = 0; |
103 | 103 | ||
104 | //! Returns whether the element has focus | 104 | //! Returns whether the element has focus |
105 | /** \param element Pointer to the element which is tested. | 105 | /** \param element Pointer to the element which is tested. |
106 | \return True if the element has focus, else false. */ | 106 | \return True if the element has focus, else false. */ |
107 | virtual bool hasFocus(IGUIElement* element) const = 0; | 107 | virtual bool hasFocus(IGUIElement* element) const = 0; |
108 | 108 | ||
109 | //! Returns the current video driver. | 109 | //! Returns the current video driver. |
110 | /** \return Pointer to the video driver. */ | 110 | /** \return Pointer to the video driver. */ |
111 | virtual video::IVideoDriver* getVideoDriver() const = 0; | 111 | virtual video::IVideoDriver* getVideoDriver() const = 0; |
112 | 112 | ||
113 | //! Returns the file system. | 113 | //! Returns the file system. |
114 | /** \return Pointer to the file system. */ | 114 | /** \return Pointer to the file system. */ |
115 | virtual io::IFileSystem* getFileSystem() const = 0; | 115 | virtual io::IFileSystem* getFileSystem() const = 0; |
116 | 116 | ||
117 | //! returns a pointer to the OS operator | 117 | //! returns a pointer to the OS operator |
118 | /** \return Pointer to the OS operator. */ | 118 | /** \return Pointer to the OS operator. */ |
119 | virtual IOSOperator* getOSOperator() const = 0; | 119 | virtual IOSOperator* getOSOperator() const = 0; |
120 | 120 | ||
121 | //! Removes all elements from the environment. | 121 | //! Removes all elements from the environment. |
122 | virtual void clear() = 0; | 122 | virtual void clear() = 0; |
123 | 123 | ||
124 | //! Posts an input event to the environment. | 124 | //! Posts an input event to the environment. |
125 | /** Usually you do not have to | 125 | /** Usually you do not have to |
126 | use this method, it is used by the engine internally. | 126 | use this method, it is used by the engine internally. |
127 | \param event The event to post. | 127 | \param event The event to post. |
128 | \return True if succeeded, else false. */ | 128 | \return True if succeeded, else false. */ |
129 | virtual bool postEventFromUser(const SEvent& event) = 0; | 129 | virtual bool postEventFromUser(const SEvent& event) = 0; |
130 | 130 | ||
131 | //! This sets a new event receiver for gui events. | 131 | //! This sets a new event receiver for gui events. |
132 | /** Usually you do not have to | 132 | /** Usually you do not have to |
133 | use this method, it is used by the engine internally. | 133 | use this method, it is used by the engine internally. |
134 | \param evr Pointer to the new receiver. */ | 134 | \param evr Pointer to the new receiver. */ |
135 | virtual void setUserEventReceiver(IEventReceiver* evr) = 0; | 135 | virtual void setUserEventReceiver(IEventReceiver* evr) = 0; |
136 | 136 | ||
137 | //! Returns pointer to the current gui skin. | 137 | //! Returns pointer to the current gui skin. |
138 | /** \return Pointer to the GUI skin. */ | 138 | /** \return Pointer to the GUI skin. */ |
139 | virtual IGUISkin* getSkin() const = 0; | 139 | virtual IGUISkin* getSkin() const = 0; |
140 | 140 | ||
141 | //! Sets a new GUI Skin | 141 | //! Sets a new GUI Skin |
142 | /** You can use this to change the appearance of the whole GUI | 142 | /** You can use this to change the appearance of the whole GUI |
143 | Environment. You can set one of the built-in skins or implement your | 143 | Environment. You can set one of the built-in skins or implement your |
144 | own class derived from IGUISkin and enable it using this method. | 144 | own class derived from IGUISkin and enable it using this method. |
145 | To set for example the built-in Windows classic skin, use the following | 145 | To set for example the built-in Windows classic skin, use the following |
146 | code: | 146 | code: |
147 | \code | 147 | \code |
148 | gui::IGUISkin* newskin = environment->createSkin(gui::EGST_WINDOWS_CLASSIC); | 148 | gui::IGUISkin* newskin = environment->createSkin(gui::EGST_WINDOWS_CLASSIC); |
149 | environment->setSkin(newskin); | 149 | environment->setSkin(newskin); |
150 | newskin->drop(); | 150 | newskin->drop(); |
151 | \endcode | 151 | \endcode |
152 | \param skin New skin to use. | 152 | \param skin New skin to use. |
153 | */ | 153 | */ |
154 | virtual void setSkin(IGUISkin* skin) = 0; | 154 | virtual void setSkin(IGUISkin* skin) = 0; |
155 | 155 | ||
156 | //! Creates a new GUI Skin based on a template. | 156 | //! Creates a new GUI Skin based on a template. |
157 | /** Use setSkin() to set the created skin. | 157 | /** Use setSkin() to set the created skin. |
158 | \param type The type of the new skin. | 158 | \param type The type of the new skin. |
159 | \return Pointer to the created skin. | 159 | \return Pointer to the created skin. |
160 | If you no longer need it, you should call IGUISkin::drop(). | 160 | If you no longer need it, you should call IGUISkin::drop(). |
161 | See IReferenceCounted::drop() for more information. */ | 161 | See IReferenceCounted::drop() for more information. */ |
162 | virtual IGUISkin* createSkin(EGUI_SKIN_TYPE type) = 0; | 162 | virtual IGUISkin* createSkin(EGUI_SKIN_TYPE type) = 0; |
163 | 163 | ||
164 | 164 | ||
165 | //! Creates the image list from the given texture. | 165 | //! Creates the image list from the given texture. |
166 | /** \param texture Texture to split into images | 166 | /** \param texture Texture to split into images |
167 | \param imageSize Dimension of each image | 167 | \param imageSize Dimension of each image |
168 | \param useAlphaChannel Flag whether alpha channel of the texture should be honored. | 168 | \param useAlphaChannel Flag whether alpha channel of the texture should be honored. |
169 | \return Pointer to the font. Returns 0 if the font could not be loaded. | 169 | \return Pointer to the font. Returns 0 if the font could not be loaded. |
170 | This pointer should not be dropped. See IReferenceCounted::drop() for | 170 | This pointer should not be dropped. See IReferenceCounted::drop() for |
171 | more information. */ | 171 | more information. */ |
172 | virtual IGUIImageList* createImageList( video::ITexture* texture, | 172 | virtual IGUIImageList* createImageList( video::ITexture* texture, |
173 | core::dimension2d<s32> imageSize, | 173 | core::dimension2d<s32> imageSize, |
174 | bool useAlphaChannel ) = 0; | 174 | bool useAlphaChannel ) = 0; |
175 | 175 | ||
176 | //! Returns pointer to the font with the specified filename. | 176 | //! Returns pointer to the font with the specified filename. |
177 | /** Loads the font if it was not loaded before. | 177 | /** Loads the font if it was not loaded before. |
178 | \param filename Filename of the Font. | 178 | \param filename Filename of the Font. |
179 | \return Pointer to the font. Returns 0 if the font could not be loaded. | 179 | \return Pointer to the font. Returns 0 if the font could not be loaded. |
180 | This pointer should not be dropped. See IReferenceCounted::drop() for | 180 | This pointer should not be dropped. See IReferenceCounted::drop() for |
181 | more information. */ | 181 | more information. */ |
182 | virtual IGUIFont* getFont(const io::path& filename) = 0; | 182 | virtual IGUIFont* getFont(const io::path& filename) = 0; |
183 | 183 | ||
184 | //! Adds an externally loaded font to the font list. | 184 | //! Adds an externally loaded font to the font list. |
185 | /** This method allows to attach an already loaded font to the list of | 185 | /** This method allows to attach an already loaded font to the list of |
186 | existing fonts. The font is grabbed if non-null and adding was successful. | 186 | existing fonts. The font is grabbed if non-null and adding was successful. |
187 | \param name Name the font should be stored as. | 187 | \param name Name the font should be stored as. |
188 | \param font Pointer to font to add. | 188 | \param font Pointer to font to add. |
189 | \return Pointer to the font stored. This can differ from given parameter if the name previously existed. */ | 189 | \return Pointer to the font stored. This can differ from given parameter if the name previously existed. */ |
190 | virtual IGUIFont* addFont(const io::path& name, IGUIFont* font) = 0; | 190 | virtual IGUIFont* addFont(const io::path& name, IGUIFont* font) = 0; |
191 | 191 | ||
192 | //! remove loaded font | 192 | //! remove loaded font |
193 | virtual void removeFont(IGUIFont* font) = 0; | 193 | virtual void removeFont(IGUIFont* font) = 0; |
194 | 194 | ||
195 | //! Returns the default built-in font. | 195 | //! Returns the default built-in font. |
196 | /** \return Pointer to the default built-in font. | 196 | /** \return Pointer to the default built-in font. |
197 | This pointer should not be dropped. See IReferenceCounted::drop() for | 197 | This pointer should not be dropped. See IReferenceCounted::drop() for |
198 | more information. */ | 198 | more information. */ |
199 | virtual IGUIFont* getBuiltInFont() const = 0; | 199 | virtual IGUIFont* getBuiltInFont() const = 0; |
200 | 200 | ||
201 | //! Returns pointer to the sprite bank with the specified file name. | 201 | //! Returns pointer to the sprite bank with the specified file name. |
202 | /** Loads the bank if it was not loaded before. | 202 | /** Loads the bank if it was not loaded before. |
203 | \param filename Filename of the sprite bank's origin. | 203 | \param filename Filename of the sprite bank's origin. |
204 | \return Pointer to the sprite bank. Returns 0 if it could not be loaded. | 204 | \return Pointer to the sprite bank. Returns 0 if it could not be loaded. |
205 | This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ | 205 | This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ |
206 | virtual IGUISpriteBank* getSpriteBank(const io::path& filename) = 0; | 206 | virtual IGUISpriteBank* getSpriteBank(const io::path& filename) = 0; |
207 | 207 | ||
208 | //! Adds an empty sprite bank to the manager | 208 | //! Adds an empty sprite bank to the manager |
209 | /** \param name Name of the new sprite bank. | 209 | /** \param name Name of the new sprite bank. |
210 | \return Pointer to the sprite bank. | 210 | \return Pointer to the sprite bank. |
211 | This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ | 211 | This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ |
212 | virtual IGUISpriteBank* addEmptySpriteBank(const io::path& name) = 0; | 212 | virtual IGUISpriteBank* addEmptySpriteBank(const io::path& name) = 0; |
213 | 213 | ||
214 | //! Returns the root gui element. | 214 | //! Returns the root gui element. |
215 | /** This is the first gui element, the (direct or indirect) parent of all | 215 | /** This is the first gui element, the (direct or indirect) parent of all |
216 | other gui elements. It is a valid IGUIElement, with dimensions the same | 216 | other gui elements. It is a valid IGUIElement, with dimensions the same |
217 | size as the screen. | 217 | size as the screen. |
218 | \return Pointer to the root element of the GUI. The returned pointer | 218 | \return Pointer to the root element of the GUI. The returned pointer |
219 | should not be dropped. See IReferenceCounted::drop() for more | 219 | should not be dropped. See IReferenceCounted::drop() for more |
220 | information. */ | 220 | information. */ |
221 | virtual IGUIElement* getRootGUIElement() = 0; | 221 | virtual IGUIElement* getRootGUIElement() = 0; |
222 | 222 | ||
223 | //! Adds a button element. | 223 | //! Adds a button element. |
224 | /** \param rectangle Rectangle specifying the borders of the button. | 224 | /** \param rectangle Rectangle specifying the borders of the button. |
225 | \param parent Parent gui element of the button. | 225 | \param parent Parent gui element of the button. |
226 | \param id Id with which the gui element can be identified. | 226 | \param id Id with which the gui element can be identified. |
227 | \param text Text displayed on the button. | 227 | \param text Text displayed on the button. |
228 | \param tooltiptext Text displayed in the tooltip. | 228 | \param tooltiptext Text displayed in the tooltip. |
229 | \return Pointer to the created button. Returns 0 if an error occurred. | 229 | \return Pointer to the created button. Returns 0 if an error occurred. |
230 | This pointer should not be dropped. See IReferenceCounted::drop() for | 230 | This pointer should not be dropped. See IReferenceCounted::drop() for |
231 | more information. */ | 231 | more information. */ |
232 | virtual IGUIButton* addButton(const core::rect<s32>& rectangle, | 232 | virtual IGUIButton* addButton(const core::rect<s32>& rectangle, |
233 | IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0, const wchar_t* tooltiptext = 0) = 0; | 233 | IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0, const wchar_t* tooltiptext = 0) = 0; |
234 | 234 | ||
235 | //! Adds an empty window element. | 235 | //! Adds an empty window element. |
236 | /** \param rectangle Rectangle specifying the borders of the window. | 236 | /** \param rectangle Rectangle specifying the borders of the window. |
237 | \param modal Defines if the dialog is modal. This means, that all other | 237 | \param modal Defines if the dialog is modal. This means, that all other |
238 | gui elements which were created before the window cannot be used until | 238 | gui elements which were created before the window cannot be used until |
239 | it is removed. | 239 | it is removed. |
240 | \param text Text displayed as the window title. | 240 | \param text Text displayed as the window title. |
241 | \param parent Parent gui element of the window. | 241 | \param parent Parent gui element of the window. |
242 | \param id Id with which the gui element can be identified. | 242 | \param id Id with which the gui element can be identified. |
243 | \return Pointer to the created window. Returns 0 if an error occurred. | 243 | \return Pointer to the created window. Returns 0 if an error occurred. |
244 | This pointer should not be dropped. See IReferenceCounted::drop() for | 244 | This pointer should not be dropped. See IReferenceCounted::drop() for |
245 | more information. */ | 245 | more information. */ |
246 | virtual IGUIWindow* addWindow(const core::rect<s32>& rectangle, bool modal = false, | 246 | virtual IGUIWindow* addWindow(const core::rect<s32>& rectangle, bool modal = false, |
247 | const wchar_t* text=0, IGUIElement* parent=0, s32 id=-1) = 0; | 247 | const wchar_t* text=0, IGUIElement* parent=0, s32 id=-1) = 0; |
248 | 248 | ||
249 | //! Adds a modal screen. | 249 | //! Adds a modal screen. |
250 | /** This control stops its parent's members from being able to receive | 250 | /** This control stops its parent's members from being able to receive |
251 | input until its last child is removed, it then deletes itself. | 251 | input until its last child is removed, it then deletes itself. |
252 | \param parent Parent gui element of the modal. | 252 | \param parent Parent gui element of the modal. |
253 | \return Pointer to the created modal. Returns 0 if an error occurred. | 253 | \return Pointer to the created modal. Returns 0 if an error occurred. |
254 | This pointer should not be dropped. See IReferenceCounted::drop() for | 254 | This pointer should not be dropped. See IReferenceCounted::drop() for |
255 | more information. */ | 255 | more information. */ |
256 | virtual IGUIElement* addModalScreen(IGUIElement* parent) = 0; | 256 | virtual IGUIElement* addModalScreen(IGUIElement* parent) = 0; |
257 | 257 | ||
258 | //! Adds a message box. | 258 | //! Adds a message box. |
259 | /** \param caption Text to be displayed the title of the message box. | 259 | /** \param caption Text to be displayed the title of the message box. |
260 | \param text Text to be displayed in the body of the message box. | 260 | \param text Text to be displayed in the body of the message box. |
261 | \param modal Defines if the dialog is modal. This means, that all other | 261 | \param modal Defines if the dialog is modal. This means, that all other |
262 | gui elements which were created before the message box cannot be used | 262 | gui elements which were created before the message box cannot be used |
263 | until this messagebox is removed. | 263 | until this messagebox is removed. |
264 | \param flags Flags specifying the layout of the message box. For example | 264 | \param flags Flags specifying the layout of the message box. For example |
265 | to create a message box with an OK and a CANCEL button on it, set this | 265 | to create a message box with an OK and a CANCEL button on it, set this |
266 | to (EMBF_OK | EMBF_CANCEL). | 266 | to (EMBF_OK | EMBF_CANCEL). |
267 | \param parent Parent gui element of the message box. | 267 | \param parent Parent gui element of the message box. |
268 | \param id Id with which the gui element can be identified. | 268 | \param id Id with which the gui element can be identified. |
269 | \param image Optional texture which will be displayed beside the text as an image | 269 | \param image Optional texture which will be displayed beside the text as an image |
270 | \return Pointer to the created message box. Returns 0 if an error | 270 | \return Pointer to the created message box. Returns 0 if an error |
271 | occurred. This pointer should not be dropped. See | 271 | occurred. This pointer should not be dropped. See |
272 | IReferenceCounted::drop() for more information. */ | 272 | IReferenceCounted::drop() for more information. */ |
273 | virtual IGUIWindow* addMessageBox(const wchar_t* caption, const wchar_t* text=0, | 273 | virtual IGUIWindow* addMessageBox(const wchar_t* caption, const wchar_t* text=0, |
274 | bool modal = true, s32 flags = EMBF_OK, IGUIElement* parent=0, s32 id=-1, video::ITexture* image=0) = 0; | 274 | bool modal = true, s32 flags = EMBF_OK, IGUIElement* parent=0, s32 id=-1, video::ITexture* image=0) = 0; |
275 | 275 | ||
276 | //! Adds a scrollbar. | 276 | //! Adds a scrollbar. |
277 | /** \param horizontal Specifies if the scroll bar is drawn horizontal | 277 | /** \param horizontal Specifies if the scroll bar is drawn horizontal |
278 | or vertical. | 278 | or vertical. |
279 | \param rectangle Rectangle specifying the borders of the scrollbar. | 279 | \param rectangle Rectangle specifying the borders of the scrollbar. |
280 | \param parent Parent gui element of the scroll bar. | 280 | \param parent Parent gui element of the scroll bar. |
281 | \param id Id to identify the gui element. | 281 | \param id Id to identify the gui element. |
282 | \return Pointer to the created scrollbar. Returns 0 if an error | 282 | \return Pointer to the created scrollbar. Returns 0 if an error |
283 | occurred. This pointer should not be dropped. See | 283 | occurred. This pointer should not be dropped. See |
284 | IReferenceCounted::drop() for more information. */ | 284 | IReferenceCounted::drop() for more information. */ |
285 | virtual IGUIScrollBar* addScrollBar(bool horizontal, const core::rect<s32>& rectangle, | 285 | virtual IGUIScrollBar* addScrollBar(bool horizontal, const core::rect<s32>& rectangle, |
286 | IGUIElement* parent=0, s32 id=-1) = 0; | 286 | IGUIElement* parent=0, s32 id=-1) = 0; |
287 | 287 | ||
288 | //! Adds an image element. | 288 | //! Adds an image element. |
289 | /** \param image Image to be displayed. | 289 | /** \param image Image to be displayed. |
290 | \param pos Position of the image. The width and height of the image is | 290 | \param pos Position of the image. The width and height of the image is |
291 | taken from the image. | 291 | taken from the image. |
292 | \param useAlphaChannel Sets if the image should use the alpha channel | 292 | \param useAlphaChannel Sets if the image should use the alpha channel |
293 | of the texture to draw itself. | 293 | of the texture to draw itself. |
294 | \param parent Parent gui element of the image. | 294 | \param parent Parent gui element of the image. |
295 | \param id Id to identify the gui element. | 295 | \param id Id to identify the gui element. |
296 | \param text Title text of the image. | 296 | \param text Title text of the image. |
297 | \return Pointer to the created image element. Returns 0 if an error | 297 | \return Pointer to the created image element. Returns 0 if an error |
298 | occurred. This pointer should not be dropped. See | 298 | occurred. This pointer should not be dropped. See |
299 | IReferenceCounted::drop() for more information. */ | 299 | IReferenceCounted::drop() for more information. */ |
300 | virtual IGUIImage* addImage(video::ITexture* image, core::position2d<s32> pos, | 300 | virtual IGUIImage* addImage(video::ITexture* image, core::position2d<s32> pos, |
301 | bool useAlphaChannel=true, IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0; | 301 | bool useAlphaChannel=true, IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0; |
302 | 302 | ||
303 | //! Adds an image element. | 303 | //! Adds an image element. |
304 | /** Use IGUIImage::setImage later to set the image to be displayed. | 304 | /** Use IGUIImage::setImage later to set the image to be displayed. |
305 | \param rectangle Rectangle specifying the borders of the image. | 305 | \param rectangle Rectangle specifying the borders of the image. |
306 | \param parent Parent gui element of the image. | 306 | \param parent Parent gui element of the image. |
307 | \param id Id to identify the gui element. | 307 | \param id Id to identify the gui element. |
308 | \param text Title text of the image. | 308 | \param text Title text of the image. |
309 | \param useAlphaChannel Sets if the image should use the alpha channel | 309 | \param useAlphaChannel Sets if the image should use the alpha channel |
310 | of the texture to draw itself. | 310 | of the texture to draw itself. |
311 | \return Pointer to the created image element. Returns 0 if an error | 311 | \return Pointer to the created image element. Returns 0 if an error |
312 | occurred. This pointer should not be dropped. See | 312 | occurred. This pointer should not be dropped. See |
313 | IReferenceCounted::drop() for more information. */ | 313 | IReferenceCounted::drop() for more information. */ |
314 | virtual IGUIImage* addImage(const core::rect<s32>& rectangle, | 314 | virtual IGUIImage* addImage(const core::rect<s32>& rectangle, |
315 | IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0, bool useAlphaChannel=true) = 0; | 315 | IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0, bool useAlphaChannel=true) = 0; |
316 | 316 | ||
317 | //! Adds a checkbox element. | 317 | //! Adds a checkbox element. |
318 | /** \param checked Define the initial state of the check box. | 318 | /** \param checked Define the initial state of the check box. |
319 | \param rectangle Rectangle specifying the borders of the check box. | 319 | \param rectangle Rectangle specifying the borders of the check box. |
320 | \param parent Parent gui element of the check box. | 320 | \param parent Parent gui element of the check box. |
321 | \param id Id to identify the gui element. | 321 | \param id Id to identify the gui element. |
322 | \param text Title text of the check box. | 322 | \param text Title text of the check box. |
323 | \return Pointer to the created check box. Returns 0 if an error | 323 | \return Pointer to the created check box. Returns 0 if an error |
324 | occurred. This pointer should not be dropped. See | 324 | occurred. This pointer should not be dropped. See |
325 | IReferenceCounted::drop() for more information. */ | 325 | IReferenceCounted::drop() for more information. */ |
326 | virtual IGUICheckBox* addCheckBox(bool checked, const core::rect<s32>& rectangle, | 326 | virtual IGUICheckBox* addCheckBox(bool checked, const core::rect<s32>& rectangle, |
327 | IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0; | 327 | IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0; |
328 | 328 | ||
329 | //! Adds a list box element. | 329 | //! Adds a list box element. |
330 | /** \param rectangle Rectangle specifying the borders of the list box. | 330 | /** \param rectangle Rectangle specifying the borders of the list box. |
331 | \param parent Parent gui element of the list box. | 331 | \param parent Parent gui element of the list box. |
332 | \param id Id to identify the gui element. | 332 | \param id Id to identify the gui element. |
333 | \param drawBackground Flag whether the background should be drawn. | 333 | \param drawBackground Flag whether the background should be drawn. |
334 | \return Pointer to the created list box. Returns 0 if an error occurred. | 334 | \return Pointer to the created list box. Returns 0 if an error occurred. |
335 | This pointer should not be dropped. See IReferenceCounted::drop() for | 335 | This pointer should not be dropped. See IReferenceCounted::drop() for |
336 | more information. */ | 336 | more information. */ |
337 | virtual IGUIListBox* addListBox(const core::rect<s32>& rectangle, | 337 | virtual IGUIListBox* addListBox(const core::rect<s32>& rectangle, |
338 | IGUIElement* parent=0, s32 id=-1, bool drawBackground=false) = 0; | 338 | IGUIElement* parent=0, s32 id=-1, bool drawBackground=false) = 0; |
339 | 339 | ||
340 | //! Adds a tree view element. | 340 | //! Adds a tree view element. |
341 | /** \param rectangle Position and dimension of list box. | 341 | /** \param rectangle Position and dimension of list box. |
342 | \param parent Parent gui element of the list box. | 342 | \param parent Parent gui element of the list box. |
343 | \param id Id to identify the gui element. | 343 | \param id Id to identify the gui element. |
344 | \param drawBackground Flag whether the background should be drawn. | 344 | \param drawBackground Flag whether the background should be drawn. |
345 | \param scrollBarVertical Flag whether a vertical scrollbar should be used | 345 | \param scrollBarVertical Flag whether a vertical scrollbar should be used |
346 | \param scrollBarHorizontal Flag whether a horizontal scrollbar should be used | 346 | \param scrollBarHorizontal Flag whether a horizontal scrollbar should be used |
347 | \return Pointer to the created list box. Returns 0 if an error occurred. | 347 | \return Pointer to the created list box. Returns 0 if an error occurred. |
348 | This pointer should not be dropped. See IReferenceCounted::drop() for | 348 | This pointer should not be dropped. See IReferenceCounted::drop() for |
349 | more information. */ | 349 | more information. */ |
350 | virtual IGUITreeView* addTreeView(const core::rect<s32>& rectangle, | 350 | virtual IGUITreeView* addTreeView(const core::rect<s32>& rectangle, |
351 | IGUIElement* parent=0, s32 id=-1, bool drawBackground=false, | 351 | IGUIElement* parent=0, s32 id=-1, bool drawBackground=false, |
352 | bool scrollBarVertical = true, bool scrollBarHorizontal = false) = 0; | 352 | bool scrollBarVertical = true, bool scrollBarHorizontal = false) = 0; |
353 | 353 | ||
354 | //! Adds a mesh viewer. Not 100% implemented yet. | 354 | //! Adds a mesh viewer. Not 100% implemented yet. |
355 | /** \param rectangle Rectangle specifying the borders of the mesh viewer. | 355 | /** \param rectangle Rectangle specifying the borders of the mesh viewer. |
356 | \param parent Parent gui element of the mesh viewer. | 356 | \param parent Parent gui element of the mesh viewer. |
357 | \param id Id to identify the gui element. | 357 | \param id Id to identify the gui element. |
358 | \param text Title text of the mesh viewer. | 358 | \param text Title text of the mesh viewer. |
359 | \return Pointer to the created mesh viewer. Returns 0 if an error | 359 | \return Pointer to the created mesh viewer. Returns 0 if an error |
360 | occurred. This pointer should not be dropped. See | 360 | occurred. This pointer should not be dropped. See |
361 | IReferenceCounted::drop() for more information. */ | 361 | IReferenceCounted::drop() for more information. */ |
362 | virtual IGUIMeshViewer* addMeshViewer(const core::rect<s32>& rectangle, | 362 | virtual IGUIMeshViewer* addMeshViewer(const core::rect<s32>& rectangle, |
363 | IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0; | 363 | IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0; |
364 | 364 | ||
365 | //! Adds a file open dialog. | 365 | //! Adds a file open dialog. |
366 | /** \param title Text to be displayed as the title of the dialog. | 366 | /** \param title Text to be displayed as the title of the dialog. |
367 | \param modal Defines if the dialog is modal. This means, that all other | 367 | \param modal Defines if the dialog is modal. This means, that all other |
368 | gui elements which were created before the message box cannot be used | 368 | gui elements which were created before the message box cannot be used |
369 | until this messagebox is removed. | 369 | until this messagebox is removed. |
370 | \param parent Parent gui element of the dialog. | 370 | \param parent Parent gui element of the dialog. |
371 | \param id Id to identify the gui element. | 371 | \param id Id to identify the gui element. |
372 | \param restoreCWD If set to true, the current workingn directory will be | 372 | \param restoreCWD If set to true, the current workingn directory will be |
373 | restored after the dialog is closed in some way. Otherwise the working | 373 | restored after the dialog is closed in some way. Otherwise the working |
374 | directory will be the one that the file dialog was last showing. | 374 | directory will be the one that the file dialog was last showing. |
375 | \param startDir Optional path for which the file dialog will be opened. | 375 | \param startDir Optional path for which the file dialog will be opened. |
376 | \return Pointer to the created file open dialog. Returns 0 if an error | 376 | \return Pointer to the created file open dialog. Returns 0 if an error |
377 | occurred. This pointer should not be dropped. See | 377 | occurred. This pointer should not be dropped. See |
378 | IReferenceCounted::drop() for more information. */ | 378 | IReferenceCounted::drop() for more information. */ |
379 | virtual IGUIFileOpenDialog* addFileOpenDialog(const wchar_t* title=0, | 379 | virtual IGUIFileOpenDialog* addFileOpenDialog(const wchar_t* title=0, |
380 | bool modal=true, IGUIElement* parent=0, s32 id=-1, | 380 | bool modal=true, IGUIElement* parent=0, s32 id=-1, |
381 | bool restoreCWD=false, io::path::char_type* startDir=0) = 0; | 381 | bool restoreCWD=false, io::path::char_type* startDir=0) = 0; |
382 | 382 | ||
383 | //! Adds a color select dialog. | 383 | //! Adds a color select dialog. |
384 | /** \param title The title of the dialog. | 384 | /** \param title The title of the dialog. |
385 | \param modal Defines if the dialog is modal. This means, that all other | 385 | \param modal Defines if the dialog is modal. This means, that all other |
386 | gui elements which were created before the dialog cannot be used | 386 | gui elements which were created before the dialog cannot be used |
387 | until it is removed. | 387 | until it is removed. |
388 | \param parent The parent of the dialog. | 388 | \param parent The parent of the dialog. |
389 | \param id The ID of the dialog. | 389 | \param id The ID of the dialog. |
390 | \return Pointer to the created file open dialog. Returns 0 if an error | 390 | \return Pointer to the created file open dialog. Returns 0 if an error |
391 | occurred. This pointer should not be dropped. See | 391 | occurred. This pointer should not be dropped. See |
392 | IReferenceCounted::drop() for more information. */ | 392 | IReferenceCounted::drop() for more information. */ |
393 | virtual IGUIColorSelectDialog* addColorSelectDialog(const wchar_t* title = 0, | 393 | virtual IGUIColorSelectDialog* addColorSelectDialog(const wchar_t* title = 0, |
394 | bool modal=true, IGUIElement* parent=0, s32 id=-1) = 0; | 394 | bool modal=true, IGUIElement* parent=0, s32 id=-1) = 0; |
395 | 395 | ||
396 | //! Adds a static text. | 396 | //! Adds a static text. |
397 | /** \param text Text to be displayed. Can be altered after creation by SetText(). | 397 | /** \param text Text to be displayed. Can be altered after creation by SetText(). |
398 | \param rectangle Rectangle specifying the borders of the static text | 398 | \param rectangle Rectangle specifying the borders of the static text |
399 | \param border Set to true if the static text should have a 3d border. | 399 | \param border Set to true if the static text should have a 3d border. |
400 | \param wordWrap Enable if the text should wrap into multiple lines. | 400 | \param wordWrap Enable if the text should wrap into multiple lines. |
401 | \param parent Parent item of the element, e.g. a window. | 401 | \param parent Parent item of the element, e.g. a window. |
402 | \param id The ID of the element. | 402 | \param id The ID of the element. |
403 | \param fillBackground Enable if the background shall be filled. | 403 | \param fillBackground Enable if the background shall be filled. |
404 | Defaults to false. | 404 | Defaults to false. |
405 | \return Pointer to the created static text. Returns 0 if an error | 405 | \return Pointer to the created static text. Returns 0 if an error |
406 | occurred. This pointer should not be dropped. See | 406 | occurred. This pointer should not be dropped. See |
407 | IReferenceCounted::drop() for more information. */ | 407 | IReferenceCounted::drop() for more information. */ |
408 | virtual IGUIStaticText* addStaticText(const wchar_t* text, const core::rect<s32>& rectangle, | 408 | virtual IGUIStaticText* addStaticText(const wchar_t* text, const core::rect<s32>& rectangle, |
409 | bool border=false, bool wordWrap=true, IGUIElement* parent=0, s32 id=-1, | 409 | bool border=false, bool wordWrap=true, IGUIElement* parent=0, s32 id=-1, |
410 | bool fillBackground = false) = 0; | 410 | bool fillBackground = false) = 0; |
411 | 411 | ||
412 | //! Adds an edit box. | 412 | //! Adds an edit box. |
413 | /** Supports unicode input from every keyboard around the world, | 413 | /** Supports unicode input from every keyboard around the world, |
414 | scrolling, copying and pasting (exchanging data with the clipboard | 414 | scrolling, copying and pasting (exchanging data with the clipboard |
415 | directly), maximum character amount, marking, and all shortcuts like | 415 | directly), maximum character amount, marking, and all shortcuts like |
416 | ctrl+X, ctrl+V, ctrl+C, shift+Left, shift+Right, Home, End, and so on. | 416 | ctrl+X, ctrl+V, ctrl+C, shift+Left, shift+Right, Home, End, and so on. |
417 | \param text Text to be displayed. Can be altered after creation | 417 | \param text Text to be displayed. Can be altered after creation |
418 | by setText(). | 418 | by setText(). |
419 | \param rectangle Rectangle specifying the borders of the edit box. | 419 | \param rectangle Rectangle specifying the borders of the edit box. |
420 | \param border Set to true if the edit box should have a 3d border. | 420 | \param border Set to true if the edit box should have a 3d border. |
421 | \param parent Parent item of the element, e.g. a window. | 421 | \param parent Parent item of the element, e.g. a window. |
422 | Set it to 0 to place the edit box directly in the environment. | 422 | Set it to 0 to place the edit box directly in the environment. |
423 | \param id The ID of the element. | 423 | \param id The ID of the element. |
424 | \return Pointer to the created edit box. Returns 0 if an error occurred. | 424 | \return Pointer to the created edit box. Returns 0 if an error occurred. |
425 | This pointer should not be dropped. See IReferenceCounted::drop() for | 425 | This pointer should not be dropped. See IReferenceCounted::drop() for |
426 | more information. */ | 426 | more information. */ |
427 | virtual IGUIEditBox* addEditBox(const wchar_t* text, const core::rect<s32>& rectangle, | 427 | virtual IGUIEditBox* addEditBox(const wchar_t* text, const core::rect<s32>& rectangle, |
428 | bool border=true, IGUIElement* parent=0, s32 id=-1) = 0; | 428 | bool border=true, IGUIElement* parent=0, s32 id=-1) = 0; |
429 | 429 | ||
430 | //! Adds a spin box. | 430 | //! Adds a spin box. |
431 | /** An edit box with up and down buttons | 431 | /** An edit box with up and down buttons |
432 | \param text Text to be displayed. Can be altered after creation by setText(). | 432 | \param text Text to be displayed. Can be altered after creation by setText(). |
433 | \param rectangle Rectangle specifying the borders of the spin box. | 433 | \param rectangle Rectangle specifying the borders of the spin box. |
434 | \param border Set to true if the spin box should have a 3d border. | 434 | \param border Set to true if the spin box should have a 3d border. |
435 | \param parent Parent item of the element, e.g. a window. | 435 | \param parent Parent item of the element, e.g. a window. |
436 | Set it to 0 to place the spin box directly in the environment. | 436 | Set it to 0 to place the spin box directly in the environment. |
437 | \param id The ID of the element. | 437 | \param id The ID of the element. |
438 | \return Pointer to the created spin box. Returns 0 if an error occurred. | 438 | \return Pointer to the created spin box. Returns 0 if an error occurred. |
439 | This pointer should not be dropped. See IReferenceCounted::drop() for | 439 | This pointer should not be dropped. See IReferenceCounted::drop() for |
440 | more information. */ | 440 | more information. */ |
441 | virtual IGUISpinBox* addSpinBox(const wchar_t* text, const core::rect<s32>& rectangle, | 441 | virtual IGUISpinBox* addSpinBox(const wchar_t* text, const core::rect<s32>& rectangle, |
442 | bool border=true,IGUIElement* parent=0, s32 id=-1) = 0; | 442 | bool border=true,IGUIElement* parent=0, s32 id=-1) = 0; |
443 | 443 | ||
444 | //! Adds an element for fading in or out. | 444 | //! Adds an element for fading in or out. |
445 | /** \param rectangle Rectangle specifying the borders of the fader. | 445 | /** \param rectangle Rectangle specifying the borders of the fader. |
446 | If the pointer is NULL, the whole screen is used. | 446 | If the pointer is NULL, the whole screen is used. |
447 | \param parent Parent item of the element, e.g. a window. | 447 | \param parent Parent item of the element, e.g. a window. |
448 | \param id An identifier for the fader. | 448 | \param id An identifier for the fader. |
449 | \return Pointer to the created in-out-fader. Returns 0 if an error | 449 | \return Pointer to the created in-out-fader. Returns 0 if an error |
450 | occurred. This pointer should not be dropped. See | 450 | occurred. This pointer should not be dropped. See |
451 | IReferenceCounted::drop() for more information. */ | 451 | IReferenceCounted::drop() for more information. */ |
452 | virtual IGUIInOutFader* addInOutFader(const core::rect<s32>* rectangle=0, IGUIElement* parent=0, s32 id=-1) = 0; | 452 | virtual IGUIInOutFader* addInOutFader(const core::rect<s32>* rectangle=0, IGUIElement* parent=0, s32 id=-1) = 0; |
453 | 453 | ||
454 | //! Adds a tab control to the environment. | 454 | //! Adds a tab control to the environment. |
455 | /** \param rectangle Rectangle specifying the borders of the tab control. | 455 | /** \param rectangle Rectangle specifying the borders of the tab control. |
456 | \param parent Parent item of the element, e.g. a window. | 456 | \param parent Parent item of the element, e.g. a window. |
457 | Set it to 0 to place the tab control directly in the environment. | 457 | Set it to 0 to place the tab control directly in the environment. |
458 | \param fillbackground Specifies if the background of the tab control | 458 | \param fillbackground Specifies if the background of the tab control |
459 | should be drawn. | 459 | should be drawn. |
460 | \param border Specifies if a flat 3d border should be drawn. This is | 460 | \param border Specifies if a flat 3d border should be drawn. This is |
461 | usually not necessary unless you place the control directly into | 461 | usually not necessary unless you place the control directly into |
462 | the environment without a window as parent. | 462 | the environment without a window as parent. |
463 | \param id An identifier for the tab control. | 463 | \param id An identifier for the tab control. |
464 | \return Pointer to the created tab control element. Returns 0 if an | 464 | \return Pointer to the created tab control element. Returns 0 if an |
465 | error occurred. This pointer should not be dropped. See | 465 | error occurred. This pointer should not be dropped. See |
466 | IReferenceCounted::drop() for more information. */ | 466 | IReferenceCounted::drop() for more information. */ |
467 | virtual IGUITabControl* addTabControl(const core::rect<s32>& rectangle, | 467 | virtual IGUITabControl* addTabControl(const core::rect<s32>& rectangle, |
468 | IGUIElement* parent=0, bool fillbackground=false, | 468 | IGUIElement* parent=0, bool fillbackground=false, |
469 | bool border=true, s32 id=-1) = 0; | 469 | bool border=true, s32 id=-1) = 0; |
470 | 470 | ||
471 | //! Adds tab to the environment. | 471 | //! Adds tab to the environment. |
472 | /** You can use this element to group other elements. This is not used | 472 | /** You can use this element to group other elements. This is not used |
473 | for creating tabs on tab controls, please use IGUITabControl::addTab() | 473 | for creating tabs on tab controls, please use IGUITabControl::addTab() |
474 | for this instead. | 474 | for this instead. |
475 | \param rectangle Rectangle specifying the borders of the tab. | 475 | \param rectangle Rectangle specifying the borders of the tab. |
476 | \param parent Parent item of the element, e.g. a window. | 476 | \param parent Parent item of the element, e.g. a window. |
477 | Set it to 0 to place the tab directly in the environment. | 477 | Set it to 0 to place the tab directly in the environment. |
478 | \param id An identifier for the tab. | 478 | \param id An identifier for the tab. |
479 | \return Pointer to the created tab. Returns 0 if an | 479 | \return Pointer to the created tab. Returns 0 if an |
480 | error occurred. This pointer should not be dropped. See | 480 | error occurred. This pointer should not be dropped. See |
481 | IReferenceCounted::drop() for more information. */ | 481 | IReferenceCounted::drop() for more information. */ |
482 | virtual IGUITab* addTab(const core::rect<s32>& rectangle, | 482 | virtual IGUITab* addTab(const core::rect<s32>& rectangle, |
483 | IGUIElement* parent=0, s32 id=-1) = 0; | 483 | IGUIElement* parent=0, s32 id=-1) = 0; |
484 | 484 | ||
485 | //! Adds a context menu to the environment. | 485 | //! Adds a context menu to the environment. |
486 | /** \param rectangle Rectangle specifying the borders of the menu. | 486 | /** \param rectangle Rectangle specifying the borders of the menu. |
487 | Note that the menu is resizing itself based on what items you add. | 487 | Note that the menu is resizing itself based on what items you add. |
488 | \param parent Parent item of the element, e.g. a window. | 488 | \param parent Parent item of the element, e.g. a window. |
489 | Set it to 0 to place the menu directly in the environment. | 489 | Set it to 0 to place the menu directly in the environment. |
490 | \param id An identifier for the menu. | 490 | \param id An identifier for the menu. |
491 | \return Pointer to the created context menu. Returns 0 if an | 491 | \return Pointer to the created context menu. Returns 0 if an |
492 | error occurred. This pointer should not be dropped. See | 492 | error occurred. This pointer should not be dropped. See |
493 | IReferenceCounted::drop() for more information. */ | 493 | IReferenceCounted::drop() for more information. */ |
494 | virtual IGUIContextMenu* addContextMenu(const core::rect<s32>& rectangle, | 494 | virtual IGUIContextMenu* addContextMenu(const core::rect<s32>& rectangle, |
495 | IGUIElement* parent=0, s32 id=-1) = 0; | 495 | IGUIElement* parent=0, s32 id=-1) = 0; |
496 | 496 | ||
497 | //! Adds a menu to the environment. | 497 | //! Adds a menu to the environment. |
498 | /** This is like the menu you can find on top of most windows in modern | 498 | /** This is like the menu you can find on top of most windows in modern |
499 | graphical user interfaces. | 499 | graphical user interfaces. |
500 | \param parent Parent item of the element, e.g. a window. | 500 | \param parent Parent item of the element, e.g. a window. |
501 | Set it to 0 to place the menu directly in the environment. | 501 | Set it to 0 to place the menu directly in the environment. |
502 | \param id An identifier for the menu. | 502 | \param id An identifier for the menu. |
503 | \return Pointer to the created menu. Returns 0 if an | 503 | \return Pointer to the created menu. Returns 0 if an |
504 | error occurred. This pointer should not be dropped. See | 504 | error occurred. This pointer should not be dropped. See |
505 | IReferenceCounted::drop() for more information. */ | 505 | IReferenceCounted::drop() for more information. */ |
506 | virtual IGUIContextMenu* addMenu(IGUIElement* parent=0, s32 id=-1) = 0; | 506 | virtual IGUIContextMenu* addMenu(IGUIElement* parent=0, s32 id=-1) = 0; |
507 | 507 | ||
508 | //! Adds a toolbar to the environment. | 508 | //! Adds a toolbar to the environment. |
509 | /** It is like a menu that is always placed on top of its parent, and | 509 | /** It is like a menu that is always placed on top of its parent, and |
510 | contains buttons. | 510 | contains buttons. |
511 | \param parent Parent item of the element, e.g. a window. | 511 | \param parent Parent item of the element, e.g. a window. |
512 | Set it to 0 to place the tool bar directly in the environment. | 512 | Set it to 0 to place the tool bar directly in the environment. |
513 | \param id An identifier for the tool bar. | 513 | \param id An identifier for the tool bar. |
514 | \return Pointer to the created tool bar. Returns 0 if an | 514 | \return Pointer to the created tool bar. Returns 0 if an |
515 | error occurred. This pointer should not be dropped. See | 515 | error occurred. This pointer should not be dropped. See |
516 | IReferenceCounted::drop() for more information. */ | 516 | IReferenceCounted::drop() for more information. */ |
517 | virtual IGUIToolBar* addToolBar(IGUIElement* parent=0, s32 id=-1) = 0; | 517 | virtual IGUIToolBar* addToolBar(IGUIElement* parent=0, s32 id=-1) = 0; |
518 | 518 | ||
519 | //! Adds a combo box to the environment. | 519 | //! Adds a combo box to the environment. |
520 | /** \param rectangle Rectangle specifying the borders of the combo box. | 520 | /** \param rectangle Rectangle specifying the borders of the combo box. |
521 | \param parent Parent item of the element, e.g. a window. | 521 | \param parent Parent item of the element, e.g. a window. |
522 | Set it to 0 to place the combo box directly in the environment. | 522 | Set it to 0 to place the combo box directly in the environment. |
523 | \param id An identifier for the combo box. | 523 | \param id An identifier for the combo box. |
524 | \return Pointer to the created combo box. Returns 0 if an | 524 | \return Pointer to the created combo box. Returns 0 if an |
525 | error occurred. This pointer should not be dropped. See | 525 | error occurred. This pointer should not be dropped. See |
526 | IReferenceCounted::drop() for more information. */ | 526 | IReferenceCounted::drop() for more information. */ |
527 | virtual IGUIComboBox* addComboBox(const core::rect<s32>& rectangle, | 527 | virtual IGUIComboBox* addComboBox(const core::rect<s32>& rectangle, |
528 | IGUIElement* parent=0, s32 id=-1) = 0; | 528 | IGUIElement* parent=0, s32 id=-1) = 0; |
529 | 529 | ||
530 | //! Adds a table to the environment | 530 | //! Adds a table to the environment |
531 | /** \param rectangle Rectangle specifying the borders of the table. | 531 | /** \param rectangle Rectangle specifying the borders of the table. |
532 | \param parent Parent item of the element, e.g. a window. Set it to 0 | 532 | \param parent Parent item of the element, e.g. a window. Set it to 0 |
533 | to place the element directly in the environment. | 533 | to place the element directly in the environment. |
534 | \param id An identifier for the table. | 534 | \param id An identifier for the table. |
535 | \param drawBackground Flag whether the background should be drawn. | 535 | \param drawBackground Flag whether the background should be drawn. |
536 | \return Pointer to the created table. Returns 0 if an error occurred. | 536 | \return Pointer to the created table. Returns 0 if an error occurred. |
537 | This pointer should not be dropped. See IReferenceCounted::drop() for | 537 | This pointer should not be dropped. See IReferenceCounted::drop() for |
538 | more information. */ | 538 | more information. */ |
539 | virtual IGUITable* addTable(const core::rect<s32>& rectangle, | 539 | virtual IGUITable* addTable(const core::rect<s32>& rectangle, |
540 | IGUIElement* parent=0, s32 id=-1, bool drawBackground=false) =0; | 540 | IGUIElement* parent=0, s32 id=-1, bool drawBackground=false) =0; |
541 | 541 | ||
542 | //! Get the default element factory which can create all built-in elements | 542 | //! Get the default element factory which can create all built-in elements |
543 | /** \return Pointer to the factory. | 543 | /** \return Pointer to the factory. |
544 | This pointer should not be dropped. See IReferenceCounted::drop() for | 544 | This pointer should not be dropped. See IReferenceCounted::drop() for |
545 | more information. */ | 545 | more information. */ |
546 | virtual IGUIElementFactory* getDefaultGUIElementFactory() const = 0; | 546 | virtual IGUIElementFactory* getDefaultGUIElementFactory() const = 0; |
547 | 547 | ||
548 | //! Adds an element factory to the gui environment. | 548 | //! Adds an element factory to the gui environment. |
549 | /** Use this to extend the gui environment with new element types which | 549 | /** Use this to extend the gui environment with new element types which |
550 | it should be able to create automatically, for example when loading | 550 | it should be able to create automatically, for example when loading |
551 | data from xml files. | 551 | data from xml files. |
552 | \param factoryToAdd Pointer to new factory. */ | 552 | \param factoryToAdd Pointer to new factory. */ |
553 | virtual void registerGUIElementFactory(IGUIElementFactory* factoryToAdd) = 0; | 553 | virtual void registerGUIElementFactory(IGUIElementFactory* factoryToAdd) = 0; |
554 | 554 | ||
555 | //! Get amount of registered gui element factories. | 555 | //! Get amount of registered gui element factories. |
556 | /** \return Amount of registered gui element factories. */ | 556 | /** \return Amount of registered gui element factories. */ |
557 | virtual u32 getRegisteredGUIElementFactoryCount() const = 0; | 557 | virtual u32 getRegisteredGUIElementFactoryCount() const = 0; |
558 | 558 | ||
559 | //! Get a gui element factory by index | 559 | //! Get a gui element factory by index |
560 | /** \param index Index of the factory. | 560 | /** \param index Index of the factory. |
561 | \return Factory at given index, or 0 if no such factory exists. */ | 561 | \return Factory at given index, or 0 if no such factory exists. */ |
562 | virtual IGUIElementFactory* getGUIElementFactory(u32 index) const = 0; | 562 | virtual IGUIElementFactory* getGUIElementFactory(u32 index) const = 0; |
563 | 563 | ||
564 | //! Adds a GUI element by its name | 564 | //! Adds a GUI element by its name |
565 | /** Each factory is checked if it can create an element of the given | 565 | /** Each factory is checked if it can create an element of the given |
566 | name. The first match will be created. | 566 | name. The first match will be created. |
567 | \param elementName Name of the element to be created. | 567 | \param elementName Name of the element to be created. |
568 | \param parent Parent of the new element, if not 0. | 568 | \param parent Parent of the new element, if not 0. |
569 | \return New GUI element, or 0 if no such element exists. */ | 569 | \return New GUI element, or 0 if no such element exists. */ |
570 | virtual IGUIElement* addGUIElement(const c8* elementName, IGUIElement* parent=0) = 0; | 570 | virtual IGUIElement* addGUIElement(const c8* elementName, IGUIElement* parent=0) = 0; |
571 | 571 | ||
572 | //! Saves the current gui into a file. | 572 | //! Saves the current gui into a file. |
573 | /** \param filename Name of the file. | 573 | /** \param filename Name of the file. |
574 | \param start The GUIElement to start with. Root if 0. | 574 | \param start The GUIElement to start with. Root if 0. |
575 | \return True if saving succeeded, else false. */ | 575 | \return True if saving succeeded, else false. */ |
576 | virtual bool saveGUI(const io::path& filename, IGUIElement* start=0) = 0; | 576 | virtual bool saveGUI(const io::path& filename, IGUIElement* start=0) = 0; |
577 | 577 | ||
578 | //! Saves the current gui into a file. | 578 | //! Saves the current gui into a file. |
579 | /** \param file The file to write to. | 579 | /** \param file The file to write to. |
580 | \param start The GUIElement to start with. Root if 0. | 580 | \param start The GUIElement to start with. Root if 0. |
581 | \return True if saving succeeded, else false. */ | 581 | \return True if saving succeeded, else false. */ |
582 | virtual bool saveGUI(io::IWriteFile* file, IGUIElement* start=0) = 0; | 582 | virtual bool saveGUI(io::IWriteFile* file, IGUIElement* start=0) = 0; |
583 | 583 | ||
584 | //! Loads the gui. Note that the current gui is not cleared before. | 584 | //! Loads the gui. Note that the current gui is not cleared before. |
585 | /** When a parent is set the elements will be added below the parent, the parent itself does not deserialize. | 585 | /** When a parent is set the elements will be added below the parent, the parent itself does not deserialize. |
586 | When the file contains skin-settings from the gui-environment those are always serialized into the | 586 | When the file contains skin-settings from the gui-environment those are always serialized into the |
587 | guienvironment independent of the parent setting. | 587 | guienvironment independent of the parent setting. |
588 | \param filename Name of the file. | 588 | \param filename Name of the file. |
589 | \param parent Parent for the loaded GUI, root if 0. | 589 | \param parent Parent for the loaded GUI, root if 0. |
590 | \return True if loading succeeded, else false. */ | 590 | \return True if loading succeeded, else false. */ |
591 | virtual bool loadGUI(const io::path& filename, IGUIElement* parent=0) = 0; | 591 | virtual bool loadGUI(const io::path& filename, IGUIElement* parent=0) = 0; |
592 | 592 | ||
593 | //! Loads the gui. Note that the current gui is not cleared before. | 593 | //! Loads the gui. Note that the current gui is not cleared before. |
594 | /** When a parent is set the elements will be added below the parent, the parent itself does not deserialize. | 594 | /** When a parent is set the elements will be added below the parent, the parent itself does not deserialize. |
595 | When the file contains skin-settings from the gui-environment those are always serialized into the | 595 | When the file contains skin-settings from the gui-environment those are always serialized into the |
596 | guienvironment independent of the parent setting. | 596 | guienvironment independent of the parent setting. |
597 | \param file The file to load from. | 597 | \param file The file to load from. |
598 | \param parent Parent for the loaded GUI, root if 0. | 598 | \param parent Parent for the loaded GUI, root if 0. |
599 | \return True if loading succeeded, else false. */ | 599 | \return True if loading succeeded, else false. */ |
600 | virtual bool loadGUI(io::IReadFile* file, IGUIElement* parent=0) = 0; | 600 | virtual bool loadGUI(io::IReadFile* file, IGUIElement* parent=0) = 0; |
601 | 601 | ||
602 | //! Writes attributes of the gui environment | 602 | //! Writes attributes of the gui environment |
603 | virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const =0; | 603 | virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const =0; |
604 | 604 | ||
605 | //! Reads attributes of the gui environment | 605 | //! Reads attributes of the gui environment |
606 | virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)=0; | 606 | virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)=0; |
607 | 607 | ||
608 | //! writes an element | 608 | //! writes an element |
609 | virtual void writeGUIElement(io::IXMLWriter* writer, IGUIElement* node) =0; | 609 | virtual void writeGUIElement(io::IXMLWriter* writer, IGUIElement* node) =0; |
610 | 610 | ||
611 | //! reads an element | 611 | //! reads an element |
612 | virtual void readGUIElement(io::IXMLReader* reader, IGUIElement* node) =0; | 612 | virtual void readGUIElement(io::IXMLReader* reader, IGUIElement* node) =0; |
613 | }; | 613 | }; |
614 | 614 | ||
615 | 615 | ||
616 | } // end namespace gui | 616 | } // end namespace gui |
617 | } // end namespace irr | 617 | } // end namespace irr |
618 | 618 | ||
619 | #endif | 619 | #endif |
620 | 620 | ||