1 \section{\class{wxNotebook
}}\label{wxnotebook
}
3 This class represents a notebook control, which manages multiple windows with associated tabs.
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
9 {\bf wxNotebookPage
} is a typedef for wxWindow.
11 \wxheading{Derived from
}
13 \helpref{wxControl
}{wxcontrol
}\\
14 \helpref{wxWindow
}{wxwindow
}\\
15 \helpref{wxEvtHandler
}{wxevthandler
}\\
16 \helpref{wxObject
}{wxobject
}
18 \wxheading{Include files
}
22 \wxheading{Window styles
}
25 \begin{twocollist
}\itemsep=
0pt
27 \twocolitem{\windowstyle{wxNB
\_LEFT}}{Place tabs on the left side.
}
28 \twocolitem{\windowstyle{wxNB
\_RIGHT}}{Place tabs on the right side.
}
29 \twocolitem{\windowstyle{wxNB
\_BOTTOM}}{Place tabs under instead of above the notebook pages.
}
30 \twocolitem{\windowstyle{wxNB
\_FIXEDWIDTH}}{(Windows only) All tabs will have same width.
}
31 \twocolitem{\windowstyle{wxNB
\_MULTILINE}}{(Windows only) There can be several rows of tabs.
}
35 See also
\helpref{window styles overview
}{windowstyles
}.
41 \helpref{wxNotebookEvent
}{wxnotebookevent
},
\helpref{wxImageList
}{wximagelist
},
\rtfsp
42 \helpref{wxTabCtrl
}{wxtabctrl
}
44 \latexignore{\rtfignore{\wxheading{Members
}}}
46 \membersection{wxNotebook::wxNotebook
}\label{wxnotebookconstr
}
48 \func{}{wxNotebook
}{\void}
52 \func{}{wxNotebook
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
53 \param{const wxSize\&
}{ size = wxDefaultSize
},
\param{long
}{ style =
0},
\param{const wxString\&
}{name = "notebook"
}}
55 Constructs a notebook control.
57 Note that sometimes you can reduce flicker by passing the wxCLIP
\_CHILDREN window style.
59 \wxheading{Parameters
}
61 \docparam{parent
}{The parent window. Must be non-NULL.
}
63 \docparam{id
}{The window identifier.
}
65 \docparam{pos
}{The window position.
}
67 \docparam{size
}{The window size.
}
69 \docparam{style
}{The window style. See
\helpref{wxNotebook
}{wxnotebook
}.
}
71 \docparam{name
}{The name of the control (used only under Motif).
}
73 \membersection{wxNotebook::
\destruct{wxNotebook
}}
75 \func{}{\destruct{wxNotebook
}}{\void}
77 Destroys the wxNotebook object.
79 \membersection{wxNotebook::AddPage
}\label{wxnotebookaddpage
}
81 \func{bool
}{AddPage
}{\param{wxNotebookPage*
}{ page
},
82 \param{const wxString\&
}{ text
},
83 \param{bool
}{ select = FALSE
},
84 \param{int
}{ imageId = -
1}}
88 \wxheading{Parameters
}
90 \docparam{page
}{Specifies the new page.
}
92 \docparam{text
}{Specifies the text for the new page.
}
94 \docparam{select
}{Specifies whether the page should be selected.
}
96 \docparam{imageId
}{Specifies the optional image index for the new page.
}
98 \wxheading{Return value
}
100 TRUE if successful, FALSE otherwise.
104 Do not delete the page, it will be deleted by the notebook.
108 \helpref{wxNotebook::InsertPage
}{wxnotebookinsertpage
}
110 \membersection{wxNotebook::AdvanceSelection
}\label{wxnotebookadvanceselection
}
112 \func{void
}{AdvanceSelection
}{\param{bool
}{ forward = TRUE
}}
114 Cycles through the tabs.
116 \membersection{wxNotebook::AssignImageList
}\label{wxnotebookassignimagelist
}
118 \func{void
}{AssignImageList
}{\param{wxImageList*
}{ imageList
}}
120 Sets the image list for the page control and takes ownership of
125 \helpref{wxImageList
}{wximagelist
},
126 \helpref{SetImageList
}{wxnotebooksetimagelist
}
128 \membersection{wxNotebook::Create
}\label{wxnotebookcreate
}
130 \func{bool
}{Create
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
131 \param{const wxSize\&
}{ size
},
\param{long
}{ style =
0},
\param{const wxString\&
}{name = "notebook"
}}
133 Creates a notebook control. See
\helpref{wxNotebook::wxNotebook
}{wxnotebookconstr
} for a description
136 \membersection{wxNotebook::DeleteAllPages
}\label{wxnotebookdeleteallpages
}
138 \func{bool
}{DeleteAllPages
}{\void}
142 \membersection{wxNotebook::DeletePage
}\label{wxnotebookdeletepage
}
144 \func{bool
}{DeletePage
}{\param{int
}{ page
}}
146 Deletes the specified page, and the associated window.
148 \membersection{wxNotebook::GetImageList
}\label{wxnotebookgetimagelist
}
150 \constfunc{wxImageList*
}{GetImageList
}{\void}
152 Returns the associated image list.
156 \helpref{wxImageList
}{wximagelist
},
\helpref{wxNotebook::SetImageList
}{wxnotebooksetimagelist
}
158 \membersection{wxNotebook::GetPage
}\label{wxnotebookgetpage
}
160 \func{wxNotebookPage*
}{GetPage
}{\param{int
}{ page
}}
162 Returns the window at the given page position.
164 \membersection{wxNotebook::GetPageCount
}\label{wxnotebookgetpagecount
}
166 \constfunc{int
}{GetPageCount
}{\void}
168 Returns the number of pages in the notebook control.
170 \membersection{wxNotebook::GetPageImage
}\label{wxnotebookgetpageimage
}
172 \constfunc{int
}{GetPageImage
}{\param{int
}{nPage
}}
174 Returns the image index for the given page.
176 \membersection{wxNotebook::GetPageText
}\label{wxnotebookgetpagetext
}
178 \constfunc{wxString
}{GetPageText
}{\param{int
}{nPage
}}
180 Returns the string for the given page.
182 \membersection{wxNotebook::GetRowCount
}\label{wxnotebookgetrowcount
}
184 \constfunc{int
}{GetRowCount
}{\void}
186 Returns the number of rows in the notebook control.
188 \membersection{wxNotebook::GetSelection
}\label{wxnotebookgetselection
}
190 \constfunc{int
}{GetSelection
}{\void}
192 Returns the currently selected page, or $-
1$ if none was selected.
194 Note that this method may return either the previously or newly selected page
195 when called from the
{\tt EVT
\_NOTEBOOK\_PAGE\_CHANGED} handler depending on
196 the platform and so
\rtfsp
197 \helpref{wxNotebookEvent::GetSelection
}{wxnotebookeventgetselection
} should be
198 used instead in this case.
200 \membersection{wxNotebook::InsertPage
}\label{wxnotebookinsertpage
}
202 \func{bool
}{InsertPage
}{\param{int
}{ index
},
\param{wxNotebookPage*
}{ page
},
203 \param{const wxString\&
}{ text
},
204 \param{bool
}{ select = FALSE
},
205 \param{int
}{ imageId = -
1}}
207 Inserts a new page at the specified position.
209 \wxheading{Parameters
}
211 \docparam{index
}{Specifies the position for the new page.
}
213 \docparam{page
}{Specifies the new page.
}
215 \docparam{text
}{Specifies the text for the new page.
}
217 \docparam{select
}{Specifies whether the page should be selected.
}
219 \docparam{imageId
}{Specifies the optional image index for the new page.
}
221 \wxheading{Return value
}
223 TRUE if successful, FALSE otherwise.
227 Do not delete the page, it will be deleted by the notebook.
231 \helpref{wxNotebook::AddPage
}{wxnotebookaddpage
}
233 \membersection{wxNotebook::OnSelChange
}\label{wxnotebookonselchange
}
235 \func{void
}{OnSelChange
}{\param{wxNotebookEvent\&
}{ event
}}
237 An event handler function, called when the page selection is changed.
241 \helpref{wxNotebookEvent
}{wxnotebookevent
}
243 \membersection{wxNotebook::RemovePage
}\label{wxnotebookremovepage
}
245 \func{bool
}{RemovePage
}{\param{int
}{ page
}}
247 Deletes the specified page, without deleting the associated window.
249 \membersection{wxNotebook::SetImageList
}\label{wxnotebooksetimagelist
}
251 \func{void
}{SetImageList
}{\param{wxImageList*
}{ imageList
}}
253 Sets the image list for the page control. It does not take
254 ownership of the image list, you must delete it yourself.
258 \helpref{wxImageList
}{wximagelist
},
259 \helpref{AssignImageList
}{wxnotebookassignimagelist
}
261 \membersection{wxNotebook::SetPadding
}\label{wxnotebooksetpadding
}
263 \func{void
}{SetPadding
}{\param{const wxSize\&
}{ padding
}}
265 Sets the amount of space around each page's icon and label, in pixels.
267 {\bf NB:
} The vertical padding cannot be changed in wxGTK.
269 \membersection{wxNotebook::SetPageSize
}\label{wxnotebooksetpagesize
}
271 \func{void
}{SetPageSize
}{\param{const wxSize\&
}{ size
}}
273 Sets the width and height of the pages.
275 {\bf NB:
} This method is currently not implemented for wxGTK.
277 \membersection{wxNotebook::SetPageImage
}\label{wxnotebooksetpageimage
}
279 \func{bool
}{SetPageImage
}{\param{int
}{ page
},
\param{int
}{image
}}
281 Sets the image index for the given page.
{\it image
} is an index into
282 the image list which was set with
\helpref{wxNotebook::SetImageList
}{wxnotebooksetimagelist
}.
284 \membersection{wxNotebook::SetPageText
}\label{wxnotebooksetpagetext
}
286 \func{bool
}{SetPageText
}{\param{int
}{ page
},
\param{const wxString\&
}{text
}}
288 Sets the text for the given page.
290 \membersection{wxNotebook::SetSelection
}\label{wxnotebooksetselection
}
292 \func{int
}{SetSelection
}{\param{int
}{ page
}}
294 Sets the selection for the given page, returning the previous selection.
298 \helpref{wxNotebook::GetSelection
}{wxnotebookgetselection
}