ToolMap
Loading...
Searching...
No Matches
TreeMultiItemNode.h
1//---------------------------------------------------------------------------
2// $RCSfile$
3// $Source$
4// $Revision$
5// $Date$
6//---------------------------------------------------------------------------
7// Author: Jorgen Bodde
8// Copyright: (c) Jorgen Bodde
9// License: wxWidgets License
10//---------------------------------------------------------------------------
11
12#ifndef __TREEMULTIITEMNODE_HPP_
13#define __TREEMULTIITEMNODE_HPP_
14
15#ifdef __GNUG__
16#pragma interface "TreeMultiItemNode.cpp"
17#endif
18
19#ifndef WX_PRECOMP
20#include <wx/wx.h>
21#endif
22#include <wx/dynarray.h>
23
24#include "TreeMultiItemBase.h"
25#include "TreeMultiItemWindow.h"
26#include "wx/treebase.h"
27
37// declare the array class here
38
39WX_DECLARE_OBJARRAY(TreeMultiItemBase, TreeMultiItemBaseArray);
40
42 private:
43 TreeMultiItemBaseArray _items;
44
46 wxString _caption;
47
49 bool _nodeExpanded;
50
52 // wxTreeItemAttr m_Attributes;
53
54 public:
55 TreeMultiItemNode(TreeMultiItemNode* parent, const wxString& caption = wxEmptyString,
56 const wxString& name = wxEmptyString);
57
58 virtual ~TreeMultiItemNode();
59
60 // isClass method
62 return (TreeMultiItemNode*)this;
63 };
64
65 // add methods
66 void AddNode(TreeMultiItemBase* node);
67
68 void InsertNode(TreeMultiItemBase* NodePtr, size_t Position);
69
70 // delete methods
71 void Clear();
72
73 void DeleteNode(TreeMultiItemBase* node);
74
75 void DeleteNode(int index);
76
77 TreeMultiItemBase* RemoveNode(TreeMultiItemBase* node);
78
79 TreeMultiItemBase* RemoveNode(int index);
80
81 // get methods
82 int GetNodeCount() const;
83
84 TreeMultiItemBase* GetNode(int index) const;
85
86 int Index(TreeMultiItemBase* node, bool searchFromEnd = false) const;
87
88 TreeMultiItemBase* GetNodeNext(int& cookie) const;
89
90 TreeMultiItemBase* First() const;
91
92 TreeMultiItemBase* Last() const;
93
96 void Fold(bool expand) {
97 if (_nodeExpanded != expand) _nodeExpanded = expand;
98 };
99
101 const wxString& GetCaption() const {
102 return _caption;
103 };
104
106 void SetCaption(const wxString& caption);
107
109 bool IsExpanded() const {
110 return _nodeExpanded;
111 };
112};
113
114#endif
Definition TreeMultiItemBase.h:30
Definition TreeMultiItemNode.h:41
bool IsExpanded() const
Definition TreeMultiItemNode.h:109
const wxString & GetCaption() const
Definition TreeMultiItemNode.h:101
void SetCaption(const wxString &caption)
Definition TreeMultiItemNode.cpp:170
virtual TreeMultiItemNode * IsTreeMultiItemNode() const
Definition TreeMultiItemNode.h:61
void Fold(bool expand)
Definition TreeMultiItemNode.h:96