Irrlicht 3D Engine
 
Loading...
Searching...
No Matches
IGUITreeView.h
Go to the documentation of this file.
1// written by Reinhard Ostermeier, reinhard@nospam.r-ostermeier.de
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_TREE_VIEW_H_INCLUDED__
6#define __I_GUI_TREE_VIEW_H_INCLUDED__
7
8#include "IGUIElement.h"
9#include "IGUIImageList.h"
10#include "irrTypes.h"
11
12namespace irr
13{
14namespace gui
15{
16 class IGUIFont;
17 class IGUITreeView;
18
19
21
28 {
29 public:
31 virtual IGUITreeView* getOwner() const = 0;
32
34
35 virtual IGUITreeViewNode* getParent() const = 0;
36
38 virtual const wchar_t* getText() const = 0;
39
41 virtual void setText( const wchar_t* text ) = 0;
42
44 virtual const wchar_t* getIcon() const = 0;
45
47 virtual void setIcon( const wchar_t* icon ) = 0;
48
50 virtual u32 getImageIndex() const = 0;
51
53 virtual void setImageIndex( u32 imageIndex ) = 0;
54
56 virtual u32 getSelectedImageIndex() const = 0;
57
59 virtual void setSelectedImageIndex( u32 imageIndex ) = 0;
60
62 virtual void* getData() const = 0;
63
65 virtual void setData( void* data ) = 0;
66
68 virtual IReferenceCounted* getData2() const = 0;
69
71 virtual void setData2( IReferenceCounted* data ) = 0;
72
74 virtual u32 getChildCount() const = 0;
75
77 virtual void clearChildren() = 0;
78
80
83 {
84 return clearChildren();
85 }
86
88 virtual bool hasChildren() const = 0;
89
91
94 {
95 return hasChildren();
96 }
97
99
108 const wchar_t* text, const wchar_t* icon = 0,
109 s32 imageIndex=-1, s32 selectedImageIndex=-1,
110 void* data=0, IReferenceCounted* data2=0) =0;
111
113
122 const wchar_t* text, const wchar_t* icon = 0,
123 s32 imageIndex=-1, s32 selectedImageIndex=-1,
124 void* data=0, IReferenceCounted* data2=0 ) =0;
125
127
138 IGUITreeViewNode* other,
139 const wchar_t* text, const wchar_t* icon = 0,
140 s32 imageIndex=-1, s32 selectedImageIndex=-1,
141 void* data=0, IReferenceCounted* data2=0) =0;
142
144
155 IGUITreeViewNode* other,
156 const wchar_t* text, const wchar_t* icon = 0,
157 s32 imageIndex=-1, s32 selectedImageIndex=-1,
158 void* data=0, IReferenceCounted* data2=0) = 0;
159
161
162 virtual IGUITreeViewNode* getFirstChild() const = 0;
163
165
166 virtual IGUITreeViewNode* getLastChild() const = 0;
167
169
172 virtual IGUITreeViewNode* getPrevSibling() const = 0;
173
175
178 virtual IGUITreeViewNode* getNextSibling() const = 0;
179
181
183 virtual IGUITreeViewNode* getNextVisible() const = 0;
184
186
187 virtual bool deleteChild( IGUITreeViewNode* child ) = 0;
188
190
191 virtual bool moveChildUp( IGUITreeViewNode* child ) = 0;
192
194
195 virtual bool moveChildDown( IGUITreeViewNode* child ) = 0;
196
198 virtual bool getExpanded() const = 0;
199
201 virtual void setExpanded( bool expanded ) = 0;
202
204 virtual bool getSelected() const = 0;
205
207 virtual void setSelected( bool selected ) = 0;
208
210 virtual bool isRoot() const = 0;
211
213
214 virtual s32 getLevel() const = 0;
215
217 virtual bool isVisible() const = 0;
218 };
219
220
222
226 {
227 public:
230 s32 id, core::rect<s32> rectangle)
231 : IGUIElement( EGUIET_TREE_VIEW, environment, parent, id, rectangle ) {}
232
234 virtual IGUITreeViewNode* getRoot() const = 0;
235
237 virtual IGUITreeViewNode* getSelected() const = 0;
238
240 virtual bool getLinesVisible() const = 0;
241
243
244 virtual void setLinesVisible( bool visible ) = 0;
245
247
253 virtual void setIconFont( IGUIFont* font ) = 0;
254
256
257 virtual void setImageList( IGUIImageList* imageList ) = 0;
258
260 virtual IGUIImageList* getImageList() const = 0;
261
263 virtual void setImageLeftOfIcon( bool bLeftOf ) = 0;
264
266 virtual bool getImageLeftOfIcon() const = 0;
267
269
270 virtual IGUITreeViewNode* getLastEventNode() const = 0;
271 };
272
273
274} // end namespace gui
275} // end namespace irr
276
277#endif
278
Base class of most objects of the Irrlicht Engine.
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.h:22
Base class of all GUI elements.
Definition IGUIElement.h:26
GUI Environment. Used as factory and manager of all other GUI elements.
Font interface.
Definition IGUIFont.h:40
Default tree view GUI element.
virtual void setIconFont(IGUIFont *font)=0
Sets the font which should be used as icon font.
virtual IGUITreeViewNode * getLastEventNode() const =0
Returns the node which is associated to the last event.
virtual bool getImageLeftOfIcon() const =0
Returns if the Image is left of the icon. Default is true.
IGUITreeView(IGUIEnvironment *environment, IGUIElement *parent, s32 id, core::rect< s32 > rectangle)
constructor
virtual bool getLinesVisible() const =0
returns true if the tree lines are visible
virtual void setLinesVisible(bool visible)=0
sets if the tree lines are visible
virtual IGUIImageList * getImageList() const =0
Returns the image list which is used for the nodes.
virtual void setImageList(IGUIImageList *imageList)=0
Sets the image list which should be used for the image and selected image of every node.
virtual IGUITreeViewNode * getRoot() const =0
returns the root node (not visible) from the tree.
virtual IGUITreeViewNode * getSelected() const =0
returns the selected node of the tree or 0 if none is selected
virtual void setImageLeftOfIcon(bool bLeftOf)=0
Sets if the image is left of the icon. Default is true.
Node for gui tree view.
virtual void clearChildren()=0
removes all children (recursive) from this node
virtual void setIcon(const wchar_t *icon)=0
sets the icon text of the node
virtual bool getExpanded() const =0
Returns true if the node is expanded (children are visible).
virtual void setExpanded(bool expanded)=0
Sets if the node is expanded.
virtual void setSelectedImageIndex(u32 imageIndex)=0
sets the image index of the node
virtual bool deleteChild(IGUITreeViewNode *child)=0
Deletes a child node.
virtual void setData(void *data)=0
sets the user data (void*) of this node
virtual u32 getImageIndex() const =0
returns the image index of the node
virtual bool moveChildDown(IGUITreeViewNode *child)=0
Moves a child node one position down.
virtual IGUITreeViewNode * getPrevSibling() const =0
Returns the previous sibling node from this node.
virtual IReferenceCounted * getData2() const =0
returns the user data2 (IReferenceCounted) of this node
virtual IGUITreeViewNode * addChildFront(const wchar_t *text, const wchar_t *icon=0, s32 imageIndex=-1, s32 selectedImageIndex=-1, void *data=0, IReferenceCounted *data2=0)=0
Adds a new node before the first child node.
virtual IGUITreeView * getOwner() const =0
returns the owner (tree view) of this node
virtual void setText(const wchar_t *text)=0
sets the text of the node
virtual bool hasChildren() const =0
returns true if this node has child nodes
virtual const wchar_t * getText() const =0
returns the text of the node
_IRR_DEPRECATED_ void clearChilds()
removes all children (recursive) from this node
virtual IGUITreeViewNode * getParent() const =0
Returns the parent node of this node.
virtual u32 getSelectedImageIndex() const =0
returns the image index of the node
virtual IGUITreeViewNode * getLastChild() const =0
Return the last child node from this node.
virtual IGUITreeViewNode * insertChildBefore(IGUITreeViewNode *other, const wchar_t *text, const wchar_t *icon=0, s32 imageIndex=-1, s32 selectedImageIndex=-1, void *data=0, IReferenceCounted *data2=0)=0
Adds a new node before the other node.
_IRR_DEPRECATED_ bool hasChilds() const
returns true if this node has child nodes
virtual void setImageIndex(u32 imageIndex)=0
sets the image index of the node
virtual IGUITreeViewNode * getNextSibling() const =0
Returns the next sibling node from this node.
virtual bool isVisible() const =0
Returns true if this node is visible (all parents are expanded).
virtual u32 getChildCount() const =0
returns the child item count
virtual bool isRoot() const =0
Returns true if this node is the root node.
virtual IGUITreeViewNode * insertChildAfter(IGUITreeViewNode *other, const wchar_t *text, const wchar_t *icon=0, s32 imageIndex=-1, s32 selectedImageIndex=-1, void *data=0, IReferenceCounted *data2=0)=0
Adds a new node behind the other node.
virtual bool moveChildUp(IGUITreeViewNode *child)=0
Moves a child node one position up.
virtual bool getSelected() const =0
Returns true if the node is currently selected.
virtual s32 getLevel() const =0
Returns the level of this node.
virtual const wchar_t * getIcon() const =0
returns the icon text of the node
virtual void setData2(IReferenceCounted *data)=0
sets the user data2 (IReferenceCounted) of this node
virtual void setSelected(bool selected)=0
Sets this node as selected.
virtual void * getData() const =0
returns the user data (void*) of this node
virtual IGUITreeViewNode * addChildBack(const wchar_t *text, const wchar_t *icon=0, s32 imageIndex=-1, s32 selectedImageIndex=-1, void *data=0, IReferenceCounted *data2=0)=0
Adds a new node behind the last child node.
virtual IGUITreeViewNode * getFirstChild() const =0
Return the first child node from this node.
virtual IGUITreeViewNode * getNextVisible() const =0
Returns the next visible (expanded, may be out of scrolling) node from this node.
#define _IRR_DEPRECATED_
Defines a deprecated macro which generates a warning at compile time.
Definition irrTypes.h:195
@ EGUIET_TREE_VIEW
A Tree View.
Everything in the Irrlicht Engine can be found in this namespace.
Definition aabbox3d.h:13
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.h:58
signed int s32
32 bit signed variable.
Definition irrTypes.h:66