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
\_FIXEDWIDTH}}{(Windows only)All tabs will have same width.
}
28 \twocolitem{\windowstyle{wxNB
\_LEFT}}{Place tabs on the left side.
}
29 \twocolitem{\windowstyle{wxNB
\_RIGHT}}{Place tabs on the right side.
}
30 \twocolitem{\windowstyle{wxNB
\_BOTTOM}}{Place tabs under instead of above the notebook pages.
}
34 See also
\helpref{window styles overview
}{windowstyles
}.
40 \helpref{wxNotebookEvent
}{wxnotebookevent
},
\helpref{wxImageList
}{wximagelist
},
\rtfsp
41 \helpref{wxTabCtrl
}{wxtabctrl
}
43 \latexignore{\rtfignore{\wxheading{Members
}}}
45 \membersection{wxNotebook::wxNotebook
}\label{wxnotebookconstr
}
47 \func{}{wxNotebook
}{\void}
51 \func{}{wxNotebook
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
52 \param{const wxSize\&
}{ size
},
\param{long
}{ style =
0},
\param{const wxString\&
}{name = "notebook"
}}
54 Constructs a notebook control.
56 Note that sometimes you can reduce flicker by passing the wxCLIP
\_CHILDREN window style.
58 \wxheading{Parameters
}
60 \docparam{parent
}{The parent window. Must be non-NULL.
}
62 \docparam{id
}{The window identifier.
}
64 \docparam{pos
}{The window position.
}
66 \docparam{size
}{The window size.
}
68 \docparam{style
}{The window style. See
\helpref{wxNotebook
}{wxnotebook
}.
}
70 \docparam{name
}{The name of the control (used only under Motif).
}
72 \membersection{wxNotebook::
\destruct{wxNotebook
}}
74 \func{}{\destruct{wxNotebook
}}{\void}
76 Destroys the wxNotebook object.
78 \membersection{wxNotebook::AddPage
}\label{wxnotebookaddpage
}
80 \func{bool
}{AddPage
}{\param{wxNotebookPage*
}{ page
},
81 \param{const wxString\&
}{ text
},
82 \param{bool
}{ select = FALSE
},
83 \param{int
}{ imageId = -
1}}
87 \wxheading{Parameters
}
89 \docparam{page
}{Specifies the new page.
}
91 \docparam{text
}{Specifies the text for the new page.
}
93 \docparam{select
}{Specifies whether the page should be selected.
}
95 \docparam{imageId
}{Specifies the optional image index for the new page.
}
97 \wxheading{Return value
}
99 TRUE if successful, FALSE otherwise.
103 Do not delete the page, it will be deleted by the notebook.
107 \helpref{wxNotebook::InsertPage
}{wxnotebookinsertpage
}
109 \membersection{wxNotebook::AdvanceSelection
}\label{wxnotebookadvanceselection
}
111 \func{void
}{AdvanceSelection
}{\param{bool
}{ forward = TRUE
}}
113 Cycles through the tabs.
115 \membersection{wxNotebook::AssignImageList
}\label{wxnotebookassignimagelist
}
117 \func{void
}{AssignImageList
}{\param{wxImageList*
}{ imageList
}}
119 Sets the image list for the page control and takes ownership of
124 \helpref{wxImageList
}{wximagelist
},
125 \helpref{SetImageList
}{wxnotebooksetimagelist
}
127 \membersection{wxNotebook::Create
}\label{wxnotebookcreate
}
129 \func{bool
}{Create
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
130 \param{const wxSize\&
}{ size
},
\param{long
}{ style =
0},
\param{const wxString\&
}{name = "notebook"
}}
132 Creates a notebook control. See
\helpref{wxNotebook::wxNotebook
}{wxnotebookconstr
} for a description
135 \membersection{wxNotebook::DeleteAllPages
}\label{wxnotebookdeleteallpages
}
137 \func{bool
}{DeleteAllPages
}{\void}
141 \membersection{wxNotebook::DeletePage
}\label{wxnotebookdeletepage
}
143 \func{bool
}{DeletePage
}{\param{int
}{ page
}}
145 Deletes the specified page, and the associated window.
147 \membersection{wxNotebook::GetImageList
}\label{wxnotebookgetimagelist
}
149 \constfunc{wxImageList*
}{GetImageList
}{\void}
151 Returns the associated image list.
155 \helpref{wxImageList
}{wximagelist
},
\helpref{wxNotebook::SetImageList
}{wxnotebooksetimagelist
}
157 \membersection{wxNotebook::GetPage
}\label{wxnotebookgetpage
}
159 \func{wxNotebookPage*
}{GetPage
}{\param{int
}{ page
}}
161 Returns the window at the given page position.
163 \membersection{wxNotebook::GetPageCount
}\label{wxnotebookgetpagecount
}
165 \constfunc{int
}{GetPageCount
}{\void}
167 Returns the number of pages in the notebook control.
169 \membersection{wxNotebook::GetPageImage
}\label{wxnotebookgetpageimage
}
171 \constfunc{int
}{GetPageImage
}{\param{int
}{nPage
}}
173 Returns the image index for the given page.
175 \membersection{wxNotebook::GetPageText
}\label{wxnotebookgetpagetext
}
177 \constfunc{wxString
}{GetPageText
}{\param{int
}{nPage
}}
179 Returns the string for the given page.
181 \membersection{wxNotebook::GetRowCount
}\label{wxnotebookgetrowcount
}
183 \constfunc{int
}{GetRowCount
}{\void}
185 Returns the number of rows in the notebook control.
187 \membersection{wxNotebook::GetSelection
}\label{wxnotebookgetselection
}
189 \constfunc{int
}{GetSelection
}{\void}
191 Returns the currently selected page, or $-
1$ if none was selected.
193 Note that this method may return either the previously or newly selected page
194 when called from the
{\tt EVT
\_NOTEBOOK\_PAGE\_CHANGED} handler depending on
195 the platform and so
\rtfsp
196 \helpref{wxNotebookEvent::GetSelection
}{wxnotebookeventgetselection
} should be
197 used instead in this case.
199 \membersection{wxNotebook::InsertPage
}\label{wxnotebookinsertpage
}
201 \func{bool
}{InsertPage
}{\param{int
}{ index
},
\param{wxNotebookPage*
}{ page
},
202 \param{const wxString\&
}{ text
},
203 \param{bool
}{ select = FALSE
},
204 \param{int
}{ imageId = -
1}}
206 Inserts a new page at the specified position.
208 \wxheading{Parameters
}
210 \docparam{index
}{Specifies the position for the new page.
}
212 \docparam{page
}{Specifies the new page.
}
214 \docparam{text
}{Specifies the text for the new page.
}
216 \docparam{select
}{Specifies whether the page should be selected.
}
218 \docparam{imageId
}{Specifies the optional image index for the new page.
}
220 \wxheading{Return value
}
222 TRUE if successful, FALSE otherwise.
226 Do not delete the page, it will be deleted by the notebook.
230 \helpref{wxNotebook::AddPage
}{wxnotebookaddpage
}
232 \membersection{wxNotebook::OnSelChange
}\label{wxnotebookonselchange
}
234 \func{void
}{OnSelChange
}{\param{wxNotebookEvent\&
}{ event
}}
236 An event handler function, called when the page selection is changed.
240 \helpref{wxNotebookEvent
}{wxnotebookevent
}
242 \membersection{wxNotebook::RemovePage
}\label{wxnotebookremovepage
}
244 \func{bool
}{RemovePage
}{\param{int
}{ page
}}
246 Deletes the specified page, without deleting the associated window.
248 \membersection{wxNotebook::SetImageList
}\label{wxnotebooksetimagelist
}
250 \func{void
}{SetImageList
}{\param{wxImageList*
}{ imageList
}}
252 Sets the image list for the page control. It does not take
253 ownership of the image list, you must delete it yourself.
257 \helpref{wxImageList
}{wximagelist
},
258 \helpref{AssignImageList
}{wxnotebookassignimagelist
}
260 \membersection{wxNotebook::SetPadding
}\label{wxnotebooksetpadding
}
262 \func{void
}{SetPadding
}{\param{const wxSize\&
}{ padding
}}
264 Sets the amount of space around each page's icon and label, in pixels.
266 \membersection{wxNotebook::SetPageSize
}\label{wxnotebooksetpagesize
}
268 \func{void
}{SetPageSize
}{\param{const wxSize\&
}{ size
}}
270 Sets the width and height of the pages.
272 \membersection{wxNotebook::SetPageImage
}\label{wxnotebooksetpageimage
}
274 \func{bool
}{SetPageImage
}{\param{int
}{ page
},
\param{int
}{image
}}
276 Sets the image index for the given page.
{\it image
} is an index into
277 the image list which was set with
\helpref{wxNotebook::SetImageList
}{wxnotebooksetimagelist
}.
279 \membersection{wxNotebook::SetPageText
}\label{wxnotebooksetpagetext
}
281 \func{bool
}{SetPageText
}{\param{int
}{ page
},
\param{const wxString\&
}{text
}}
283 Sets the text for the given page.
285 \membersection{wxNotebook::SetSelection
}\label{wxnotebooksetselection
}
287 \func{int
}{SetSelection
}{\param{int
}{ page
}}
289 Sets the selection for the given page, returning the previous selection.
293 \helpref{wxNotebook::GetSelection
}{wxnotebookgetselection
}