arsa  2.7
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 
12 namespace irr
13 {
14 namespace gui
15 {
16  class IGUIFont;
17  class IGUITreeView;
18  class IGUIScrollBar;
19 
20 
22 
29  {
30  public:
32  virtual IGUITreeView* getOwner() const = 0;
33 
35 
36  virtual IGUITreeViewNode* getParent() const = 0;
37 
39  virtual const wchar_t* getText() const = 0;
40 
42  virtual void setText( const wchar_t* text ) = 0;
43 
45  virtual const wchar_t* getIcon() const = 0;
46 
48  virtual void setIcon( const wchar_t* icon ) = 0;
49 
51  virtual u32 getImageIndex() const = 0;
52 
54  virtual void setImageIndex( u32 imageIndex ) = 0;
55 
57  virtual u32 getSelectedImageIndex() const = 0;
58 
60  virtual void setSelectedImageIndex( u32 imageIndex ) = 0;
61 
63  virtual void* getData() const = 0;
64 
66  virtual void setData( void* data ) = 0;
67 
69  virtual IReferenceCounted* getData2() const = 0;
70 
72  virtual void setData2( IReferenceCounted* data ) = 0;
73 
75  virtual u32 getChildCount() const = 0;
76 
78  virtual void clearChildren() = 0;
79 
81 
84  {
85  return clearChildren();
86  }
87 
89  virtual bool hasChildren() const = 0;
90 
92 
95  {
96  return hasChildren();
97  }
98 
100 
109  const wchar_t* text, const wchar_t* icon = 0,
110  s32 imageIndex=-1, s32 selectedImageIndex=-1,
111  void* data=0, IReferenceCounted* data2=0) =0;
112 
114 
123  const wchar_t* text, const wchar_t* icon = 0,
124  s32 imageIndex=-1, s32 selectedImageIndex=-1,
125  void* data=0, IReferenceCounted* data2=0 ) =0;
126 
128 
139  IGUITreeViewNode* other,
140  const wchar_t* text, const wchar_t* icon = 0,
141  s32 imageIndex=-1, s32 selectedImageIndex=-1,
142  void* data=0, IReferenceCounted* data2=0) =0;
143 
145 
156  IGUITreeViewNode* other,
157  const wchar_t* text, const wchar_t* icon = 0,
158  s32 imageIndex=-1, s32 selectedImageIndex=-1,
159  void* data=0, IReferenceCounted* data2=0) = 0;
160 
162 
163  virtual IGUITreeViewNode* getFirstChild() const = 0;
164 
166 
167  virtual IGUITreeViewNode* getLastChild() const = 0;
168 
170 
173  virtual IGUITreeViewNode* getPrevSibling() const = 0;
174 
176 
179  virtual IGUITreeViewNode* getNextSibling() const = 0;
180 
182 
184  virtual IGUITreeViewNode* getNextVisible() const = 0;
185 
187 
188  virtual bool deleteChild( IGUITreeViewNode* child ) = 0;
189 
191 
192  virtual bool moveChildUp( IGUITreeViewNode* child ) = 0;
193 
195 
196  virtual bool moveChildDown( IGUITreeViewNode* child ) = 0;
197 
199  virtual bool getExpanded() const = 0;
200 
202  virtual void setExpanded( bool expanded ) = 0;
203 
205  virtual bool getSelected() const = 0;
206 
208  virtual void setSelected( bool selected ) = 0;
209 
211  virtual bool isRoot() const = 0;
212 
214 
215  virtual s32 getLevel() const = 0;
216 
218  virtual bool isVisible() const = 0;
219  };
220 
221 
223 
226  class IGUITreeView : public IGUIElement
227  {
228  public:
230  IGUITreeView(IGUIEnvironment* environment, IGUIElement* parent,
231  s32 id, core::rect<s32> rectangle)
232  : IGUIElement( EGUIET_TREE_VIEW, environment, parent, id, rectangle ) {}
233 
235  virtual IGUITreeViewNode* getRoot() const = 0;
236 
238  virtual IGUITreeViewNode* getSelected() const = 0;
239 
241  virtual bool getLinesVisible() const = 0;
242 
244 
245  virtual void setLinesVisible( bool visible ) = 0;
246 
248 
254  virtual void setIconFont( IGUIFont* font ) = 0;
255 
257 
258  virtual void setOverrideFont(IGUIFont* font=0) = 0;
259 
261 
262  virtual IGUIFont* getOverrideFont(void) const = 0;
263 
265 
267  virtual IGUIFont* getActiveFont() const = 0;
268 
270 
271  virtual void setImageList( IGUIImageList* imageList ) = 0;
272 
274  virtual IGUIImageList* getImageList() const = 0;
275 
277  virtual void setImageLeftOfIcon( bool bLeftOf ) = 0;
278 
280  virtual bool getImageLeftOfIcon() const = 0;
281 
283 
284  virtual IGUITreeViewNode* getLastEventNode() const = 0;
285 
287  virtual IGUIScrollBar* getVerticalScrollBar() const = 0;
288 
290  virtual IGUIScrollBar* getHorizontalScrollBar() const = 0;
291  };
292 
293 
294 } // end namespace gui
295 } // end namespace irr
296 
297 #endif
298 
virtual IGUIScrollBar * getHorizontalScrollBar() const =0
Access the horizontal scrollbar.
virtual IReferenceCounted * getData2() const =0
returns the user data2 (IReferenceCounted) of this node
GLuint id
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 void setImageList(IGUIImageList *imageList)=0
Sets the image list which should be used for the image and selected image of every node.
virtual void setSelectedImageIndex(u32 imageIndex)=0
sets the image index of the node
#define _IRR_DEPRECATED_
Defines a deprecated macro which generates a warning at compile time.
Definition: irrTypes.h:202
virtual bool isVisible() const =0
Returns true if this node is visible (all parents are expanded).
virtual IGUITreeViewNode * getFirstChild() const =0
Return the first child node from this node.
virtual void setData2(IReferenceCounted *data)=0
sets the user data2 (IReferenceCounted) of this node
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974
virtual u32 getSelectedImageIndex() const =0
returns the image index of the node
virtual void setIcon(const wchar_t *icon)=0
sets the icon text of the node
virtual IGUITreeViewNode * getSelected() const =0
returns the selected node of the tree or 0 if none is selected
virtual bool getExpanded() const =0
Returns true if the node is expanded (children are visible).
virtual bool moveChildUp(IGUITreeViewNode *child)=0
Moves a child node one position up.
virtual IGUITreeViewNode * getNextVisible() const =0
Returns the next visible (expanded, may be out of scrolling) 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.
virtual s32 getLevel() const =0
Returns the level of this node.
Everything in the Irrlicht Engine can be found in this namespace.
Definition: CARSADPad.h:6
virtual IGUITreeViewNode * getRoot() const =0
returns the root node (not visible) from the tree.
virtual IGUIScrollBar * getVerticalScrollBar() const =0
Access the vertical scrollbar.
GUI Environment. Used as factory and manager of all other GUI elements.
virtual IGUIImageList * getImageList() const =0
Returns the image list which is used for the nodes.
virtual IGUIFont * getOverrideFont(void) const =0
Gets the override font (if any)
virtual IGUIFont * getActiveFont() const =0
Get the font which is used for drawing.
virtual void setLinesVisible(bool visible)=0
sets if the tree lines are visible
virtual const wchar_t * getText() const =0
returns the text of the node
virtual void setSelected(bool selected)=0
Sets this node as selected.
Font interface.
Definition: IGUIFont.h:39
signed int s32
32 bit signed variable.
Definition: irrTypes.h:70
virtual IGUITreeViewNode * getLastEventNode() const =0
Returns the node which is associated to the last event.
Default scroll bar GUI element.
Definition: IGUIScrollBar.h:19
virtual void setIconFont(IGUIFont *font)=0
Sets the font which should be used as icon font.
virtual const wchar_t * getIcon() const =0
returns the icon text of the node
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
virtual void clearChildren()=0
removes all children (recursive) from this node
virtual bool deleteChild(IGUITreeViewNode *child)=0
Deletes a child 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.
_IRR_DEPRECATED_ bool hasChilds() const
returns true if this node has child nodes
Definition: IGUITreeView.h:94
virtual IGUITreeViewNode * getNextSibling() const =0
Returns the next sibling node from this node.
virtual void setData(void *data)=0
sets the user data (void*) of this node
Base class of all GUI elements.
Definition: IGUIElement.h:23
virtual void setImageIndex(u32 imageIndex)=0
sets the image index of the node
virtual IGUITreeViewNode * getLastChild() const =0
Return the last child node from this node.
virtual void setOverrideFont(IGUIFont *font=0)=0
Sets a skin independent font.
virtual bool getSelected() const =0
Returns true if the node is currently selected.
virtual u32 getChildCount() const =0
returns the child item count
Node for gui tree view.
Definition: IGUITreeView.h:28
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 void * getData() const =0
returns the user data (void*) of this node
virtual IGUITreeViewNode * getPrevSibling() const =0
Returns the previous sibling node from this node.
Base class of most objects of the Irrlicht Engine.
virtual IGUITreeView * getOwner() const =0
returns the owner (tree view) of this node
virtual IGUITreeViewNode * getParent() const =0
Returns the parent node of this node.
virtual void setImageLeftOfIcon(bool bLeftOf)=0
Sets if the image is left of the icon. Default is true.
virtual bool isRoot() const =0
Returns true if this node is the root node.
virtual bool getLinesVisible() const =0
returns true if the tree lines are visible
Default tree view GUI element.
Definition: IGUITreeView.h:226
virtual void setText(const wchar_t *text)=0
sets the text of the node
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
Definition: IGUITreeView.h:230
_IRR_DEPRECATED_ void clearChilds()
removes all children (recursive) from this node
Definition: IGUITreeView.h:83
virtual u32 getImageIndex() const =0
returns the image index of the node
virtual bool hasChildren() const =0
returns true if this node has child nodes
virtual void setExpanded(bool expanded)=0
Sets if the node is expanded.
virtual bool moveChildDown(IGUITreeViewNode *child)=0
Moves a child node one position down.