]> git.saurik.com Git - wxWidgets.git/blame_incremental - docs/latex/wx/treectrl.tex
* Someone destroy a part of my previous work. Redocumenting ...
[wxWidgets.git] / docs / latex / wx / treectrl.tex
... / ...
CommitLineData
1\section{\class{wxTreeCtrl}}\label{wxtreectrl}
2
3A tree control presents information as a hierarchy, with items that may be expanded
4to show further items. Items in a tree control are referenced by wxTreeItemId handles.
5
6To intercept events from a tree control, use the event table macros described in \helpref{wxTreeEvent}{wxtreeevent}.
7
8\wxheading{Derived from}
9
10\helpref{wxControl}{wxcontrol}\\
11\helpref{wxWindow}{wxwindow}\\
12\helpref{wxEvtHandler}{wxevthandler}\\
13\helpref{wxObject}{wxobject}
14
15\wxheading{Window styles}
16
17\twocolwidtha{5cm}
18\begin{twocollist}\itemsep=0pt
19\twocolitem{\windowstyle{wxTR\_HAS\_BUTTONS}}{Use this style to show + and - buttons to the
20left of parent items.}
21\twocolitem{\windowstyle{wxTR\_EDIT\_LABELS}}{Use this style if you wish the user to be
22able to edit labels in the tree control.}
23\end{twocollist}
24
25See also \helpref{window styles overview}{windowstyles}.
26
27\wxheading{Event handling}
28
29To process input from a tree control, use these event handler macros to direct input to member
30functions that take a \helpref{wxTreeEvent}{wxtreeevent} argument.
31
32\twocolwidtha{7cm}
33\begin{twocollist}\itemsep=0pt
34\twocolitem{{\bf EVT\_TREE\_BEGIN\_DRAG(id, func)}}{Begin dragging with the left mouse button.}
35\twocolitem{{\bf EVT\_TREE\_BEGIN\_RDRAG(id, func)}}{Begin dragging with the right mouse button.}
36\twocolitem{{\bf EVT\_TREE\_BEGIN\_LABEL\_EDIT(id, func)}}{Begin editing a label.}
37\twocolitem{{\bf EVT\_TREE\_END\_LABEL\_EDIT(id, func)}}{Finish editing a label.}
38\twocolitem{{\bf EVT\_TREE\_DELETE\_ITEM(id, func)}}{Delete an item.}
39\twocolitem{{\bf EVT\_TREE\_GET\_INFO(id, func)}}{Request information from the application.}
40\twocolitem{{\bf EVT\_TREE\_SET\_INFO(id, func)}}{Information is being supplied.}
41\twocolitem{{\bf EVT\_TREE\_ITEM\_EXPANDED(id, func)}}{Parent has been expanded.}
42\twocolitem{{\bf EVT\_TREE\_ITEM\_EXPANDING(id, func)}}{Parent is being expanded.}
43\twocolitem{{\bf EVT\_TREE\_SEL\_CHANGED(id, func)}}{Selection has changed.}
44\twocolitem{{\bf EVT\_TREE\_SEL\_CHANGING(id, func)}}{Selection is changing.}
45\twocolitem{{\bf EVT\_TREE\_KEY\_DOWN(id, func)}}{A key has been pressed.}
46\end{twocollist}%
47
48\wxheading{See also}
49
50\helpref{wxTreeItemData}{wxtreeitemdata}, \helpref{wxTreeCtrl overview}{wxtreectrloverview}, \helpref{wxListBox}{wxlistbox}, \helpref{wxListCtrl}{wxlistctrl},\rtfsp
51\helpref{wxImageList}{wximagelist}, \helpref{wxTreeEvent}{wxtreeevent}
52
53\latexignore{\rtfignore{\wxheading{Members}}}
54
55\membersection{wxTreeCtrl::wxTreeCtrl}\label{wxtreectrlconstr}
56
57\func{}{wxTreeCtrl}{\void}
58
59Default constructor.
60
61\func{}{wxTreeCtrl}{\param{wxWindow*}{ parent}, \param{wxWindowID}{ id},\rtfsp
62\param{const wxPoint\&}{ pos = wxDefaultPosition}, \param{const wxSize\&}{ size = wxDefaultSize},\rtfsp
63\param{long}{ style = wxTR\_HAS\_BUTTONS}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = ``listCtrl"}}
64
65Constructor, creating and showing a tree control.
66
67\wxheading{Parameters}
68
69\docparam{parent}{Parent window. Must not be NULL.}
70
71\docparam{id}{Window identifier. A value of -1 indicates a default value.}
72
73\docparam{pos}{Window position.}
74
75\docparam{size}{Window size. If the default size (-1, -1) is specified then the window is sized
76appropriately.}
77
78\docparam{style}{Window style. See \helpref{wxTreeCtrl}{wxtreectrl}.}
79
80\docparam{validator}{Window validator.}
81
82\docparam{name}{Window name.}
83
84\wxheading{See also}
85
86\helpref{wxTreeCtrl::Create}{wxtreectrlcreate}, \helpref{wxValidator}{wxvalidator}
87
88\membersection{wxTreeCtrl::\destruct{wxTreeCtrl}}
89
90\func{void}{\destruct{wxTreeCtrl}}{\void}
91
92Destructor, destroying the list control.
93
94\membersection{wxTreeCtrl::AddRoot}\label{wxtreectrladdroot}
95
96\func{wxTreeItemId}{AddRoot}{\param{const wxString\&}{ text},
97 \param{int}{ image = -1}, \param{int}{ selImage = -1}, \param{wxTreeItemData*}{ data = NULL}}
98
99Adds the root node to the tree, returning the new item.
100
101If {\it image} > -1 and {\it selImage} is -1, the same image is used for
102both selected and unselected items.
103
104\membersection{wxTreeCtrl::AppendItem}\label{wxtreectrlappenditem}
105
106\func{wxTreeItemId}{AppendItem}{\param{const wxTreeItemId\& }{parent}, \param{const wxString\&}{ text},
107 \param{int}{ image = -1}, \param{int}{ selImage = -1}, \param{wxTreeItemData*}{ data = NULL}}
108
109Appends an item to the end of the branch identified by {\it parent}, return a new item id.
110
111If {\it image} > -1 and {\it selImage} is -1, the same image is used for
112both selected and unselected items.
113
114\membersection{wxTreeCtrl::Collapse}\label{wxtreectrlcollapse}
115
116\func{void}{Collapse}{\param{const wxTreeItemId\&}{ item}}
117
118Collapses the given item.
119
120\membersection{wxTreeCtrl::CollapseAndReset}\label{wxtreectrlcollapseandreset}
121
122\func{void}{CollapseAndReset}{\param{const wxTreeItemId\&}{ item}}
123
124Collapses the given item and removes all children.
125
126\membersection{wxTreeCtrl::Create}\label{wxtreectrlcreate}
127
128\func{bool}{wxTreeCtrl}{\param{wxWindow*}{ parent}, \param{wxWindowID}{ id},\rtfsp
129\param{const wxPoint\&}{ pos = wxDefaultPosition}, \param{const wxSize\&}{ size = wxDefaultSize},\rtfsp
130\param{long}{ style = wxTR\_HAS\_BUTTONS}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = ``listCtrl"}}
131
132Creates the tree control. See \helpref{wxTreeCtrl::wxTreeCtrl}{wxtreectrlconstr} for further details.
133
134\membersection{wxTreeCtrl::Delete}\label{wxtreectrldelete}
135
136\func{void}{Delete}{\param{const wxTreeItemId\&}{ item}}
137
138Deletes the specified item.
139
140\membersection{wxTreeCtrl::DeleteAllItems}\label{wxtreectrldeleteallitems}
141
142\func{void}{DeleteAllItems}{\void}
143
144Deletes all the items in the control.
145
146\membersection{wxTreeCtrl::EditLabel}\label{wxtreectrleditlabel}
147
148\func{wxTextCtrl*}{EditLabel}{\param{const wxTreeItemId\&}{ item}, \param{wxClassInfo*}{ textControlClass = CLASSINFO(wxTextCtrl)}}
149
150Starts editing the label of the given item, returning the text control that the tree control uses for editing.
151
152Pass another {\it textControlClass} if a derived class is required. It usually will be, in order for
153the application to detect when editing has finished and to call \helpref{wxTreeCtrl::EndEditLabel}{wxtreectrlendeditlabel}.
154
155Do not delete the text control yourself.
156
157This function is currently supported under Windows only.
158
159\wxheading{See also}
160
161\helpref{wxTreeCtrl::EndEditLabel}{wxtreectrlendeditlabel}
162
163\membersection{wxTreeCtrl::EndEditLabel}\label{wxtreectrlendeditlabel}
164
165\func{void}{EndEditLabel}{\param{bool }{cancelEdit}}
166
167Ends label editing. If {\it cancelEdit} is TRUE, the edit will be cancelled.
168
169This function is currently supported under Windows only.
170
171\wxheading{See also}
172
173\helpref{wxTreeCtrl::EditLabel}{wxtreectrleditlabel}
174
175\membersection{wxTreeCtrl::EnsureVisible}\label{wxtreectrlensurevisible}
176
177\func{void}{EnsureVisible}{\param{const wxTreeItemId\&}{ item}}
178
179Scrolls and/or expands items to ensure that the given item is visible.
180
181\membersection{wxTreeCtrl::Expand}\label{wxtreectrlexpand}
182
183\func{void}{Expand}{\param{const wxTreeItemId\&}{ item}}
184
185Expands the given item.
186
187\membersection{wxTreeCtrl::GetBoundingRect}\label{wxtreectrlgetitemrect}
188
189\constfunc{void}{GetBoundingRect}{\param{const wxTreeItemId\&}{ item}, \param{wxRect\& }{rect}, \param{bool }{textOnly = FALSE}}
190
191Returns the position and size of the rectangle bounding the item.
192
193\membersection{wxTreeCtrl::GetChildrenCount}\label{wxtreectrlgetchildrencount}
194
195\constfunc{size\_t}{GetChildrenCount}{\param{const wxTreeItemId\&}{ item}, \param{bool}{ recursively = TRUE}}
196
197Returns the number of items in the branch. If {\it recursively} is TRUE, returns the total number
198of descendants, otherwise only one level of children is counted.
199
200\membersection{wxTreeCtrl::GetCount}\label{wxtreectrlgetcount}
201
202\constfunc{int}{GetCount}{\void}
203
204Returns the number of items in the control.
205
206\membersection{wxTreeCtrl::GetEditControl}\label{wxtreectrlgeteditcontrol}
207
208\constfunc{wxTextCtrl\&}{GetEditControl}{\void}
209
210Returns the edit control used to edit a label.
211
212\membersection{wxTreeCtrl::GetFirstChild}\label{wxtreectrlgetfirstchild}
213
214\constfunc{wxTreeItemId}{GetFirstChild}{\param{const wxTreeItemId\&}{ item}, \param{long\& }{cookie}}
215
216Returns the first child; call \helpref{wxTreeCtrl::GetNextChild}{wxtreectrlgetnextchild} for the next child.
217
218For this enumeration function you must pass in a `cookie' parameter
219which is opaque for the application but is necessary for the library
220to make these functions reentrant (i.e. allow more than one
221enumeration on one and the same object simultaneously). The cookie passed to
222GetFirstChild and GetNextChild should be the same.
223
224Returns 0 if there are no further children.
225
226\wxheading{See also}
227
228\helpref{wxTreeCtrl::GetNextChild}{wxtreectrlgetnextchild}
229
230\membersection{wxTreeCtrl::GetFirstVisibleItem}\label{wxtreectrlgetfirstvisibleitem}
231
232\constfunc{wxTreeItemId}{GetFirstVisibleItem}{\void}
233
234Returns the first visible item.
235
236\membersection{wxTreeCtrl::GetImageList}\label{wxtreectrlgetimagelist}
237
238\constfunc{wxImageList*}{GetImageList}{\param{int }{which = wxIMAGE\_LIST\_NORMAL}}
239
240Returns the specified image list. {\it which} may be one of:
241
242\twocolwidtha{5cm}
243\begin{twocollist}\itemsep=0pt
244\twocolitem{\windowstyle{wxIMAGE\_LIST\_NORMAL}}{The normal (large icon) image list.}
245\twocolitem{\windowstyle{wxIMAGE\_LIST\_SMALL}}{The small icon image list.}
246\twocolitem{\windowstyle{wxIMAGE\_LIST\_STATE}}{The user-defined state image list (unimplemented).}
247\end{twocollist}
248
249\membersection{wxTreeCtrl::GetIndent}\label{wxtreectrlgetindent}
250
251\constfunc{int}{GetIndent}{\void}
252
253Returns the current tree control indentation.
254
255\membersection{wxTreeCtrl::GetItemData}\label{wxtreectrlgetitemdata}
256
257\constfunc{wxTreeItemData*}{GetItemData}{\param{const wxTreeItemId\&}{ item}}
258
259Returns the tree item data associated with the item.
260
261\wxheading{See also}
262
263\helpref{wxTreeItemData}{wxtreeitemdata}
264
265\membersection{wxTreeCtrl::GetItemImage}\label{wxtreectrlgetitemimage}
266
267\constfunc{int}{GetItemImage}{\param{const wxTreeItemId\& }{item}}
268
269Gets the normal item image.
270
271\membersection{wxTreeCtrl::GetItemText}\label{wxtreectrlgetitemtext}
272
273\constfunc{wxString}{GetItemText}{\param{const wxTreeItemId\&}{ item}}
274
275Returns the item label.
276
277\membersection{wxTreeCtrl::GetLastChild}\label{wxtreectrlgetlastchild}
278
279\constfunc{wxTreeItemId}{GetLastChild}{\param{const wxTreeItemId\&}{ item}}
280
281Returns the last child of the item (or 0 if this item has no children).
282
283\wxheading{See also}
284
285\helpref{GetFirstChild}{wxtreectrlgetfirstchild},
286\helpref{GetLastChild}{wxtreectrlgetlastchild}
287
288\membersection{wxTreeCtrl::GetNextChild}\label{wxtreectrlgetnextchild}
289
290\constfunc{wxTreeItemId}{GetNextChild}{\param{const wxTreeItemId\&}{ item}, \param{long\& }{cookie}}
291
292Returns the next child; call \helpref{wxTreeCtrl::GetFirstChild}{wxtreectrlgetfirstchild} for the first child.
293
294For this enumeration function you must pass in a `cookie' parameter
295which is opaque for the application but is necessary for the library
296to make these functions reentrant (i.e. allow more than one
297enumeration on one and the same object simultaneously). The cookie passed to
298GetFirstChild and GetNextChild should be the same.
299
300Returns 0 if there are no further children.
301
302\wxheading{See also}
303
304\helpref{wxTreeCtrl::GetFirstChild}{wxtreectrlgetfirstchild}
305
306\membersection{wxTreeCtrl::GetNextSibling}\label{wxtreectrlgetnextsibling}
307
308\constfunc{wxTreeItemId}{GetNextSibling}{\param{const wxTreeItemId\&}{ item}}
309
310Returns the next sibling of the specified item; call \helpref{wxTreeCtrl::GetPrevSibling}{wxtreectrlgetprevsibling} for the previous sibling.
311
312Returns 0 if there are no further siblings.
313
314\wxheading{See also}
315
316\helpref{wxTreeCtrl::GetPrevSibling}{wxtreectrlgetprevsibling}
317
318\membersection{wxTreeCtrl::GetNextVisible}\label{wxtreectrlgetnextvisible}
319
320\constfunc{wxTreeItemId}{GetNextVisible}{\param{const wxTreeItemId\&}{ item}}
321
322Returns the next visible item.
323
324\membersection{wxTreeCtrl::GetParent}\label{wxtreectrlgetparent}
325
326\constfunc{wxTreeItemId}{GetParent}{\param{const wxTreeItemId\&}{ item}}
327
328Returns the item's parent.
329
330\membersection{wxTreeCtrl::GetPrevSibling}\label{wxtreectrlgetprevsibling}
331
332\constfunc{wxTreeItemId}{GetPrevSibling}{\param{const wxTreeItemId\&}{ item}}
333
334Returns the previous sibling of the specified item; call \helpref{wxTreeCtrl::GetNextSibling}{wxtreectrlgetnextsibling} for the next sibling.
335
336Returns 0 if there are no further children.
337
338\wxheading{See also}
339
340\helpref{wxTreeCtrl::GetNextSibling}{wxtreectrlgetnextsibling}
341
342\membersection{wxTreeCtrl::GetPrevVisible}\label{wxtreectrlgetprevvisible}
343
344\constfunc{wxTreeItemId}{GetPrevVisible}{\param{const wxTreeItemId\&}{ item}}
345
346Returns the previous visible item.
347
348\membersection{wxTreeCtrl::GetRootItem}\label{wxtreectrlgetrootitem}
349
350\constfunc{wxTreeItemId}{GetRootItem}{\void}
351
352Returns the root item for the tree control.
353
354\membersection{wxTreeCtrl::GetSelectedItemImage}\label{wxtreectrlgetselecteditemimage}
355
356\constfunc{int}{GetSelectedItemImage}{\param{const wxTreeItemId\& }{item}}
357
358Gets the selected item image.
359
360\membersection{wxTreeCtrl::GetSelection}\label{wxtreectrlgetselection}
361
362\constfunc{wxTreeItemId}{GetSelection}{\void}
363
364Returns the selection, or 0 if there is no selection.
365
366\membersection{wxTreeCtrl::HitTest}\label{wxtreectrlhittest}
367
368\func{long}{HitTest}{\param{const wxPoint\& }{point}, \param{int\& }{flags}}
369
370Calculates which (if any) item is under the given point, returning extra information
371in {\it flags}. {\it flags} is a bitlist of the following:
372
373\twocolwidtha{5cm}
374\begin{twocollist}\itemsep=0pt
375\twocolitem{wxTREE\_HITTEST\_ABOVE}{Above the client area.}
376\twocolitem{wxTREE\_HITTEST\_BELOW}{Below the client area.}
377\twocolitem{wxTREE\_HITTEST\_NOWHERE}{In the client area but below the last item.}
378\twocolitem{wxTREE\_HITTEST\_ONITEMBUTTON}{On the button associated with an item.}
379\twocolitem{wxTREE\_HITTEST\_ONITEMICON}{On the bitmap associated with an item.}
380\twocolitem{wxTREE\_HITTEST\_ONITEMINDENT}{In the indentation associated with an item.}
381\twocolitem{wxTREE\_HITTEST\_ONITEMLABEL}{On the label (string) associated with an item.}
382\twocolitem{wxTREE\_HITTEST\_ONITEMRIGHT}{In the area to the right of an item.}
383\twocolitem{wxTREE\_HITTEST\_ONITEMSTATEICON}{On the state icon for a tree view item that is in a user-defined state.}
384\twocolitem{wxTREE\_HITTEST\_TOLEFT}{To the right of the client area.}
385\twocolitem{wxTREE\_HITTEST\_TORIGHT}{To the left of the client area.}
386\end{twocollist}
387
388\membersection{wxTreeCtrl::InsertItem}\label{wxtreectrlinsertitem}
389
390\func{wxTreeItemId}{InsertItem}{\param{const wxTreeItemId\& }{parent}, \param{const wxTreeItemId\& }{previous}, \param{const wxString\&}{ text},
391 \param{int}{ image = -1}, \param{int}{ selImage = -1}, \param{wxTreeItemData*}{ data = NULL}}
392
393Inserts an item after a given one.
394
395If {\it image} > -1 and {\it selImage} is -1, the same image is used for
396both selected and unselected items.
397
398\membersection{wxTreeCtrl::IsExpanded}\label{wxtreectrlisexpanded}
399
400\constfunc{bool}{IsExpanded}{\param{const wxTreeItemId\&}{ item}}
401
402Returns TRUE if the item is expanded (only makes sense if it has children).
403
404\membersection{wxTreeCtrl::IsSelected}\label{wxtreectrlisselected}
405
406\constfunc{bool}{IsSelected}{\param{const wxTreeItemId\&}{ item}}
407
408Returns TRUE if the item is selected.
409
410\membersection{wxTreeCtrl::IsVisible}\label{wxtreectrlisvisible}
411
412\constfunc{bool}{IsVisible}{\param{const wxTreeItemId\&}{ item}}
413
414Returns TRUE if the item is visible (it might be outside the view, or not expanded).
415
416\membersection{wxTreeCtrl::ItemHasChildren}\label{wxtreectrlitemhaschildren}
417
418\constfunc{bool}{ItemHasChildren}{\param{const wxTreeItemId\&}{ item}}
419
420Returns TRUE if the item has children.
421
422\membersection{wxTreeCtrl::PrependItem}\label{wxtreectrlprependitem}
423
424\func{wxTreeItemId}{PrependItem}{\param{const wxTreeItemId\& }{parent}, \param{const wxString\&}{ text},
425 \param{int}{ image = -1}, \param{int}{ selImage = -1}, \param{wxTreeItemData*}{ data = NULL}}
426
427Appends an item as the first child of {\it parent}, return a new item id.
428
429If {\it image} > -1 and {\it selImage} is -1, the same image is used for
430both selected and unselected items.
431
432\membersection{wxTreeCtrl::ScrollTo}\label{wxtreectrlscrollto}
433
434\func{void}{ScrollTo}{\param{const wxTreeItemId\&}{ item}}
435
436Scrolls the specified item into view.
437
438\membersection{wxTreeCtrl::SelectItem}\label{wxtreectrlselectitem}
439
440\func{bool}{SelectItem}{\param{const wxTreeItemId\&}{ item}}
441
442Selects the given item.
443
444\membersection{wxTreeCtrl::SetIndent}\label{wxtreectrlsetindent}
445
446\func{void}{SetIndent}{\param{int }{indent}}
447
448Sets the indentation for the tree control.
449
450\membersection{wxTreeCtrl::SetImageList}\label{wxtreectrlsetimagelist}
451
452\func{void}{SetImageList}{\param{wxImageList*}{ imageList}, \param{int }{which = wxIMAGE\_LIST\_NORMAL}}
453
454Sets the image list. {\it which} should be one of wxIMAGE\_LIST\_NORMAL, wxIMAGE\_LIST\_SMALL and
455wxIMAGE\_LIST\_STATE.
456
457\membersection{wxTreeCtrl::SetItemData}\label{wxtreectrlsetitemdata}
458
459\func{void}{SetItemData}{\param{const wxTreeItemId\&}{ item}, \param{wxTreeItemData* }{data}}
460
461Sets the item client data.
462
463\membersection{wxTreeCtrl::SetItemHasChildren}\label{wxtreectrlsetitemhaschildren}
464
465\func{void}{SetItemHasChildren}{\param{const wxTreeItemId\&}{ item}, \param{bool }{hasChildren = TRUE}}
466
467Force appearance of the button next to the item. This is useful to
468allow the user to expand the items which don't have any children now,
469but instead adding them only when needed, thus minimizing memory
470usage and loading time.
471
472\membersection{wxTreeCtrl::SetItemImage}\label{wxtreectrlsetitemimage}
473
474\func{void}{SetItemImage}{\param{const wxTreeItemId\&}{ item}, \param{int }{image}}
475
476Sets the normal item image. This is an index into the assciated image list.
477
478\membersection{wxTreeCtrl::SetItemSelectedImage}\label{wxtreectrlsetitemselectedimage}
479
480\func{void}{SetItemSelectedImage}{\param{const wxTreeItemId\&}{ item}, \param{int }{selImage}}
481
482Sets the item selected image. This is an index into the assciated image list.
483
484\membersection{wxTreeCtrl::SetItemText}\label{wxtreectrlsetitemtext}
485
486\func{void}{SetItemText}{\param{const wxTreeItemId\&}{ item}, \param{const wxString\& }{text}}
487
488Sets the item label.
489
490\membersection{wxTreeCtrl::SortChildren}\label{wxtreectrlsortchildren}
491
492\func{void}{SortChildren}{\param{const wxTreeItemId\&}{ item}, \param{wxTreeItemCmpFunc*}{ cmpFunction = NULL}}
493
494Sorts the children of the given item. If {\it cmpFunction} is NULL, sorts in ascending alphabetical order;
495otherwise the custom sort function is used, as follows:
496
497{\small
498\begin{verbatim}
499// a callback function used for sorting tree items, it should return -1 if the
500// first item precedes the second, +1 if the second precedes the first or 0 if
501// they're equivalent
502class wxTreeItemData;
503typedef int (*wxTreeItemCmpFunc)(wxTreeItemData *item1, wxTreeItemData *item2);
504\end{verbatim}
505}
506
507\wxheading{See also}
508
509\helpref{wxTreeItemData}{wxtreeitemdata}
510
511\membersection{wxTreeCtrl::Toggle}\label{wxtreectrltoggle}
512
513\func{void}{Toggle}{\param{const wxTreeItemId\&}{ item}}
514
515Toggles the given item between collapsed and expanded states.
516
517\membersection{wxTreeCtrl::Unselect}\label{wxtreectrlunselect}
518
519\func{void}{Unselect}{\void}
520
521Removes the selection from the currently selected item (if any).
522
523\section{\class{wxTreeItemData}}\label{wxtreeitemdata}
524
525wxTreeItemData is some (arbitrary) user class associated with some item. The
526main advantage of having this class (compared to the old untyped interface) is
527that wxTreeItemData's are destroyed automatically by the tree and, as this
528class has virtual dtor, it means that the memory will be automatically
529freed. We don't just use wxObject instead of wxTreeItemData because
530the size of this class is critical: in any real application, each tree leaf
531will have wxTreeItemData associated with it and number of leaves may be
532quite big.
533
534Because the objects of this class are deleted by the tree, they should
535always be allocated on the heap.
536
537\wxheading{Derived from}
538
539wxTreeItemId
540
541\wxheading{See also}
542
543\helpref{wxTreeCtrl}{wxtreectrl}
544
545\latexignore{\rtfignore{\wxheading{Members}}}
546
547\membersection{wxTreeItemData::wxTreeItemData}\label{wxtreeitemdataconstr}
548
549\func{}{wxTreeItemData}{\void}
550
551Default constructor.
552
553\membersection{wxTreeItemData::\destruct{wxTreeItemData}}
554
555\func{void}{\destruct{wxTreeItemData}}{\void}
556
557Virtual destructor.
558
559\membersection{wxTreeItemData::GetId}\label{wxtreeitemdatagetid}
560
561\func{const wxTreeItem\&}{GetId}{\void}
562
563Returns the item associated with this node.
564
565\membersection{wxTreeItemData::SetId}\label{wxtreeitemdatasetid}
566
567\func{void}{SetId}{\param{const wxTreeItemId\&}{ id}}
568
569Sets the item associated with this node.
570