1 \section{\class{wxTreeCtrl
}}\label{wxtreectrl
}
3 A tree control presents information as a hierarchy, with items that may be expanded
4 to show further items. Items in a tree control are referenced by wxTreeItemId handles.
6 To intercept events from a tree control, use the event table macros described in
\helpref{wxTreeEvent
}{wxtreeevent
}.
8 \wxheading{Derived from
}
10 \helpref{wxControl
}{wxcontrol
}\\
11 \helpref{wxWindow
}{wxwindow
}\\
12 \helpref{wxEvtHandler
}{wxevthandler
}\\
13 \helpref{wxObject
}{wxobject
}
15 \wxheading{Include files
}
19 \wxheading{Window styles
}
22 \begin{twocollist
}\itemsep=
0pt
23 \twocolitem{\windowstyle{wxTR
\_HAS\_BUTTONS}}{Use this style to show + and - buttons to the
24 left of parent items.
}
25 \twocolitem{\windowstyle{wxTR
\_EDIT\_LABELS}}{Use this style if you wish the user to be
26 able to edit labels in the tree control.
}
29 See also
\helpref{window styles overview
}{windowstyles
}.
31 \wxheading{Event handling
}
33 To process input from a tree control, use these event handler macros to direct input to member
34 functions that take a
\helpref{wxTreeEvent
}{wxtreeevent
} argument.
37 \begin{twocollist
}\itemsep=
0pt
38 \twocolitem{{\bf EVT
\_TREE\_BEGIN\_DRAG(id, func)
}}{Begin dragging with the left mouse button.
}
39 \twocolitem{{\bf EVT
\_TREE\_BEGIN\_RDRAG(id, func)
}}{Begin dragging with the right mouse button.
}
40 \twocolitem{{\bf EVT
\_TREE\_BEGIN\_LABEL\_EDIT(id, func)
}}{Begin editing a label.
}
41 \twocolitem{{\bf EVT
\_TREE\_END\_LABEL\_EDIT(id, func)
}}{Finish editing a label.
}
42 \twocolitem{{\bf EVT
\_TREE\_DELETE\_ITEM(id, func)
}}{Delete an item.
}
43 \twocolitem{{\bf EVT
\_TREE\_GET\_INFO(id, func)
}}{Request information from the application.
}
44 \twocolitem{{\bf EVT
\_TREE\_SET\_INFO(id, func)
}}{Information is being supplied.
}
45 \twocolitem{{\bf EVT
\_TREE\_ITEM\_EXPANDED(id, func)
}}{Parent has been expanded.
}
46 \twocolitem{{\bf EVT
\_TREE\_ITEM\_EXPANDING(id, func)
}}{Parent is being expanded.
}
47 \twocolitem{{\bf EVT
\_TREE\_SEL\_CHANGED(id, func)
}}{Selection has changed.
}
48 \twocolitem{{\bf EVT
\_TREE\_SEL\_CHANGING(id, func)
}}{Selection is changing.
}
49 \twocolitem{{\bf EVT
\_TREE\_KEY\_DOWN(id, func)
}}{A key has been pressed.
}
54 \helpref{wxTreeItemData
}{wxtreeitemdata
},
\helpref{wxTreeCtrl overview
}{wxtreectrloverview
},
\helpref{wxListBox
}{wxlistbox
},
\helpref{wxListCtrl
}{wxlistctrl
},
\rtfsp
55 \helpref{wxImageList
}{wximagelist
},
\helpref{wxTreeEvent
}{wxtreeevent
}
57 \latexignore{\rtfignore{\wxheading{Members
}}}
59 \membersection{wxTreeCtrl::wxTreeCtrl
}\label{wxtreectrlconstr
}
61 \func{}{wxTreeCtrl
}{\void}
65 \func{}{wxTreeCtrl
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{ id
},
\rtfsp
66 \param{const wxPoint\&
}{ pos = wxDefaultPosition
},
\param{const wxSize\&
}{ size = wxDefaultSize
},
\rtfsp
67 \param{long
}{ style = wxTR
\_HAS\_BUTTONS},
\param{const wxValidator\&
}{validator = wxDefaultValidator
},
\param{const wxString\&
}{name = ``listCtrl"
}}
69 Constructor, creating and showing a tree control.
71 \wxheading{Parameters
}
73 \docparam{parent
}{Parent window. Must not be NULL.
}
75 \docparam{id
}{Window identifier. A value of -
1 indicates a default value.
}
77 \docparam{pos
}{Window position.
}
79 \docparam{size
}{Window size. If the default size (-
1, -
1) is specified then the window is sized
82 \docparam{style
}{Window style. See
\helpref{wxTreeCtrl
}{wxtreectrl
}.
}
84 \docparam{validator
}{Window validator.
}
86 \docparam{name
}{Window name.
}
90 \helpref{wxTreeCtrl::Create
}{wxtreectrlcreate
},
\helpref{wxValidator
}{wxvalidator
}
92 \membersection{wxTreeCtrl::
\destruct{wxTreeCtrl
}}
94 \func{void
}{\destruct{wxTreeCtrl
}}{\void}
96 Destructor, destroying the list control.
98 \membersection{wxTreeCtrl::AddRoot
}\label{wxtreectrladdroot
}
100 \func{wxTreeItemId
}{AddRoot
}{\param{const wxString\&
}{ text
},
101 \param{int
}{ image = -
1},
\param{int
}{ selImage = -
1},
\param{wxTreeItemData*
}{ data = NULL
}}
103 Adds the root node to the tree, returning the new item.
105 If
{\it image
} > -
1 and
{\it selImage
} is -
1, the same image is used for
106 both selected and unselected items.
108 \membersection{wxTreeCtrl::AppendItem
}\label{wxtreectrlappenditem
}
110 \func{wxTreeItemId
}{AppendItem
}{\param{const wxTreeItemId\&
}{parent
},
\param{const wxString\&
}{ text
},
111 \param{int
}{ image = -
1},
\param{int
}{ selImage = -
1},
\param{wxTreeItemData*
}{ data = NULL
}}
113 Appends an item to the end of the branch identified by
{\it parent
}, return a new item id.
115 If
{\it image
} > -
1 and
{\it selImage
} is -
1, the same image is used for
116 both selected and unselected items.
118 \membersection{wxTreeCtrl::Collapse
}\label{wxtreectrlcollapse
}
120 \func{void
}{Collapse
}{\param{const wxTreeItemId\&
}{ item
}}
122 Collapses the given item.
124 \membersection{wxTreeCtrl::CollapseAndReset
}\label{wxtreectrlcollapseandreset
}
126 \func{void
}{CollapseAndReset
}{\param{const wxTreeItemId\&
}{ item
}}
128 Collapses the given item and removes all children.
130 \membersection{wxTreeCtrl::Create
}\label{wxtreectrlcreate
}
132 \func{bool
}{wxTreeCtrl
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{ id
},
\rtfsp
133 \param{const wxPoint\&
}{ pos = wxDefaultPosition
},
\param{const wxSize\&
}{ size = wxDefaultSize
},
\rtfsp
134 \param{long
}{ style = wxTR
\_HAS\_BUTTONS},
\param{const wxValidator\&
}{validator = wxDefaultValidator
},
\param{const wxString\&
}{name = ``listCtrl"
}}
136 Creates the tree control. See
\helpref{wxTreeCtrl::wxTreeCtrl
}{wxtreectrlconstr
} for further details.
138 \membersection{wxTreeCtrl::Delete
}\label{wxtreectrldelete
}
140 \func{void
}{Delete
}{\param{const wxTreeItemId\&
}{ item
}}
142 Deletes the specified item.
144 \membersection{wxTreeCtrl::DeleteAllItems
}\label{wxtreectrldeleteallitems
}
146 \func{void
}{DeleteAllItems
}{\void}
148 Deletes all the items in the control.
150 \membersection{wxTreeCtrl::EditLabel
}\label{wxtreectrleditlabel
}
152 \func{wxTextCtrl*
}{EditLabel
}{\param{const wxTreeItemId\&
}{ item
},
\param{wxClassInfo*
}{ textControlClass = CLASSINFO(wxTextCtrl)
}}
154 Starts editing the label of the given item, returning the text control that the tree control uses for editing.
156 Pass another
{\it textControlClass
} if a derived class is required. It usually will be, in order for
157 the application to detect when editing has finished and to call
\helpref{wxTreeCtrl::EndEditLabel
}{wxtreectrlendeditlabel
}.
159 Do not delete the text control yourself.
161 This function is currently supported under Windows only.
165 \helpref{wxTreeCtrl::EndEditLabel
}{wxtreectrlendeditlabel
}
167 \membersection{wxTreeCtrl::EndEditLabel
}\label{wxtreectrlendeditlabel
}
169 \func{void
}{EndEditLabel
}{\param{bool
}{cancelEdit
}}
171 Ends label editing. If
{\it cancelEdit
} is TRUE, the edit will be cancelled.
173 This function is currently supported under Windows only.
177 \helpref{wxTreeCtrl::EditLabel
}{wxtreectrleditlabel
}
179 \membersection{wxTreeCtrl::EnsureVisible
}\label{wxtreectrlensurevisible
}
181 \func{void
}{EnsureVisible
}{\param{const wxTreeItemId\&
}{ item
}}
183 Scrolls and/or expands items to ensure that the given item is visible.
185 \membersection{wxTreeCtrl::Expand
}\label{wxtreectrlexpand
}
187 \func{void
}{Expand
}{\param{const wxTreeItemId\&
}{ item
}}
189 Expands the given item.
191 \membersection{wxTreeCtrl::GetBoundingRect
}\label{wxtreectrlgetitemrect
}
193 \constfunc{void
}{GetBoundingRect
}{\param{const wxTreeItemId\&
}{ item
},
\param{wxRect\&
}{rect
},
\param{bool
}{textOnly = FALSE
}}
195 Returns the position and size of the rectangle bounding the item.
197 \membersection{wxTreeCtrl::GetChildrenCount
}\label{wxtreectrlgetchildrencount
}
199 \constfunc{size
\_t}{GetChildrenCount
}{\param{const wxTreeItemId\&
}{ item
},
\param{bool
}{ recursively = TRUE
}}
201 Returns the number of items in the branch. If
{\it recursively
} is TRUE, returns the total number
202 of descendants, otherwise only one level of children is counted.
204 \membersection{wxTreeCtrl::GetCount
}\label{wxtreectrlgetcount
}
206 \constfunc{int
}{GetCount
}{\void}
208 Returns the number of items in the control.
210 \membersection{wxTreeCtrl::GetEditControl
}\label{wxtreectrlgeteditcontrol
}
212 \constfunc{wxTextCtrl\&
}{GetEditControl
}{\void}
214 Returns the edit control used to edit a label.
216 \membersection{wxTreeCtrl::GetFirstChild
}\label{wxtreectrlgetfirstchild
}
218 \constfunc{wxTreeItemId
}{GetFirstChild
}{\param{const wxTreeItemId\&
}{ item
},
\param{long\&
}{cookie
}}
220 Returns the first child; call
\helpref{wxTreeCtrl::GetNextChild
}{wxtreectrlgetnextchild
} for the next child.
222 For this enumeration function you must pass in a `cookie' parameter
223 which is opaque for the application but is necessary for the library
224 to make these functions reentrant (i.e. allow more than one
225 enumeration on one and the same object simultaneously). The cookie passed to
226 GetFirstChild and GetNextChild should be the same.
228 Returns
0 if there are no further children.
232 \helpref{wxTreeCtrl::GetNextChild
}{wxtreectrlgetnextchild
}
234 \membersection{wxTreeCtrl::GetFirstVisibleItem
}\label{wxtreectrlgetfirstvisibleitem
}
236 \constfunc{wxTreeItemId
}{GetFirstVisibleItem
}{\void}
238 Returns the first visible item.
240 \membersection{wxTreeCtrl::GetImageList
}\label{wxtreectrlgetimagelist
}
242 \constfunc{wxImageList*
}{GetImageList
}{\param{int
}{which = wxIMAGE
\_LIST\_NORMAL}}
244 Returns the specified image list.
{\it which
} may be one of:
247 \begin{twocollist
}\itemsep=
0pt
248 \twocolitem{\windowstyle{wxIMAGE
\_LIST\_NORMAL}}{The normal (large icon) image list.
}
249 \twocolitem{\windowstyle{wxIMAGE
\_LIST\_SMALL}}{The small icon image list.
}
250 \twocolitem{\windowstyle{wxIMAGE
\_LIST\_STATE}}{The user-defined state image list (unimplemented).
}
253 \membersection{wxTreeCtrl::GetIndent
}\label{wxtreectrlgetindent
}
255 \constfunc{int
}{GetIndent
}{\void}
257 Returns the current tree control indentation.
259 \membersection{wxTreeCtrl::GetItemData
}\label{wxtreectrlgetitemdata
}
261 \constfunc{wxTreeItemData*
}{GetItemData
}{\param{const wxTreeItemId\&
}{ item
}}
263 Returns the tree item data associated with the item.
267 \helpref{wxTreeItemData
}{wxtreeitemdata
}
269 \membersection{wxTreeCtrl::GetItemImage
}\label{wxtreectrlgetitemimage
}
271 \constfunc{int
}{GetItemImage
}{\param{const wxTreeItemId\&
}{item
}}
273 Gets the normal item image.
275 \membersection{wxTreeCtrl::GetItemText
}\label{wxtreectrlgetitemtext
}
277 \constfunc{wxString
}{GetItemText
}{\param{const wxTreeItemId\&
}{ item
}}
279 Returns the item label.
281 \membersection{wxTreeCtrl::GetLastChild
}\label{wxtreectrlgetlastchild
}
283 \constfunc{wxTreeItemId
}{GetLastChild
}{\param{const wxTreeItemId\&
}{ item
}}
285 Returns the last child of the item (or
0 if this item has no children).
289 \helpref{GetFirstChild
}{wxtreectrlgetfirstchild
},
290 \helpref{GetLastChild
}{wxtreectrlgetlastchild
}
292 \membersection{wxTreeCtrl::GetNextChild
}\label{wxtreectrlgetnextchild
}
294 \constfunc{wxTreeItemId
}{GetNextChild
}{\param{const wxTreeItemId\&
}{ item
},
\param{long\&
}{cookie
}}
296 Returns the next child; call
\helpref{wxTreeCtrl::GetFirstChild
}{wxtreectrlgetfirstchild
} for the first child.
298 For this enumeration function you must pass in a `cookie' parameter
299 which is opaque for the application but is necessary for the library
300 to make these functions reentrant (i.e. allow more than one
301 enumeration on one and the same object simultaneously). The cookie passed to
302 GetFirstChild and GetNextChild should be the same.
304 Returns
0 if there are no further children.
308 \helpref{wxTreeCtrl::GetFirstChild
}{wxtreectrlgetfirstchild
}
310 \membersection{wxTreeCtrl::GetNextSibling
}\label{wxtreectrlgetnextsibling
}
312 \constfunc{wxTreeItemId
}{GetNextSibling
}{\param{const wxTreeItemId\&
}{ item
}}
314 Returns the next sibling of the specified item; call
\helpref{wxTreeCtrl::GetPrevSibling
}{wxtreectrlgetprevsibling
} for the previous sibling.
316 Returns
0 if there are no further siblings.
320 \helpref{wxTreeCtrl::GetPrevSibling
}{wxtreectrlgetprevsibling
}
322 \membersection{wxTreeCtrl::GetNextVisible
}\label{wxtreectrlgetnextvisible
}
324 \constfunc{wxTreeItemId
}{GetNextVisible
}{\param{const wxTreeItemId\&
}{ item
}}
326 Returns the next visible item.
328 \membersection{wxTreeCtrl::GetParent
}\label{wxtreectrlgetparent
}
330 \constfunc{wxTreeItemId
}{GetParent
}{\param{const wxTreeItemId\&
}{ item
}}
332 Returns the item's parent.
334 \membersection{wxTreeCtrl::GetPrevSibling
}\label{wxtreectrlgetprevsibling
}
336 \constfunc{wxTreeItemId
}{GetPrevSibling
}{\param{const wxTreeItemId\&
}{ item
}}
338 Returns the previous sibling of the specified item; call
\helpref{wxTreeCtrl::GetNextSibling
}{wxtreectrlgetnextsibling
} for the next sibling.
340 Returns
0 if there are no further children.
344 \helpref{wxTreeCtrl::GetNextSibling
}{wxtreectrlgetnextsibling
}
346 \membersection{wxTreeCtrl::GetPrevVisible
}\label{wxtreectrlgetprevvisible
}
348 \constfunc{wxTreeItemId
}{GetPrevVisible
}{\param{const wxTreeItemId\&
}{ item
}}
350 Returns the previous visible item.
352 \membersection{wxTreeCtrl::GetRootItem
}\label{wxtreectrlgetrootitem
}
354 \constfunc{wxTreeItemId
}{GetRootItem
}{\void}
356 Returns the root item for the tree control.
358 \membersection{wxTreeCtrl::GetSelectedItemImage
}\label{wxtreectrlgetselecteditemimage
}
360 \constfunc{int
}{GetSelectedItemImage
}{\param{const wxTreeItemId\&
}{item
}}
362 Gets the selected item image.
364 \membersection{wxTreeCtrl::GetSelection
}\label{wxtreectrlgetselection
}
366 \constfunc{wxTreeItemId
}{GetSelection
}{\void}
368 Returns the selection, or
0 if there is no selection.
370 \membersection{wxTreeCtrl::HitTest
}\label{wxtreectrlhittest
}
372 \func{long
}{HitTest
}{\param{const wxPoint\&
}{point
},
\param{int\&
}{flags
}}
374 Calculates which (if any) item is under the given point, returning extra information
375 in
{\it flags
}.
{\it flags
} is a bitlist of the following:
378 \begin{twocollist
}\itemsep=
0pt
379 \twocolitem{wxTREE
\_HITTEST\_ABOVE}{Above the client area.
}
380 \twocolitem{wxTREE
\_HITTEST\_BELOW}{Below the client area.
}
381 \twocolitem{wxTREE
\_HITTEST\_NOWHERE}{In the client area but below the last item.
}
382 \twocolitem{wxTREE
\_HITTEST\_ONITEMBUTTON}{On the button associated with an item.
}
383 \twocolitem{wxTREE
\_HITTEST\_ONITEMICON}{On the bitmap associated with an item.
}
384 \twocolitem{wxTREE
\_HITTEST\_ONITEMINDENT}{In the indentation associated with an item.
}
385 \twocolitem{wxTREE
\_HITTEST\_ONITEMLABEL}{On the label (string) associated with an item.
}
386 \twocolitem{wxTREE
\_HITTEST\_ONITEMRIGHT}{In the area to the right of an item.
}
387 \twocolitem{wxTREE
\_HITTEST\_ONITEMSTATEICON}{On the state icon for a tree view item that is in a user-defined state.
}
388 \twocolitem{wxTREE
\_HITTEST\_TOLEFT}{To the right of the client area.
}
389 \twocolitem{wxTREE
\_HITTEST\_TORIGHT}{To the left of the client area.
}
392 \membersection{wxTreeCtrl::InsertItem
}\label{wxtreectrlinsertitem
}
394 \func{wxTreeItemId
}{InsertItem
}{\param{const wxTreeItemId\&
}{parent
},
\param{const wxTreeItemId\&
}{previous
},
\param{const wxString\&
}{ text
},
395 \param{int
}{ image = -
1},
\param{int
}{ selImage = -
1},
\param{wxTreeItemData*
}{ data = NULL
}}
397 Inserts an item after a given one.
399 If
{\it image
} > -
1 and
{\it selImage
} is -
1, the same image is used for
400 both selected and unselected items.
402 \membersection{wxTreeCtrl::IsExpanded
}\label{wxtreectrlisexpanded
}
404 \constfunc{bool
}{IsExpanded
}{\param{const wxTreeItemId\&
}{ item
}}
406 Returns TRUE if the item is expanded (only makes sense if it has children).
408 \membersection{wxTreeCtrl::IsSelected
}\label{wxtreectrlisselected
}
410 \constfunc{bool
}{IsSelected
}{\param{const wxTreeItemId\&
}{ item
}}
412 Returns TRUE if the item is selected.
414 \membersection{wxTreeCtrl::IsVisible
}\label{wxtreectrlisvisible
}
416 \constfunc{bool
}{IsVisible
}{\param{const wxTreeItemId\&
}{ item
}}
418 Returns TRUE if the item is visible (it might be outside the view, or not expanded).
420 \membersection{wxTreeCtrl::ItemHasChildren
}\label{wxtreectrlitemhaschildren
}
422 \constfunc{bool
}{ItemHasChildren
}{\param{const wxTreeItemId\&
}{ item
}}
424 Returns TRUE if the item has children.
426 \membersection{wxTreeCtrl::PrependItem
}\label{wxtreectrlprependitem
}
428 \func{wxTreeItemId
}{PrependItem
}{\param{const wxTreeItemId\&
}{parent
},
\param{const wxString\&
}{ text
},
429 \param{int
}{ image = -
1},
\param{int
}{ selImage = -
1},
\param{wxTreeItemData*
}{ data = NULL
}}
431 Appends an item as the first child of
{\it parent
}, return a new item id.
433 If
{\it image
} > -
1 and
{\it selImage
} is -
1, the same image is used for
434 both selected and unselected items.
436 \membersection{wxTreeCtrl::ScrollTo
}\label{wxtreectrlscrollto
}
438 \func{void
}{ScrollTo
}{\param{const wxTreeItemId\&
}{ item
}}
440 Scrolls the specified item into view.
442 \membersection{wxTreeCtrl::SelectItem
}\label{wxtreectrlselectitem
}
444 \func{bool
}{SelectItem
}{\param{const wxTreeItemId\&
}{ item
}}
446 Selects the given item.
448 \membersection{wxTreeCtrl::SetIndent
}\label{wxtreectrlsetindent
}
450 \func{void
}{SetIndent
}{\param{int
}{indent
}}
452 Sets the indentation for the tree control.
454 \membersection{wxTreeCtrl::SetImageList
}\label{wxtreectrlsetimagelist
}
456 \func{void
}{SetImageList
}{\param{wxImageList*
}{ imageList
},
\param{int
}{which = wxIMAGE
\_LIST\_NORMAL}}
458 Sets the image list.
{\it which
} should be one of wxIMAGE
\_LIST\_NORMAL, wxIMAGE
\_LIST\_SMALL and
459 wxIMAGE
\_LIST\_STATE.
461 \membersection{wxTreeCtrl::SetItemData
}\label{wxtreectrlsetitemdata
}
463 \func{void
}{SetItemData
}{\param{const wxTreeItemId\&
}{ item
},
\param{wxTreeItemData*
}{data
}}
465 Sets the item client data.
467 \membersection{wxTreeCtrl::SetItemHasChildren
}\label{wxtreectrlsetitemhaschildren
}
469 \func{void
}{SetItemHasChildren
}{\param{const wxTreeItemId\&
}{ item
},
\param{bool
}{hasChildren = TRUE
}}
471 Force appearance of the button next to the item. This is useful to
472 allow the user to expand the items which don't have any children now,
473 but instead adding them only when needed, thus minimizing memory
474 usage and loading time.
476 \membersection{wxTreeCtrl::SetItemImage
}\label{wxtreectrlsetitemimage
}
478 \func{void
}{SetItemImage
}{\param{const wxTreeItemId\&
}{ item
},
\param{int
}{image
}}
480 Sets the normal item image. This is an index into the assciated image list.
482 \membersection{wxTreeCtrl::SetItemSelectedImage
}\label{wxtreectrlsetitemselectedimage
}
484 \func{void
}{SetItemSelectedImage
}{\param{const wxTreeItemId\&
}{ item
},
\param{int
}{selImage
}}
486 Sets the item selected image. This is an index into the assciated image list.
488 \membersection{wxTreeCtrl::SetItemText
}\label{wxtreectrlsetitemtext
}
490 \func{void
}{SetItemText
}{\param{const wxTreeItemId\&
}{ item
},
\param{const wxString\&
}{text
}}
494 \membersection{wxTreeCtrl::SortChildren
}\label{wxtreectrlsortchildren
}
496 \func{void
}{SortChildren
}{\param{const wxTreeItemId\&
}{ item
},
\param{wxTreeItemCmpFunc*
}{ cmpFunction = NULL
}}
498 Sorts the children of the given item. If
{\it cmpFunction
} is NULL, sorts in ascending alphabetical order;
499 otherwise the custom sort function is used, as follows:
503 // a callback function used for sorting tree items, it should return -
1 if the
504 // first item precedes the second, +
1 if the second precedes the first or
0 if
505 // they're equivalent
506 class wxTreeItemData;
507 typedef int
(*wxTreeItemCmpFunc)(wxTreeItemData *item1, wxTreeItemData *item2);
513 \helpref{wxTreeItemData}{wxtreeitemdata}
515 \membersection{wxTreeCtrl::Toggle}\label{wxtreectrltoggle}
517 \func{void}{Toggle}{\param{const wxTreeItemId\&}{ item}}
519 Toggles the given item between collapsed and expanded states.
521 \membersection{wxTreeCtrl::Unselect}\label{wxtreectrlunselect}
523 \func{void}{Unselect}{\void}
525 Removes the selection from the currently selected item (if any).
527 \section{\class{wxTreeItemData}}\label{wxtreeitemdata}
529 wxTreeItemData is some (arbitrary) user class associated with some item. The
530 main advantage of having this class (compared to the old untyped interface) is
531 that wxTreeItemData's are destroyed automatically by the tree and, as this
532 class has virtual dtor, it means that the memory will be automatically
533 freed. We don't just use wxObject instead of wxTreeItemData because
534 the size of this class is critical: in any real application, each tree leaf
535 will have wxTreeItemData associated with it and number of leaves may be
538 Because the objects of this class are deleted by the tree, they should
539 always be allocated on the heap.
541 \wxheading{Derived from}
545 \wxheading{Include files}
551 \helpref{wxTreeCtrl}{wxtreectrl}
553 \latexignore{\rtfignore{\wxheading{Members}}}
555 \membersection{wxTreeItemData::wxTreeItemData}\label{wxtreeitemdataconstr}
557 \func{}{wxTreeItemData}{\void}
561 \membersection{wxTreeItemData::\destruct{wxTreeItemData}}
563 \func{void}{\destruct{wxTreeItemData}}{\void}
567 \membersection{wxTreeItemData::GetId}\label{wxtreeitemdatagetid}
569 \func{const wxTreeItem\&}{GetId}{\void}
571 Returns the item associated with this node.
573 \membersection{wxTreeItemData::SetId}\label{wxtreeitemdatasetid}
575 \func{void}{SetId}{\param{const wxTreeItemId\&}{ id}}
577 Sets the item associated with this node.