]>
Commit | Line | Data |
---|---|---|
3972fb49 JS |
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{Event handling} | |
19 | ||
20 | To process input from a notebook control, use the following event handler macros to direct input to member | |
21 | functions that take a \helpref{wxNotebookEvent}{wxnotebookevent} argument. | |
22 | ||
23 | \twocolwidtha{7cm} | |
24 | \begin{twocollist}\itemsep=0pt | |
e79848ac | 25 | \twocolitem{{\bf EVT\_NOTEBOOK\_PAGE\_CHANGED(id, func)}}{The page selection was changed. Processes a |
3972fb49 | 26 | wxEVT\_COMMAND\_NOTEBOOK\_PAGE\_CHANGED event.} |
e79848ac | 27 | \twocolitem{{\bf EVT\_NOTEBOOK\_PAGE\_CHANGING(id, func)}}{The page selection is about to be changed. |
3972fb49 JS |
28 | Processes 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 | ||
42 | Default 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 | ||
47 | Constructs 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 | ||
66 | Destroys 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 | ||
75 | Adds 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 | ||
89 | TRUE if successful, FALSE otherwise. | |
90 | ||
91 | \wxheading{Remarks} | |
92 | ||
93 | Do 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 | ||
103 | Cycles 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 | ||
110 | Creates a notebook control. See \helpref{wxNotebook::wxNotebook}{wxnotebookconstr} for a description | |
111 | of the parameters. | |
112 | ||
113 | \membersection{wxNotebook::DeleteAllPages}\label{wxnotebookdeleteallpages} | |
114 | ||
115 | \func{bool}{DeleteAllPages}{\void} | |
116 | ||
117 | Deletes all pages. | |
118 | ||
119 | \membersection{wxNotebook::DeletePage}\label{wxnotebookdeletepage} | |
120 | ||
121 | \func{bool}{DeletePage}{\param{int}{ page}} | |
122 | ||
621793f4 | 123 | Deletes the specified page, and the associated window. |
3972fb49 JS |
124 | |
125 | \membersection{wxNotebook::GetImageList}\label{wxnotebookgetimagelist} | |
126 | ||
127 | \constfunc{wxImageList*}{GetImageList}{\void} | |
128 | ||
129 | Returns 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 | ||
139 | Returns the window at the given page position. | |
140 | ||
141 | \membersection{wxNotebook::GetPageCount}\label{wxnotebookgetpagecount} | |
142 | ||
143 | \constfunc{int}{GetPageCount}{\void} | |
144 | ||
145 | Returns the number of pages in the notebook control. | |
146 | ||
147 | \membersection{wxNotebook::GetPageImage}\label{wxnotebookgetpageimage} | |
148 | ||
149 | \constfunc{int}{GetPageImage}{\void} | |
150 | ||
151 | Returns the image index for the given page. | |
152 | ||
153 | \membersection{wxNotebook::GetPageText}\label{wxnotebookgetpagetext} | |
154 | ||
155 | \constfunc{wxString}{GetPageText}{\void} | |
156 | ||
157 | Returns the string for the given page. | |
158 | ||
159 | \membersection{wxNotebook::GetRowCount}\label{wxnotebookgetrowcount} | |
160 | ||
161 | \constfunc{int}{GetRowCount}{\void} | |
162 | ||
163 | Returns the number of rows in the notebook control. | |
164 | ||
165 | \membersection{wxNotebook::GetSelection}\label{wxnotebookgetselection} | |
166 | ||
167 | \constfunc{int}{GetSelection}{\void} | |
168 | ||
169 | Returns 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 | ||
178 | Inserts 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 | ||
194 | TRUE if successful, FALSE otherwise. | |
195 | ||
196 | \wxheading{Remarks} | |
197 | ||
198 | Do 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 | ||
208 | An event handler function, called when the page selection is changed. | |
209 | ||
210 | \wxheading{See also} | |
211 | ||
212 | \helpref{wxNotebookEvent}{wxnotebookevent} | |
213 | ||
621793f4 JS |
214 | \membersection{wxNotebook::RemovePage}\label{wxnotebookremovepage} |
215 | ||
216 | \func{bool}{RemovePage}{\param{int}{ page}} | |
217 | ||
218 | Deletes the specified page, without deleting the associated window. | |
219 | ||
3972fb49 JS |
220 | \membersection{wxNotebook::SetImageList}\label{wxnotebooksetimagelist} |
221 | ||
222 | \func{void}{SetImageList}{\param{wxImageList*}{ imageList}} | |
223 | ||
224 | Sets the image list for the page control. | |
225 | ||
226 | \wxheading{See also} | |
227 | ||
228 | \helpref{wxImageList}{wximagelist} | |
229 | ||
230 | \membersection{wxNotebook::SetPadding}\label{wxnotebooksetpadding} | |
231 | ||
232 | \func{void}{SetPadding}{\param{const wxSize\&}{ padding}} | |
233 | ||
234 | Sets the amount of space around each page's icon and label, in pixels. | |
235 | ||
236 | \membersection{wxNotebook::SetPageSize}\label{wxnotebooksetpagesize} | |
237 | ||
238 | \func{void}{SetPageSize}{\param{const wxSize\&}{ size}} | |
239 | ||
240 | Sets the width and height of the pages. | |
241 | ||
242 | \membersection{wxNotebook::SetPageImage}\label{wxnotebooksetpageimage} | |
243 | ||
244 | \func{bool}{SetPageImage}{\param{int}{ page}, \param{int }{image}} | |
245 | ||
246 | Sets the image index for the given page. {\it image} is an index into | |
247 | the image list which was set with \helpref{wxNotebook::SetImageList}{wxnotebooksetimagelist}. | |
248 | ||
249 | \membersection{wxNotebook::SetPageText}\label{wxnotebooksetpagetext} | |
250 | ||
251 | \func{bool}{SetPageText}{\param{int}{ page}, \param{const wxString\& }{text}} | |
252 | ||
253 | Sets the text for the given page. | |
254 | ||
255 | \membersection{wxNotebook::SetSelection}\label{wxnotebooksetselection} | |
256 | ||
257 | \func{int}{SetSelection}{\param{int}{ page}} | |
258 | ||
259 | Sets the selection for the given page, returning the previous selection. | |
260 | ||
261 | \wxheading{See also} | |
262 | ||
263 | \helpref{wxNotebook::GetSelection}{wxnotebookgetselection} | |
264 | ||
265 |