ToolMap
Loading...
Searching...
No Matches
TreeMultiItemBase.h
1//---------------------------------------------------------------------------
2// $RCSfile: TreeMultiItemBase.h $
3// $Source: contrib/include/wx/treemultictrl/TreeMultiItemBase.h $
4// $Revision: 1.84 $
5// $Date: Jul 29, 2007 2:09:31 PM $
6//---------------------------------------------------------------------------
7// Author: Jorgen Bodde
8// Copyright: (c) Jorgen Bodde
9// License: wxWidgets License
10//---------------------------------------------------------------------------
11
12#ifndef __TREEMULTIITEMBASE_HPP_
13#define __TREEMULTIITEMBASE_HPP_
14
15#ifdef __GNUG__
16#pragma interface "TreeMultiItemBase.cpp"
17#endif
18
19#ifndef WX_PRECOMP
20#include <wx/wx.h>
21#endif
22
23// forward definitions
25
27
29
31 protected:
33
36 wxString _name;
37
42
44 int _type;
45
47 int _x, _y;
48
50 int _width, _height;
51
52#if (CHECKBOXVIEW)
54 bool _checkbox;
55
59 int _checkboxState;
60#endif
61
62 public:
63 virtual ~TreeMultiItemBase();
64
65 // type of tree item
66
67 int GetType() const {
68 return _type;
69 };
70
71 TreeMultiItemNode* GetParent() const {
72 return _parent;
73 };
74
76 wxString GetName() const {
77 return _name;
78 };
79
81 void SetName(wxString const& NewName) {
82 this->_name = NewName;
83 }
84
89 return 0;
90 };
91
96 return 0;
97 };
98
103 return 0;
104 };
105
107 void SetExcluded(bool excluded) {
108 _excluded = excluded;
109 };
110
112 void SetX(int x) {
113 _x = x;
114 };
115
116 int GetX() const {
117 return _x;
118 };
119
121 void SetY(int y) {
122 _y = y;
123 };
124
125 int GetY() const {
126 return _y;
127 };
128
130 void SetHeight(int height) {
131 _height = height;
132 };
133
134 int GetHeight() const {
135 return _height;
136 };
137
139 void SetWidth(int width) {
140 _width = width;
141 };
142
143 int GetWidth() const {
144 return _width;
145 };
146
157 bool IsVisible();
158
159 /* Returns if this node is excluded from the tree. If this item
160 is a Node, then all kids are excluded as well */
161 bool IsExcluded() const {
162 return _excluded;
163 };
164
165 //
166 // item selection status handling
167
169 bool IsSelected(void) const {
170 return this->m_Selected;
171 }
172
174 void Select(void) {
175 this->m_Selected = true;
176 }
177
179 void ToggleSelection(void) {
180 this->m_Selected = !(this->m_Selected);
181 }
182
184 void Unselect(void) {
185 this->m_Selected = false;
186 }
187
188#if (CHECKBOXVIEW)
190 void SetCheckbox(bool value) {
191 _checkbox = value;
192 };
193
195 bool GetCheckbox() const {
196 return _checkbox;
197 };
198
200 virtual void SetCheckboxState(int state) {
201 wxCHECK2(state < 3 && state >= 0, return);
202 _checkboxState = state;
203 };
204
206 int GetCheckboxState() const {
207 return _checkboxState;
208 };
209#endif
210
211 private:
212 TreeMultiItemNode* _parent;
213
214 // flags to indicate the status of the item:
215 bool m_Selected;
216};
217
218#endif
Definition TreeMultiItemBase.h:30
virtual TreeMultiItemRoot * IsTreeMultiItemRoot() const
Definition TreeMultiItemBase.h:88
void ToggleSelection(void)
Definition TreeMultiItemBase.h:179
void SetExcluded(bool excluded)
Definition TreeMultiItemBase.h:107
void SetY(int y)
Definition TreeMultiItemBase.h:121
bool IsVisible()
Definition TreeMultiItemBase.cpp:51
void Select(void)
Definition TreeMultiItemBase.h:174
void SetX(int x)
Definition TreeMultiItemBase.h:112
void SetName(wxString const &NewName)
Definition TreeMultiItemBase.h:81
bool IsSelected(void) const
Definition TreeMultiItemBase.h:169
virtual TreeMultiItemNode * IsTreeMultiItemNode() const
Definition TreeMultiItemBase.h:102
void SetHeight(int height)
Definition TreeMultiItemBase.h:130
void Unselect(void)
Definition TreeMultiItemBase.h:184
int _type
Definition TreeMultiItemBase.h:44
int _width
Definition TreeMultiItemBase.h:50
wxString _name
Definition TreeMultiItemBase.h:36
void SetWidth(int width)
Definition TreeMultiItemBase.h:139
virtual TreeMultiItemWindow * IsTreeMultiItemWindow() const
Definition TreeMultiItemBase.h:95
int _x
Definition TreeMultiItemBase.h:47
wxString GetName() const
Definition TreeMultiItemBase.h:76
bool _excluded
Definition TreeMultiItemBase.h:41
Definition TreeMultiItemNode.h:41
Definition TreeMultiItemRoot.h:29
Definition TreeMultiItemWindow.h:27