]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/treebook.tex
Added wxToolbook class
[wxWidgets.git] / docs / latex / wx / treebook.tex
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %% Name: treebook.tex
3 %% Purpose: wxTreebook documentation
4 %% Author: Evgeniy Tarassov
5 %% Modified by:
6 %% Created: 2005-10-04
7 %% RCS-ID: $Id$
8 %% Copyright: (c) 2005 Vadim Zeitlin <vadim@wxwindows.org>
9 %% License: wxWindows license
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12 \section{\class{wxTreebook}}\label{wxtreebook}
13
14 This class is an extension of the Notebook class that allows a tree structured
15 set of pages to be shown in a control.
16 A classic example is a netscape preferences dialog that shows a tree
17 of preference sections on the left and select section page on the right.
18
19 To use the class simply create it and populate with pages using
20 \helpref{InsertPage}{wxtreebookinsertpage},
21 \helpref{AddPage}{wxtreebookaddpage},
22 \helpref{AddSubPage}{wxtreebookaddsubpage}.
23
24 If your tree is no more than 1 level in depth then you could
25 simply use \helpref{AddPage}{wxtreebookaddpage} and
26 \helpref{AddSubPage}{wxtreebookaddsubpage} to sequentially populate your tree
27 by adding at every step a page or a subpage to the end of the tree.
28
29
30 \wxheading{Derived from}
31
32 wxBookCtrlBase\\
33 \helpref{wxControl}{wxcontrol}\\
34 \helpref{wxWindow}{wxwindow}\\
35 \helpref{wxEvtHandler}{wxevthandler}\\
36 \helpref{wxObject}{wxobject}
37
38
39 \wxheading{Include files}
40
41 <wx/treebook.h>
42
43 \input treebookevt.inc
44
45
46 \wxheading{See also}
47
48 \helpref{wxNotebook}{wxnotebook}, \helpref{wxTreebookEvent}{wxtreebookevent}, \helpref{wxImageList}{wximagelist}, \helpref{notebook sample}{samplenotebook}
49
50
51
52 \latexignore{\rtfignore{\wxheading{Members}}}
53
54
55 \membersection{wxTreebook::wxTreebook}\label{wxtreebookwxtreebook}
56
57 \func{}{wxTreebook}{\void}
58
59 Default constructor.
60
61
62 \func{}{wxTreebook}{
63 \param{wxWindow* }{parent},
64 \param{wxWindowID }{id},
65 \param{const wxPoint\& }{pos = wxDefaultPosition},
66 \param{const wxSize\& }{size = wxDefaultSize},
67 \param{long }{style = wxTBK\_DEFAULT},
68 \param{const wxString\& }{name = wxEmptyString}}
69
70 Creates an empty TreeBook control.
71
72 \wxheading{Parameters}
73
74 \docparam{parent}{The parent window. Must be non-NULL.}
75
76 \docparam{id}{The window identifier.}
77
78 \docparam{pos}{The window position.}
79
80 \docparam{size}{The window size.}
81
82 \docparam{style}{The window style. See \helpref{wxNotebook}{wxnotebook}.}
83
84 \docparam{name}{The name of the control (used only under Motif).}
85
86
87
88 \membersection{wxTreebook::\destruct{wxTreebook}}\label{wxtreebookdtor}
89
90 \func{}{\destruct{wxTreebook}}{\void}
91
92 Destroys the wxTreebook object.
93
94 Also deletes all the pages owned by the control (inserted previously into it).
95
96
97
98 \membersection{wxTreebook::AddPage}\label{wxtreebookaddpage}
99
100 \func{bool}{AddPage}{
101 \param{wxWindow* }{page},
102 \param{const wxString\& }{text},
103 \param{bool }{bSelect = false},
104 \param{int }{imageId = wxNOT\_FOUND}}
105
106 Adds a new page. The page is placed at the topmost level after all other pages.
107 NULL could be specified for page to create an empty page.
108
109
110
111 \membersection{wxTreebook::AddSubPage}\label{wxtreebookaddsubpage}
112
113 \func{bool}{AddSubPage}{\param{wxWindow* }{page}, \param{const wxString\& }{text}, \param{bool }{bSelect = false}, \param{int }{imageId = wxNOT\_FOUND}}
114
115 \func{bool}{AddSubPage}{\param{size\_t }{pagePos}, \param{wxWindow* }{page}, \param{const wxString\& }{text}, \param{bool }{bSelect = false}, \param{int }{imageId = wxNOT\_FOUND}}
116
117 Adds a new child-page to either the last or the specified top-level.
118 NULL could be specified for page to create an empty page.
119
120
121
122 \membersection{wxTreebook::AssignImageList}\label{wxtreebookassignimagelist}
123
124 \func{void}{AssignImageList}{\param{wxImageList* }{imageList}}
125
126 Sets the image list for the page control and takes ownership of the list.
127
128 \wxheading{See also}
129
130 \helpref{wxImageList}{wximagelist}, \helpref{SetImageList}{wxtreebooksetimagelist}
131
132
133
134 \membersection{wxTreebook::CollapseNode}\label{wxtreebookcollapsenode}
135
136 \func{bool}{CollapseNode}{\param{size\_t }{pageId}}
137
138 Shortcut for \helpref{ExpandNode}{wxtreebookexpandnode}(pageId, false).
139
140
141
142 \membersection{wxTreebook::Create}\label{wxtreebookcreate}
143
144 \func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = wxTBK\_DEFAULT}, \param{const wxString\& }{name = wxEmptyString}}
145
146 Creates a treebook control. See \helpref{wxTreebook::wxTreebook}{wxtreebookwxtreebook} for the description of the parameters.
147
148
149
150 \membersection{wxTreebook::DeleteAllPages}\label{wxtreebookdeleteallpages}
151
152 \func{bool}{DeleteAllPages}{\void}
153
154 Deletes all pages inserted into the treebook. No event is generated.
155
156
157
158 \membersection{wxTreebook::DeletePage}\label{wxtreebookdeletepage}
159
160 \func{bool}{DeletePage}{\param{size\_t }{pagePos}}
161
162 Deletes the page at the specified position and all its children. Could trigger page selection change
163 in a case when selected page is removed. In that case its parent is selected
164 (or the next page if no parent).
165
166
167
168 \membersection{wxTreebook::ExpandNode}\label{wxtreebookexpandnode}
169
170 \func{bool}{ExpandNode}{\param{size\_t }{pageId}, \param{bool }{expand = true}}
171
172 Expands (collapses) the pageId node. Returns the previous state.
173 May generate page changing events (if selected page
174 is under the collapsed branch, then its parent is autoselected).
175
176
177 \membersection{wxTreebook::GetPageImage}\label{wxtreebookgetpageimage}
178
179 \constfunc{int}{GetPageImage}{\param{size\_t }{n}}
180
181 Returns the image index for the given page.
182
183
184 \membersection{wxTreebook::GetPageParent}\label{wxtreebookgetpageparent}
185
186 \constfunc{int}{GetPageParent}{\param{size\_t }{page}}
187
188 Returns the parent page of the given one or \texttt{wxNOT\_FOUND} if this is a
189 top-level page.
190
191
192 \membersection{wxTreebook::GetPageText}\label{wxtreebookgetpagetext}
193
194 \constfunc{wxString}{GetPageText}{\param{size\_t }{n}}
195
196 Returns the string for the given page.
197
198
199
200 \membersection{wxTreebook::GetSelection}\label{wxtreebookgetselection}
201
202 \constfunc{int}{GetSelection}{\void}
203
204 Returns the currently selected page, or wxNOT\_FOUND if none was selected.
205
206 Note that this method may return either the previously or newly selected page
207 when called from the EVT\_TREEBOOK\_PAGE\_CHANGED handler
208 depending on the platform and so wxTreebookEvent::GetSelection should be used instead in this case.
209
210
211
212 \membersection{wxTreebook::InsertPage}\label{wxtreebookinsertpage}
213
214 \func{bool}{InsertPage}{\param{size\_t }{pagePos}, \param{wxWindow* }{page}, \param{const wxString\& }{text}, \param{bool }{bSelect = false}, \param{int }{imageId = wxNOT\_FOUND}}
215
216 Inserts a new page just before the page indicated by pagePos.
217 The new page is placed before pagePos page and on the same level.
218 NULL could be specified for page to create an empty page.
219
220
221 \membersection{wxTreebook::IsNodeExpanded}\label{wxtreebookisnodeexpanded}
222
223 \constfunc{bool}{IsNodeExpanded}{\param{size\_t }{pageId}}
224
225 Gets the pagePos page state -- whether it is expanded or collapsed
226
227
228
229 \membersection{wxTreebook::SetImageList}\label{wxtreebooksetimagelist}
230
231 \func{void}{SetImageList}{\param{wxImageList* }{imageList}}
232
233 Sets the image list for the page control. It does not take ownership of the image list, you must delete it yourself.
234
235 \wxheading{See also}
236
237 \helpref{wxImageList}{wximagelist}, \helpref{AssignImageList}{wxtreebookassignimagelist}
238
239
240
241 \membersection{wxTreebook::SetPageImage}\label{wxtreebooksetpageimage}
242
243 \func{bool}{SetPageImage}{\param{size\_t }{page}, \param{int }{imageId}}
244
245 Sets the image index for the given page. ImageId is an index into the image list
246 which was set with \helpref{SetImageList}{wxtreebooksetimagelist}.
247
248
249
250 \membersection{wxTreebook::SetPageText}\label{wxtreebooksetpagetext}
251
252 \func{bool}{SetPageText}{\param{size\_t }{page}, \param{const wxString\& }{text}}
253
254 Sets the text for the given page.
255
256
257
258 \membersection{wxTreebook::SetSelection}\label{wxtreebooksetselection}
259
260 \func{int}{SetSelection}{\param{size\_t }{n}}
261
262 Sets the selection for the given page, returning the previous selection.
263
264 The call to this function generates the page changing events.
265
266 \wxheading{See also}
267
268 \helpref{wxTreebook::GetSelection}{wxtreebookgetselection}
269