]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/notebook.tex
compilation fixed after recent wxHTML changes
[wxWidgets.git] / docs / latex / wx / notebook.tex
CommitLineData
3972fb49
JS
1\section{\class{wxNotebook}}\label{wxnotebook}
2
3This class represents a notebook control, which manages multiple windows with associated tabs.
4
5To use the class, create a wxNotebook object and call \helpref{AddPage}{wxnotebookaddpage} or \helpref{InsertPage}{wxnotebookinsertpage},
6passing a window to be used as the page. Do not explicitly delete the window for a page that is currently
7managed 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
954b8ae6
JS
18\wxheading{Include files}
19
20<wx/notebook.h>
21
da27bd0b
VZ
22\wxheading{Window styles}
23
24\twocolwidtha{5cm}
25\begin{twocollist}\itemsep=0pt
f6bcfd97 26
6390284b
JS
27\twocolitem{\windowstyle{wxNB\_LEFT}}{Place tabs on the left side. Not supported under Windows XP.}
28\twocolitem{\windowstyle{wxNB\_RIGHT}}{Place tabs on the right side. Not supported under Windows XP.}
29\twocolitem{\windowstyle{wxNB\_BOTTOM}}{Place tabs under instead of above the notebook pages. Not supported under Windows XP.}
2b5f62a0
VZ
30\twocolitem{\windowstyle{wxNB\_FIXEDWIDTH}}{(Windows only) All tabs will have same width.}
31\twocolitem{\windowstyle{wxNB\_MULTILINE}}{(Windows only) There can be several rows of tabs.}
f6bcfd97 32
da27bd0b
VZ
33\end{twocollist}
34
f6bcfd97
BP
35See also \helpref{window styles overview}{windowstyles}.
36
1d2bd847 37\input noteevt.inc
3972fb49
JS
38
39\wxheading{See also}
40
41\helpref{wxNotebookEvent}{wxnotebookevent}, \helpref{wxImageList}{wximagelist},\rtfsp
42\helpref{wxTabCtrl}{wxtabctrl}
43
44\latexignore{\rtfignore{\wxheading{Members}}}
45
46\membersection{wxNotebook::wxNotebook}\label{wxnotebookconstr}
47
48\func{}{wxNotebook}{\void}
49
50Default constructor.
51
52\func{}{wxNotebook}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id}, \param{const wxPoint\&}{ pos = wxDefaultPosition},
e480a80a 53 \param{const wxSize\&}{ size = wxDefaultSize}, \param{long}{ style = 0}, \param{const wxString\& }{name = "notebook"}}
3972fb49
JS
54
55Constructs a notebook control.
56
5fa399c9
JS
57Note that sometimes you can reduce flicker by passing the wxCLIP\_CHILDREN window style.
58
3972fb49
JS
59\wxheading{Parameters}
60
61\docparam{parent}{The parent window. Must be non-NULL.}
62
63\docparam{id}{The window identifier.}
64
65\docparam{pos}{The window position.}
66
67\docparam{size}{The window size.}
68
f6bcfd97 69\docparam{style}{The window style. See \helpref{wxNotebook}{wxnotebook}.}
3972fb49 70
8c517ddd
VZ
71\docparam{name}{The name of the control (used only under Motif).}
72
3972fb49
JS
73\membersection{wxNotebook::\destruct{wxNotebook}}
74
75\func{}{\destruct{wxNotebook}}{\void}
76
77Destroys the wxNotebook object.
78
79\membersection{wxNotebook::AddPage}\label{wxnotebookaddpage}
80
81\func{bool}{AddPage}{\param{wxNotebookPage*}{ page},
82 \param{const wxString\&}{ text},
cc81d32f 83 \param{bool}{ select = false},
3972fb49
JS
84 \param{int}{ imageId = -1}}
85
86Adds a new page.
87
88\wxheading{Parameters}
89
90\docparam{page}{Specifies the new page.}
91
92\docparam{text}{Specifies the text for the new page.}
93
94\docparam{select}{Specifies whether the page should be selected.}
95
96\docparam{imageId}{Specifies the optional image index for the new page.}
97
98\wxheading{Return value}
99
cc81d32f 100true if successful, false otherwise.
3972fb49
JS
101
102\wxheading{Remarks}
103
104Do not delete the page, it will be deleted by the notebook.
105
106\wxheading{See also}
107
108\helpref{wxNotebook::InsertPage}{wxnotebookinsertpage}
109
110\membersection{wxNotebook::AdvanceSelection}\label{wxnotebookadvanceselection}
111
cc81d32f 112\func{void}{AdvanceSelection}{\param{bool}{ forward = true}}
3972fb49
JS
113
114Cycles through the tabs.
115
b656febd
VS
116\membersection{wxNotebook::AssignImageList}\label{wxnotebookassignimagelist}
117
118\func{void}{AssignImageList}{\param{wxImageList*}{ imageList}}
119
120Sets the image list for the page control and takes ownership of
121the list.
122
123\wxheading{See also}
124
125\helpref{wxImageList}{wximagelist},
126\helpref{SetImageList}{wxnotebooksetimagelist}
127
3972fb49
JS
128\membersection{wxNotebook::Create}\label{wxnotebookcreate}
129
130\func{bool}{Create}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id}, \param{const wxPoint\&}{ pos = wxDefaultPosition},
131 \param{const wxSize\&}{ size}, \param{long}{ style = 0}, \param{const wxString\& }{name = "notebook"}}
132
133Creates a notebook control. See \helpref{wxNotebook::wxNotebook}{wxnotebookconstr} for a description
134of the parameters.
135
136\membersection{wxNotebook::DeleteAllPages}\label{wxnotebookdeleteallpages}
137
138\func{bool}{DeleteAllPages}{\void}
139
140Deletes all pages.
141
142\membersection{wxNotebook::DeletePage}\label{wxnotebookdeletepage}
143
144\func{bool}{DeletePage}{\param{int}{ page}}
145
621793f4 146Deletes the specified page, and the associated window.
3972fb49
JS
147
148\membersection{wxNotebook::GetImageList}\label{wxnotebookgetimagelist}
149
150\constfunc{wxImageList*}{GetImageList}{\void}
151
152Returns the associated image list.
153
154\wxheading{See also}
155
156\helpref{wxImageList}{wximagelist}, \helpref{wxNotebook::SetImageList}{wxnotebooksetimagelist}
157
158\membersection{wxNotebook::GetPage}\label{wxnotebookgetpage}
159
160\func{wxNotebookPage*}{GetPage}{\param{int}{ page}}
161
162Returns the window at the given page position.
163
164\membersection{wxNotebook::GetPageCount}\label{wxnotebookgetpagecount}
165
166\constfunc{int}{GetPageCount}{\void}
167
168Returns the number of pages in the notebook control.
169
170\membersection{wxNotebook::GetPageImage}\label{wxnotebookgetpageimage}
171
f6bcfd97 172\constfunc{int}{GetPageImage}{\param{int }{nPage}}
3972fb49
JS
173
174Returns the image index for the given page.
175
176\membersection{wxNotebook::GetPageText}\label{wxnotebookgetpagetext}
177
f6bcfd97 178\constfunc{wxString}{GetPageText}{\param{int }{nPage}}
3972fb49
JS
179
180Returns the string for the given page.
181
182\membersection{wxNotebook::GetRowCount}\label{wxnotebookgetrowcount}
183
184\constfunc{int}{GetRowCount}{\void}
185
186Returns the number of rows in the notebook control.
187
188\membersection{wxNotebook::GetSelection}\label{wxnotebookgetselection}
189
190\constfunc{int}{GetSelection}{\void}
191
f0125ede
VZ
192Returns the currently selected page, or $-1$ if none was selected.
193
194Note that this method may return either the previously or newly selected page
195when called from the {\tt EVT\_NOTEBOOK\_PAGE\_CHANGED} handler depending on
196the platform and so\rtfsp
197\helpref{wxNotebookEvent::GetSelection}{wxnotebookeventgetselection} should be
198used instead in this case.
3972fb49
JS
199
200\membersection{wxNotebook::InsertPage}\label{wxnotebookinsertpage}
201
202\func{bool}{InsertPage}{\param{int}{ index}, \param{wxNotebookPage*}{ page},
203 \param{const wxString\&}{ text},
cc81d32f 204 \param{bool}{ select = false},
3972fb49
JS
205 \param{int}{ imageId = -1}}
206
207Inserts a new page at the specified position.
208
209\wxheading{Parameters}
210
211\docparam{index}{Specifies the position for the new page.}
212
213\docparam{page}{Specifies the new page.}
214
215\docparam{text}{Specifies the text for the new page.}
216
217\docparam{select}{Specifies whether the page should be selected.}
218
219\docparam{imageId}{Specifies the optional image index for the new page.}
220
221\wxheading{Return value}
222
cc81d32f 223true if successful, false otherwise.
3972fb49
JS
224
225\wxheading{Remarks}
226
227Do not delete the page, it will be deleted by the notebook.
228
229\wxheading{See also}
230
231\helpref{wxNotebook::AddPage}{wxnotebookaddpage}
232
233\membersection{wxNotebook::OnSelChange}\label{wxnotebookonselchange}
234
235\func{void}{OnSelChange}{\param{wxNotebookEvent\&}{ event}}
236
237An event handler function, called when the page selection is changed.
238
239\wxheading{See also}
240
241\helpref{wxNotebookEvent}{wxnotebookevent}
242
621793f4
JS
243\membersection{wxNotebook::RemovePage}\label{wxnotebookremovepage}
244
245\func{bool}{RemovePage}{\param{int}{ page}}
246
247Deletes the specified page, without deleting the associated window.
248
3972fb49
JS
249\membersection{wxNotebook::SetImageList}\label{wxnotebooksetimagelist}
250
251\func{void}{SetImageList}{\param{wxImageList*}{ imageList}}
252
b656febd
VS
253Sets the image list for the page control. It does not take
254ownership of the image list, you must delete it yourself.
3972fb49
JS
255
256\wxheading{See also}
257
b656febd
VS
258\helpref{wxImageList}{wximagelist},
259\helpref{AssignImageList}{wxnotebookassignimagelist}
3972fb49
JS
260
261\membersection{wxNotebook::SetPadding}\label{wxnotebooksetpadding}
262
263\func{void}{SetPadding}{\param{const wxSize\&}{ padding}}
264
265Sets the amount of space around each page's icon and label, in pixels.
266
b318dc42
JS
267{\bf NB:} The vertical padding cannot be changed in wxGTK.
268
3972fb49
JS
269\membersection{wxNotebook::SetPageSize}\label{wxnotebooksetpagesize}
270
271\func{void}{SetPageSize}{\param{const wxSize\&}{ size}}
272
273Sets the width and height of the pages.
274
b318dc42
JS
275{\bf NB:} This method is currently not implemented for wxGTK.
276
3972fb49
JS
277\membersection{wxNotebook::SetPageImage}\label{wxnotebooksetpageimage}
278
279\func{bool}{SetPageImage}{\param{int}{ page}, \param{int }{image}}
280
281Sets the image index for the given page. {\it image} is an index into
282the image list which was set with \helpref{wxNotebook::SetImageList}{wxnotebooksetimagelist}.
283
284\membersection{wxNotebook::SetPageText}\label{wxnotebooksetpagetext}
285
286\func{bool}{SetPageText}{\param{int}{ page}, \param{const wxString\& }{text}}
287
288Sets the text for the given page.
289
290\membersection{wxNotebook::SetSelection}\label{wxnotebooksetselection}
291
292\func{int}{SetSelection}{\param{int}{ page}}
293
294Sets the selection for the given page, returning the previous selection.
295
296\wxheading{See also}
297
298\helpref{wxNotebook::GetSelection}{wxnotebookgetselection}
299
300