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