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