]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/notebook.tex
wxThread::Kill() doesn't call OnExit() incorrectly
[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.}
30 \twocolitem{{\bf EVT\_NOTEBOOK\_PAGE\_CHANGING(id, func)}}{The page selection is about to be changed.
31 This can be prevented by calling \helpref{Veto()}{wxnotifyeventveto}.}
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
45 Default 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
50 Constructs a notebook control.
51
52 Note that sometimes you can reduce flicker by passing the wxCLIP\_CHILDREN window style.
53
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
67 \docparam{name}{The name of the control (used only under Motif).}
68
69 \membersection{wxNotebook::\destruct{wxNotebook}}
70
71 \func{}{\destruct{wxNotebook}}{\void}
72
73 Destroys 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
82 Adds 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
96 TRUE if successful, FALSE otherwise.
97
98 \wxheading{Remarks}
99
100 Do 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
110 Cycles 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
117 Creates a notebook control. See \helpref{wxNotebook::wxNotebook}{wxnotebookconstr} for a description
118 of the parameters.
119
120 \membersection{wxNotebook::DeleteAllPages}\label{wxnotebookdeleteallpages}
121
122 \func{bool}{DeleteAllPages}{\void}
123
124 Deletes all pages.
125
126 \membersection{wxNotebook::DeletePage}\label{wxnotebookdeletepage}
127
128 \func{bool}{DeletePage}{\param{int}{ page}}
129
130 Deletes the specified page, and the associated window.
131
132 \membersection{wxNotebook::GetImageList}\label{wxnotebookgetimagelist}
133
134 \constfunc{wxImageList*}{GetImageList}{\void}
135
136 Returns 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
146 Returns the window at the given page position.
147
148 \membersection{wxNotebook::GetPageCount}\label{wxnotebookgetpagecount}
149
150 \constfunc{int}{GetPageCount}{\void}
151
152 Returns the number of pages in the notebook control.
153
154 \membersection{wxNotebook::GetPageImage}\label{wxnotebookgetpageimage}
155
156 \constfunc{int}{GetPageImage}{\void}
157
158 Returns the image index for the given page.
159
160 \membersection{wxNotebook::GetPageText}\label{wxnotebookgetpagetext}
161
162 \constfunc{wxString}{GetPageText}{\void}
163
164 Returns the string for the given page.
165
166 \membersection{wxNotebook::GetRowCount}\label{wxnotebookgetrowcount}
167
168 \constfunc{int}{GetRowCount}{\void}
169
170 Returns the number of rows in the notebook control.
171
172 \membersection{wxNotebook::GetSelection}\label{wxnotebookgetselection}
173
174 \constfunc{int}{GetSelection}{\void}
175
176 Returns 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
185 Inserts 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
201 TRUE if successful, FALSE otherwise.
202
203 \wxheading{Remarks}
204
205 Do 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
215 An event handler function, called when the page selection is changed.
216
217 \wxheading{See also}
218
219 \helpref{wxNotebookEvent}{wxnotebookevent}
220
221 \membersection{wxNotebook::RemovePage}\label{wxnotebookremovepage}
222
223 \func{bool}{RemovePage}{\param{int}{ page}}
224
225 Deletes the specified page, without deleting the associated window.
226
227 \membersection{wxNotebook::SetImageList}\label{wxnotebooksetimagelist}
228
229 \func{void}{SetImageList}{\param{wxImageList*}{ imageList}}
230
231 Sets 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
241 Sets 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
247 Sets 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
253 Sets the image index for the given page. {\it image} is an index into
254 the 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
260 Sets the text for the given page.
261
262 \membersection{wxNotebook::SetSelection}\label{wxnotebooksetselection}
263
264 \func{int}{SetSelection}{\param{int}{ page}}
265
266 Sets the selection for the given page, returning the previous selection.
267
268 \wxheading{See also}
269
270 \helpref{wxNotebook::GetSelection}{wxnotebookgetselection}
271
272