doom3-gpl
Doom 3 GPL source release
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
neo
tools
common
PropTree
PropTreeItem.h
Go to the documentation of this file.
1
// PropTreeItem.h
2
//
3
// Copyright (C) 1998-2001 Scott Ramsay
4
// sramsay@gonavi.com
5
// http://www.gonavi.com
6
//
7
// This material is provided "as is", with absolutely no warranty expressed
8
// or implied. Any use is at your own risk.
9
//
10
// Permission to use or copy this software for any purpose is hereby granted
11
// without fee, provided the above notices are retained on all copies.
12
// Permission to modify the code and to distribute modified code is granted,
13
// provided the above notices are retained, and a notice that the code was
14
// modified is included with the above copyright notice.
15
//
16
// If you use this code, drop me an email. I'd like to know if you find the code
17
// useful.
18
19
#ifndef _PROPTREEITEM_H
20
#define _PROPTREEITEM_H
21
22
class
CPropTree
;
23
24
class
PROPTREE_API
CPropTreeItem
25
{
26
// Construction
27
public
:
28
CPropTreeItem
();
29
virtual
~
CPropTreeItem
();
30
31
// Attributes/Operations
32
public
:
33
// TreeItem states
34
BOOL
IsExpanded();
35
BOOL
IsSelected();
36
BOOL
IsChecked();
37
BOOL
IsReadOnly();
38
BOOL
IsActivated();
39
40
void
Select(
BOOL
bSelect =
TRUE
);
41
void
Expand(
BOOL
bExpand =
TRUE
);
42
void
Check(
BOOL
bCheck =
TRUE
);
43
void
ReadOnly(
BOOL
bReadOnly =
TRUE
);
44
45
// Returns true if the item has a checkbox
46
BOOL
IsCheckBox();
47
48
// Pass in true, for the item to have a checkbox
49
void
HasCheckBox(
BOOL
bCheckbox =
TRUE
);
50
51
// Returns TRUE if the point is on the expand button
52
BOOL
HitExpand(
const
POINT
& pt);
53
54
// Returns TRUE if the point is on the check box
55
BOOL
HitCheckBox(
const
POINT
& pt);
56
57
// Overrideable - Returns TRUE if the point is on the button
58
virtual
BOOL
HitButton
(
const
POINT
& pt) {
return
false
;}
59
60
// Returns TRUE if the item is on the root level. Root level items don't have attribute areas
61
BOOL
IsRootLevel();
62
63
// Returns the total height of the item and all its children
64
LONG
GetTotalHeight();
65
66
// Set the items label text
67
void
SetLabelText(LPCTSTR sLabel);
68
69
// Return the items label text
70
LPCTSTR GetLabelText();
71
72
// Set the items info (description) text
73
void
SetInfoText(LPCTSTR sInfo);
74
75
// Get the items info (description) text
76
LPCTSTR GetInfoText();
77
78
// Set the item's ID
79
void
SetCtrlID(
UINT
nCtrlID);
80
81
// Return the item's ID
82
UINT
GetCtrlID();
83
84
// Overrideable - draw the item's non attribute area
85
virtual
LONG
DrawItem(CDC* pDC,
const
RECT& rc,
LONG
x
,
LONG
y
);
86
87
// call to mark attribute changes
88
void
CommitChanges();
89
90
// call to activate item attribute
91
enum
{
92
ACTIVATE_TYPE_KEYBOARD
,
93
ACTIVATE_TYPE_MOUSE
94
};
95
void
Activate(
int
activateType, CPoint point);
96
97
//
98
// Overrideables
99
//
100
101
// The attribute area needs drawing
102
virtual
void
DrawAttribute(CDC* pDC,
const
RECT& rc);
103
104
// Return the height of the item
105
virtual
LONG
GetHeight();
106
107
// Retrieve the item's attribute value
108
virtual
LPARAM
GetItemValue();
109
110
// Set the item's attribute value
111
virtual
void
SetItemValue(
LPARAM
lParam);
112
113
// Called when attribute area has changed size
114
virtual
void
OnMove();
115
116
// Called when the item needs to refresh its data
117
virtual
void
OnRefresh();
118
119
// Called when the item needs to commit its changes
120
virtual
void
OnCommit();
121
122
// Called to activate the item
123
virtual
void
OnActivate(
int
activateType, CPoint point);
124
125
//
126
// Usually only CPropTree should calls these
127
//
128
129
void
SetPropOwner(
CPropTree
* pProp);
130
131
// Return the location of the PropItem
132
const
POINT
& GetLocation();
133
134
// TreeItem link pointer access
135
CPropTreeItem
*
GetParent
();
136
CPropTreeItem
* GetSibling();
137
CPropTreeItem
* GetChild();
138
CPropTreeItem
* GetNextVisible();
139
140
void
SetParent(
CPropTreeItem
* pParent);
141
void
SetSibling(
CPropTreeItem
* pSibling);
142
void
SetChild(
CPropTreeItem
* pChild);
143
void
SetNextVisible(
CPropTreeItem
* pVis);
144
145
protected
:
146
// CPropTree class that this class belongs
147
CPropTree
*
m_pProp
;
148
149
// TreeItem label name
150
CString
m_sLabel
;
151
152
// Descriptive info text
153
CString
m_sInfo
;
154
155
// TreeItem location
156
CPoint
m_loc
;
157
158
// TreeItem attribute size
159
CRect
m_rc
;
160
161
// user defined LPARAM value
162
LPARAM
m_lParam
;
163
164
// ID of control item (should be unique)
165
UINT
m_nCtrlID
;
166
167
protected
:
168
enum
TreeItemStates
169
{
170
TreeItemSelected = 0x00000001,
171
TreeItemExpanded = 0x00000002,
172
TreeItemCheckbox = 0x00000004,
173
TreeItemChecked = 0x00000008,
174
TreeItemActivated = 0x00000010,
175
TreeItemReadOnly = 0x00000020,
176
};
177
178
// TreeItem state
179
DWORD
m_dwState
;
180
181
// TRUE if item is activated
182
BOOL
m_bActivated
;
183
184
// TRUE if item has been commited once (activation)
185
BOOL
m_bCommitOnce
;
186
187
// Rectangle position of the expand button (if contains one)
188
CRect
m_rcExpand
;
189
190
// Rectangle position of the check box (if contains one)
191
CRect
m_rcCheckbox
;
192
193
// Rectangle position of the button (if contains one)
194
CRect
m_rcButton
;
195
196
// link pointers
197
CPropTreeItem
*
m_pParent
;
198
CPropTreeItem
*
m_pSibling
;
199
CPropTreeItem
*
m_pChild
;
200
CPropTreeItem
*
m_pVis
;
201
};
202
203
#endif // _PROPTREEITEM_H
tagPOINT
Definition:
PreferencesDialog.h:41
CPropTreeItem::HitButton
virtual BOOL HitButton(const POINT &pt)
Definition:
PropTreeItem.h:58
CPropTreeItem::m_pSibling
CPropTreeItem * m_pSibling
Definition:
PropTreeItem.h:198
CPropTreeItem::m_rcButton
CRect m_rcButton
Definition:
PropTreeItem.h:194
CPropTreeItem::m_bCommitOnce
BOOL m_bCommitOnce
Definition:
PropTreeItem.h:185
CPropTreeItem::ACTIVATE_TYPE_KEYBOARD
Definition:
PropTreeItem.h:92
CPropTreeItem::TreeItemStates
TreeItemStates
Definition:
PropTreeItem.h:168
UINT
CONST PIXELFORMATDESCRIPTOR UINT
Definition:
win_qgl.cpp:47
CPropTreeItem::m_rcCheckbox
CRect m_rcCheckbox
Definition:
PropTreeItem.h:191
DWORD
DWORD
Definition:
win_qgl.cpp:61
y
GLenum GLint GLint y
Definition:
glext.h:2849
CPropTreeItem::m_pChild
CPropTreeItem * m_pChild
Definition:
PropTreeItem.h:199
PROPTREE_API
#define PROPTREE_API
Definition:
PropTree.h:53
CPropTreeItem::m_bActivated
BOOL m_bActivated
Definition:
PropTreeItem.h:182
x
GLenum GLint x
Definition:
glext.h:2849
BOOL
#define BOOL
Definition:
mprintf.c:71
CPropTreeItem::m_nCtrlID
UINT m_nCtrlID
Definition:
PropTreeItem.h:165
CPropTreeItem::m_loc
CPoint m_loc
Definition:
PropTreeItem.h:156
CPropTree
Definition:
PropTree.h:111
CPropTreeItem::m_pProp
CPropTree * m_pProp
Definition:
PropTreeItem.h:147
CPropTreeItem::m_lParam
LPARAM m_lParam
Definition:
PropTreeItem.h:162
CPropTreeItem::m_sInfo
CString m_sInfo
Definition:
PropTreeItem.h:153
CPropTreeItem::m_rc
CRect m_rc
Definition:
PropTreeItem.h:159
CPropTreeItem::m_rcExpand
CRect m_rcExpand
Definition:
PropTreeItem.h:188
LONG
long LONG
Definition:
PreferencesDialog.h:39
CPropTreeItem
Definition:
PropTreeItem.h:24
GetParent
MFnDagNode * GetParent(MFnDagNode *joint)
Definition:
maya_main.cpp:350
CPropTreeItem::m_sLabel
CString m_sLabel
Definition:
PropTreeItem.h:150
CPropTreeItem::m_dwState
DWORD m_dwState
Definition:
PropTreeItem.h:179
CPropTreeItem::m_pParent
CPropTreeItem * m_pParent
Definition:
PropTreeItem.h:197
TRUE
#define TRUE
Definition:
mprintf.c:69
CPropTreeItem::m_pVis
CPropTreeItem * m_pVis
Definition:
PropTreeItem.h:200
This page is maintained by
Wladimir van der Laan
. Generated on Mon Nov 17 2014 12:23:29 for doom3-gpl by
1.8.6
.