]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/notebook.tex
Added 'Include files' section to class references
[wxWidgets.git] / docs / latex / wx / notebook.tex
1 \section{\class{wxNotebook}}\label{wxnotebook}
2
3 This class represents a notebook control, which manages multiple windows with associated tabs.
4
5 To use the class, create a wxNotebook object and call \helpref{AddPage}{wxnotebookaddpage} or \helpref{InsertPage}{wxnotebookinsertpage},
6 passing a window to be used as the page. Do not explicitly delete the window for a page that is currently
7 managed by wxNotebook.
8
9 {\bf wxNotebookPage} is a typedef for wxWindow.
10
11 \wxheading{Derived from}
12
13 \helpref{wxControl}{wxcontrol}\\
14 \helpref{wxWindow}{wxwindow}\\
15 \helpref{wxEvtHandler}{wxevthandler}\\
16 \helpref{wxObject}{wxobject}
17
18 \wxheading{Include files}
19
20 <wx/notebook.h>
21
22 \wxheading{Event handling}
23
24 To process input from a notebook control, use the following event handler macros to direct input to member
25 functions that take a \helpref{wxNotebookEvent}{wxnotebookevent} argument.
26
27 \twocolwidtha{7cm}
28 \begin{twocollist}\itemsep=0pt
29 \twocolitem{{\bf EVT\_NOTEBOOK\_PAGE\_CHANGED(id, func)}}{The page selection was changed. Processes a
30 wxEVT\_COMMAND\_NOTEBOOK\_PAGE\_CHANGED event.}
31 \twocolitem{{\bf EVT\_NOTEBOOK\_PAGE\_CHANGING(id, func)}}{The page selection is about to be changed.
32 Processes a wxEVT\_COMMAND\_NOTEBOOK\_PAGE\_CHANGING event.}
33 \end{twocollist}%
34
35 \wxheading{See also}
36
37 \helpref{wxNotebookEvent}{wxnotebookevent}, \helpref{wxImageList}{wximagelist},\rtfsp
38 \helpref{wxTabCtrl}{wxtabctrl}
39
40 \latexignore{\rtfignore{\wxheading{Members}}}
41
42 \membersection{wxNotebook::wxNotebook}\label{wxnotebookconstr}
43
44 \func{}{wxNotebook}{\void}
45
46 Default constructor.
47
48 \func{}{wxNotebook}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id}, \param{const wxPoint\&}{ pos = wxDefaultPosition},
49 \param{const wxSize\&}{ size}, \param{long}{ style = 0}, \param{const wxString\& }{name = "notebook"}}
50
51 Constructs a notebook control.
52
53 \wxheading{Parameters}
54
55 \docparam{parent}{The parent window. Must be non-NULL.}
56
57 \docparam{id}{The window identifier.}
58
59 \docparam{pos}{The window position.}
60
61 \docparam{size}{The window size.}
62
63 \docparam{style}{The window style. Its value is a bit list of zero or more of {\bf wxTC\_MULTILINE},
64 {\bf wxTC\_RIGHTJUSTIFY}, {\bf wxTC\_FIXEDWIDTH} and {\bf wxTC\_OWNERDRAW}.}
65
66 \membersection{wxNotebook::\destruct{wxNotebook}}
67
68 \func{}{\destruct{wxNotebook}}{\void}
69
70 Destroys the wxNotebook object.
71
72 \membersection{wxNotebook::AddPage}\label{wxnotebookaddpage}
73
74 \func{bool}{AddPage}{\param{wxNotebookPage*}{ page},
75 \param{const wxString\&}{ text},
76 \param{bool}{ select = FALSE},
77 \param{int}{ imageId = -1}}
78
79 Adds a new page.
80
81 \wxheading{Parameters}
82
83 \docparam{page}{Specifies the new page.}
84
85 \docparam{text}{Specifies the text for the new page.}
86
87 \docparam{select}{Specifies whether the page should be selected.}
88
89 \docparam{imageId}{Specifies the optional image index for the new page.}
90
91 \wxheading{Return value}
92
93 TRUE if successful, FALSE otherwise.
94
95 \wxheading{Remarks}
96
97 Do not delete the page, it will be deleted by the notebook.
98
99 \wxheading{See also}
100
101 \helpref{wxNotebook::InsertPage}{wxnotebookinsertpage}
102
103 \membersection{wxNotebook::AdvanceSelection}\label{wxnotebookadvanceselection}
104
105 \func{void}{AdvanceSelection}{\param{bool}{ forward = TRUE}}
106
107 Cycles through the tabs.
108
109 \membersection{wxNotebook::Create}\label{wxnotebookcreate}
110
111 \func{bool}{Create}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id}, \param{const wxPoint\&}{ pos = wxDefaultPosition},
112 \param{const wxSize\&}{ size}, \param{long}{ style = 0}, \param{const wxString\& }{name = "notebook"}}
113
114 Creates a notebook control. See \helpref{wxNotebook::wxNotebook}{wxnotebookconstr} for a description
115 of the parameters.
116
117 \membersection{wxNotebook::DeleteAllPages}\label{wxnotebookdeleteallpages}
118
119 \func{bool}{DeleteAllPages}{\void}
120
121 Deletes all pages.
122
123 \membersection{wxNotebook::DeletePage}\label{wxnotebookdeletepage}
124
125 \func{bool}{DeletePage}{\param{int}{ page}}
126
127 Deletes the specified page, and the associated window.
128
129 \membersection{wxNotebook::GetImageList}\label{wxnotebookgetimagelist}
130
131 \constfunc{wxImageList*}{GetImageList}{\void}
132
133 Returns the associated image list.
134
135 \wxheading{See also}
136
137 \helpref{wxImageList}{wximagelist}, \helpref{wxNotebook::SetImageList}{wxnotebooksetimagelist}
138
139 \membersection{wxNotebook::GetPage}\label{wxnotebookgetpage}
140
141 \func{wxNotebookPage*}{GetPage}{\param{int}{ page}}
142
143 Returns the window at the given page position.
144
145 \membersection{wxNotebook::GetPageCount}\label{wxnotebookgetpagecount}
146
147 \constfunc{int}{GetPageCount}{\void}
148
149 Returns the number of pages in the notebook control.
150
151 \membersection{wxNotebook::GetPageImage}\label{wxnotebookgetpageimage}
152
153 \constfunc{int}{GetPageImage}{\void}
154
155 Returns the image index for the given page.
156
157 \membersection{wxNotebook::GetPageText}\label{wxnotebookgetpagetext}
158
159 \constfunc{wxString}{GetPageText}{\void}
160
161 Returns the string for the given page.
162
163 \membersection{wxNotebook::GetRowCount}\label{wxnotebookgetrowcount}
164
165 \constfunc{int}{GetRowCount}{\void}
166
167 Returns the number of rows in the notebook control.
168
169 \membersection{wxNotebook::GetSelection}\label{wxnotebookgetselection}
170
171 \constfunc{int}{GetSelection}{\void}
172
173 Returns the currently selected page, or -1 if none was selected.
174
175 \membersection{wxNotebook::InsertPage}\label{wxnotebookinsertpage}
176
177 \func{bool}{InsertPage}{\param{int}{ index}, \param{wxNotebookPage*}{ page},
178 \param{const wxString\&}{ text},
179 \param{bool}{ select = FALSE},
180 \param{int}{ imageId = -1}}
181
182 Inserts a new page at the specified position.
183
184 \wxheading{Parameters}
185
186 \docparam{index}{Specifies the position for the new page.}
187
188 \docparam{page}{Specifies the new page.}
189
190 \docparam{text}{Specifies the text for the new page.}
191
192 \docparam{select}{Specifies whether the page should be selected.}
193
194 \docparam{imageId}{Specifies the optional image index for the new page.}
195
196 \wxheading{Return value}
197
198 TRUE if successful, FALSE otherwise.
199
200 \wxheading{Remarks}
201
202 Do not delete the page, it will be deleted by the notebook.
203
204 \wxheading{See also}
205
206 \helpref{wxNotebook::AddPage}{wxnotebookaddpage}
207
208 \membersection{wxNotebook::OnSelChange}\label{wxnotebookonselchange}
209
210 \func{void}{OnSelChange}{\param{wxNotebookEvent\&}{ event}}
211
212 An event handler function, called when the page selection is changed.
213
214 \wxheading{See also}
215
216 \helpref{wxNotebookEvent}{wxnotebookevent}
217
218 \membersection{wxNotebook::RemovePage}\label{wxnotebookremovepage}
219
220 \func{bool}{RemovePage}{\param{int}{ page}}
221
222 Deletes the specified page, without deleting the associated window.
223
224 \membersection{wxNotebook::SetImageList}\label{wxnotebooksetimagelist}
225
226 \func{void}{SetImageList}{\param{wxImageList*}{ imageList}}
227
228 Sets the image list for the page control.
229
230 \wxheading{See also}
231
232 \helpref{wxImageList}{wximagelist}
233
234 \membersection{wxNotebook::SetPadding}\label{wxnotebooksetpadding}
235
236 \func{void}{SetPadding}{\param{const wxSize\&}{ padding}}
237
238 Sets the amount of space around each page's icon and label, in pixels.
239
240 \membersection{wxNotebook::SetPageSize}\label{wxnotebooksetpagesize}
241
242 \func{void}{SetPageSize}{\param{const wxSize\&}{ size}}
243
244 Sets the width and height of the pages.
245
246 \membersection{wxNotebook::SetPageImage}\label{wxnotebooksetpageimage}
247
248 \func{bool}{SetPageImage}{\param{int}{ page}, \param{int }{image}}
249
250 Sets the image index for the given page. {\it image} is an index into
251 the image list which was set with \helpref{wxNotebook::SetImageList}{wxnotebooksetimagelist}.
252
253 \membersection{wxNotebook::SetPageText}\label{wxnotebooksetpagetext}
254
255 \func{bool}{SetPageText}{\param{int}{ page}, \param{const wxString\& }{text}}
256
257 Sets the text for the given page.
258
259 \membersection{wxNotebook::SetSelection}\label{wxnotebooksetselection}
260
261 \func{int}{SetSelection}{\param{int}{ page}}
262
263 Sets the selection for the given page, returning the previous selection.
264
265 \wxheading{See also}
266
267 \helpref{wxNotebook::GetSelection}{wxnotebookgetselection}
268
269