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