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