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
26 \twocolitem{\windowstyle{wxNB
\_FIXEDWIDTH}}{Make all tabs of equal width
}
27 \twocolitem{\windowstyle{wxNB
\_LEFT}}{Put the tabs on the left side of the notebook
}
28 \twocolitem{\windowstyle{wxNB
\_RIGHT}}{Put the tabs on the right side of the notebook
}
29 \twocolitem{\windowstyle{wxNB
\_BOTTOM}}{Put the tabs on the bottom of the notebook
}
32 \wxheading{Event handling
}
34 To process input from a notebook control, use the following event handler macros to direct input to member
35 functions that take a
\helpref{wxNotebookEvent
}{wxnotebookevent
} argument.
38 \begin{twocollist
}\itemsep=
0pt
39 \twocolitem{{\bf EVT
\_NOTEBOOK\_PAGE\_CHANGED(id, func)
}}{The page selection was changed.
}
40 \twocolitem{{\bf EVT
\_NOTEBOOK\_PAGE\_CHANGING(id, func)
}}{The page selection is about to be changed.
41 This can be prevented by calling
\helpref{Veto()
}{wxnotifyeventveto
}.
}
46 \helpref{wxNotebookEvent
}{wxnotebookevent
},
\helpref{wxImageList
}{wximagelist
},
\rtfsp
47 \helpref{wxTabCtrl
}{wxtabctrl
}
49 \latexignore{\rtfignore{\wxheading{Members
}}}
51 \membersection{wxNotebook::wxNotebook
}\label{wxnotebookconstr
}
53 \func{}{wxNotebook
}{\void}
57 \func{}{wxNotebook
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
58 \param{const wxSize\&
}{ size
},
\param{long
}{ style =
0},
\param{const wxString\&
}{name = "notebook"
}}
60 Constructs a notebook control.
62 Note that sometimes you can reduce flicker by passing the wxCLIP
\_CHILDREN window style.
64 \wxheading{Parameters
}
66 \docparam{parent
}{The parent window. Must be non-NULL.
}
68 \docparam{id
}{The window identifier.
}
70 \docparam{pos
}{The window position.
}
72 \docparam{size
}{The window size.
}
74 \docparam{style
}{The window style. Its value is a bit list of zero or more of
{\bf wxTC
\_MULTILINE},
75 {\bf wxTC
\_RIGHTJUSTIFY},
{\bf wxTC
\_FIXEDWIDTH} and
{\bf wxTC
\_OWNERDRAW}
76 possibly combined with one of
{\bf wxNB
\_LEFT},
{\bf wxNB
\_RIGHT} or
79 \docparam{name
}{The name of the control (used only under Motif).
}
81 \membersection{wxNotebook::
\destruct{wxNotebook
}}
83 \func{}{\destruct{wxNotebook
}}{\void}
85 Destroys the wxNotebook object.
87 \membersection{wxNotebook::AddPage
}\label{wxnotebookaddpage
}
89 \func{bool
}{AddPage
}{\param{wxNotebookPage*
}{ page
},
90 \param{const wxString\&
}{ text
},
91 \param{bool
}{ select = FALSE
},
92 \param{int
}{ imageId = -
1}}
96 \wxheading{Parameters
}
98 \docparam{page
}{Specifies the new page.
}
100 \docparam{text
}{Specifies the text for the new page.
}
102 \docparam{select
}{Specifies whether the page should be selected.
}
104 \docparam{imageId
}{Specifies the optional image index for the new page.
}
106 \wxheading{Return value
}
108 TRUE if successful, FALSE otherwise.
112 Do not delete the page, it will be deleted by the notebook.
116 \helpref{wxNotebook::InsertPage
}{wxnotebookinsertpage
}
118 \membersection{wxNotebook::AdvanceSelection
}\label{wxnotebookadvanceselection
}
120 \func{void
}{AdvanceSelection
}{\param{bool
}{ forward = TRUE
}}
122 Cycles through the tabs.
124 \membersection{wxNotebook::Create
}\label{wxnotebookcreate
}
126 \func{bool
}{Create
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
127 \param{const wxSize\&
}{ size
},
\param{long
}{ style =
0},
\param{const wxString\&
}{name = "notebook"
}}
129 Creates a notebook control. See
\helpref{wxNotebook::wxNotebook
}{wxnotebookconstr
} for a description
132 \membersection{wxNotebook::DeleteAllPages
}\label{wxnotebookdeleteallpages
}
134 \func{bool
}{DeleteAllPages
}{\void}
138 \membersection{wxNotebook::DeletePage
}\label{wxnotebookdeletepage
}
140 \func{bool
}{DeletePage
}{\param{int
}{ page
}}
142 Deletes the specified page, and the associated window.
144 \membersection{wxNotebook::GetImageList
}\label{wxnotebookgetimagelist
}
146 \constfunc{wxImageList*
}{GetImageList
}{\void}
148 Returns the associated image list.
152 \helpref{wxImageList
}{wximagelist
},
\helpref{wxNotebook::SetImageList
}{wxnotebooksetimagelist
}
154 \membersection{wxNotebook::GetPage
}\label{wxnotebookgetpage
}
156 \func{wxNotebookPage*
}{GetPage
}{\param{int
}{ page
}}
158 Returns the window at the given page position.
160 \membersection{wxNotebook::GetPageCount
}\label{wxnotebookgetpagecount
}
162 \constfunc{int
}{GetPageCount
}{\void}
164 Returns the number of pages in the notebook control.
166 \membersection{wxNotebook::GetPageImage
}\label{wxnotebookgetpageimage
}
168 \constfunc{int
}{GetPageImage
}{\void}
170 Returns the image index for the given page.
172 \membersection{wxNotebook::GetPageText
}\label{wxnotebookgetpagetext
}
174 \constfunc{wxString
}{GetPageText
}{\void}
176 Returns the string for the given page.
178 \membersection{wxNotebook::GetRowCount
}\label{wxnotebookgetrowcount
}
180 \constfunc{int
}{GetRowCount
}{\void}
182 Returns the number of rows in the notebook control.
184 \membersection{wxNotebook::GetSelection
}\label{wxnotebookgetselection
}
186 \constfunc{int
}{GetSelection
}{\void}
188 Returns the currently selected page, or -
1 if none was selected.
190 \membersection{wxNotebook::InsertPage
}\label{wxnotebookinsertpage
}
192 \func{bool
}{InsertPage
}{\param{int
}{ index
},
\param{wxNotebookPage*
}{ page
},
193 \param{const wxString\&
}{ text
},
194 \param{bool
}{ select = FALSE
},
195 \param{int
}{ imageId = -
1}}
197 Inserts a new page at the specified position.
199 \wxheading{Parameters
}
201 \docparam{index
}{Specifies the position for the new page.
}
203 \docparam{page
}{Specifies the new page.
}
205 \docparam{text
}{Specifies the text for the new page.
}
207 \docparam{select
}{Specifies whether the page should be selected.
}
209 \docparam{imageId
}{Specifies the optional image index for the new page.
}
211 \wxheading{Return value
}
213 TRUE if successful, FALSE otherwise.
217 Do not delete the page, it will be deleted by the notebook.
221 \helpref{wxNotebook::AddPage
}{wxnotebookaddpage
}
223 \membersection{wxNotebook::OnSelChange
}\label{wxnotebookonselchange
}
225 \func{void
}{OnSelChange
}{\param{wxNotebookEvent\&
}{ event
}}
227 An event handler function, called when the page selection is changed.
231 \helpref{wxNotebookEvent
}{wxnotebookevent
}
233 \membersection{wxNotebook::RemovePage
}\label{wxnotebookremovepage
}
235 \func{bool
}{RemovePage
}{\param{int
}{ page
}}
237 Deletes the specified page, without deleting the associated window.
239 \membersection{wxNotebook::SetImageList
}\label{wxnotebooksetimagelist
}
241 \func{void
}{SetImageList
}{\param{wxImageList*
}{ imageList
}}
243 Sets the image list for the page control.
247 \helpref{wxImageList
}{wximagelist
}
249 \membersection{wxNotebook::SetPadding
}\label{wxnotebooksetpadding
}
251 \func{void
}{SetPadding
}{\param{const wxSize\&
}{ padding
}}
253 Sets the amount of space around each page's icon and label, in pixels.
255 \membersection{wxNotebook::SetPageSize
}\label{wxnotebooksetpagesize
}
257 \func{void
}{SetPageSize
}{\param{const wxSize\&
}{ size
}}
259 Sets the width and height of the pages.
261 \membersection{wxNotebook::SetPageImage
}\label{wxnotebooksetpageimage
}
263 \func{bool
}{SetPageImage
}{\param{int
}{ page
},
\param{int
}{image
}}
265 Sets the image index for the given page.
{\it image
} is an index into
266 the image list which was set with
\helpref{wxNotebook::SetImageList
}{wxnotebooksetimagelist
}.
268 \membersection{wxNotebook::SetPageText
}\label{wxnotebooksetpagetext
}
270 \func{bool
}{SetPageText
}{\param{int
}{ page
},
\param{const wxString\&
}{text
}}
272 Sets the text for the given page.
274 \membersection{wxNotebook::SetSelection
}\label{wxnotebooksetselection
}
276 \func{int
}{SetSelection
}{\param{int
}{ page
}}
278 Sets the selection for the given page, returning the previous selection.
282 \helpref{wxNotebook::GetSelection
}{wxnotebookgetselection
}