]> git.saurik.com Git - wxWidgets.git/blame - interface/treebase.h
add handling of wxWrapSizer flags (part of ticket 9468)
[wxWidgets.git] / interface / treebase.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: treebase.h
e54c96f1 3// Purpose: interface of wxTreeItemId
23324ae1
FM
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxTreeItemId
11 @wxheader{treebase.h}
7c913512 12
23324ae1 13 An opaque reference to a tree item.
7c913512 14
23324ae1 15 @library{wxcore}
7977b62a 16 @category{misc}
7c913512 17
7977b62a 18 @see wxTreeCtrl, wxTreeItemData, @ref overview_treectrl
23324ae1 19*/
7c913512 20class wxTreeItemId
23324ae1
FM
21{
22public:
23 /**
7977b62a
BP
24 Default constructor. A wxTreeItemId is not meant to be constructed
25 explicitly by the user; only those returned by the wxTreeCtrl functions
26 should be used.
23324ae1
FM
27 */
28 wxTreeItemId();
29
30 /**
31 Returns @true if this instance is referencing a valid tree item.
32 */
328f5751 33 bool IsOk() const;
23324ae1
FM
34
35 //@{
36 /**
7977b62a 37 Operators for comparison between wxTreeItemId objects.
23324ae1 38 */
7977b62a
BP
39 bool operator ==(const wxTreeItemId& item) const;
40 bool operator !=(const wxTreeItemId& item) const;
23324ae1 41 //@}
7977b62a
BP
42
43 /**
44 Antonym of IsOk(), i.e. returns @true only if the item is not valid.
45 */
46 bool operator !() const;
23324ae1 47};
e54c96f1 48
7977b62a
BP
49/**
50 @class wxTreeItemData
51 @wxheader{treebase.h}
52
53 wxTreeItemData is some (arbitrary) user class associated with some item. The
54 main advantage of having this class is that wxTreeItemData objects are
55 destroyed automatically by the tree and, as this class has virtual
56 destructor, it means that the memory and any other resources associated with
57 a tree item will be automatically freed when it is deleted. Note that we
58 don't use wxObject as the base class for wxTreeItemData because the size of
59 this class is critical: in many applications, each tree leaf will have
60 wxTreeItemData associated with it and the number of leaves may be quite big.
61
62 Also please note that because the objects of this class are deleted by the
63 tree using the operator @c delete, they must always be allocated on the heap
64 using @c new.
65
66 @library{wxcore}
67 @category{containers}
68
69 @see wxTreeCtrl
70*/
71class wxTreeItemData : public wxClientData
72{
73public:
74 /**
75 Default constructor.
76
77 @beginWxPythonOnly
78 The following methods are added in wxPython for accessing the object:
79 - GetData(): Returns a reference to the Python Object.
80 - SetData(obj): Associates a new Python Object with the wxTreeItemData.
81 @endWxPythonOnly
82 */
83 wxTreeItemData();
84
85 /**
86 Virtual destructor.
87 */
88 ~wxTreeItemData();
89
90 /**
91 Returns the item associated with this node.
92 */
93 const wxTreeItemId GetId();
94
95 /**
96 Sets the item associated with this node.
97 */
98 void SetId(const wxTreeItemId& id);
99};
100
101/**
102 Indicates which type to associate an image with a wxTreeCtrl item.
103
104 @see wxTreeCtrl::GetItemImage(), wxTreeCtrl::SetItemImage()
105*/
106enum wxTreeItemIcon
107{
108 /**
109 To get/set the item image for when the item is
110 @b not selected and @b not expanded.
111 */
112 wxTreeItemIcon_Normal,
113 /**
114 To get/set the item image for when the item is
115 @b selected and @b not expanded.
116 */
117 wxTreeItemIcon_Selected,
118 /**
119 To get/set the item image for when the item is
120 @b not selected and @b expanded.
121 */
122 wxTreeItemIcon_Expanded,
123 /**
124 To get/set the item image for when the item is
125 @b selected and @b expanded.
126 */
127 wxTreeItemIcon_SelectedExpanded,
128 wxTreeItemIcon_Max
129};