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{Event handling
}
24 To process input from a notebook control, use the following event handler macros to direct input to member
25 functions that take a
\helpref{wxNotebookEvent
}{wxnotebookevent
} argument.
28 \begin{twocollist
}\itemsep=
0pt
29 \twocolitem{{\bf EVT
\_NOTEBOOK\_PAGE\_CHANGED(id, func)
}}{The page selection was changed.
}
30 \twocolitem{{\bf EVT
\_NOTEBOOK\_PAGE\_CHANGING(id, func)
}}{The page selection is about to be changed.
31 This can be prevented by calling
\helpref{Veto()
}{wxnotifyeventveto
}.
}
36 \helpref{wxNotebookEvent
}{wxnotebookevent
},
\helpref{wxImageList
}{wximagelist
},
\rtfsp
37 \helpref{wxTabCtrl
}{wxtabctrl
}
39 \latexignore{\rtfignore{\wxheading{Members
}}}
41 \membersection{wxNotebook::wxNotebook
}\label{wxnotebookconstr
}
43 \func{}{wxNotebook
}{\void}
47 \func{}{wxNotebook
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
48 \param{const wxSize\&
}{ size
},
\param{long
}{ style =
0},
\param{const wxString\&
}{name = "notebook"
}}
50 Constructs a notebook control.
52 Note that sometimes you can reduce flicker by passing the wxCLIP
\_CHILDREN window style.
54 \wxheading{Parameters
}
56 \docparam{parent
}{The parent window. Must be non-NULL.
}
58 \docparam{id
}{The window identifier.
}
60 \docparam{pos
}{The window position.
}
62 \docparam{size
}{The window size.
}
64 \docparam{style
}{The window style. Its value is a bit list of zero or more of
{\bf wxTC
\_MULTILINE},
65 {\bf wxTC
\_RIGHTJUSTIFY},
{\bf wxTC
\_FIXEDWIDTH} and
{\bf wxTC
\_OWNERDRAW}.
}
67 \docparam{name
}{The name of the control (used only under Motif).
}
69 \membersection{wxNotebook::
\destruct{wxNotebook
}}
71 \func{}{\destruct{wxNotebook
}}{\void}
73 Destroys the wxNotebook object.
75 \membersection{wxNotebook::AddPage
}\label{wxnotebookaddpage
}
77 \func{bool
}{AddPage
}{\param{wxNotebookPage*
}{ page
},
78 \param{const wxString\&
}{ text
},
79 \param{bool
}{ select = FALSE
},
80 \param{int
}{ imageId = -
1}}
84 \wxheading{Parameters
}
86 \docparam{page
}{Specifies the new page.
}
88 \docparam{text
}{Specifies the text for the new page.
}
90 \docparam{select
}{Specifies whether the page should be selected.
}
92 \docparam{imageId
}{Specifies the optional image index for the new page.
}
94 \wxheading{Return value
}
96 TRUE if successful, FALSE otherwise.
100 Do not delete the page, it will be deleted by the notebook.
104 \helpref{wxNotebook::InsertPage
}{wxnotebookinsertpage
}
106 \membersection{wxNotebook::AdvanceSelection
}\label{wxnotebookadvanceselection
}
108 \func{void
}{AdvanceSelection
}{\param{bool
}{ forward = TRUE
}}
110 Cycles through the tabs.
112 \membersection{wxNotebook::Create
}\label{wxnotebookcreate
}
114 \func{bool
}{Create
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
115 \param{const wxSize\&
}{ size
},
\param{long
}{ style =
0},
\param{const wxString\&
}{name = "notebook"
}}
117 Creates a notebook control. See
\helpref{wxNotebook::wxNotebook
}{wxnotebookconstr
} for a description
120 \membersection{wxNotebook::DeleteAllPages
}\label{wxnotebookdeleteallpages
}
122 \func{bool
}{DeleteAllPages
}{\void}
126 \membersection{wxNotebook::DeletePage
}\label{wxnotebookdeletepage
}
128 \func{bool
}{DeletePage
}{\param{int
}{ page
}}
130 Deletes the specified page, and the associated window.
132 \membersection{wxNotebook::GetImageList
}\label{wxnotebookgetimagelist
}
134 \constfunc{wxImageList*
}{GetImageList
}{\void}
136 Returns the associated image list.
140 \helpref{wxImageList
}{wximagelist
},
\helpref{wxNotebook::SetImageList
}{wxnotebooksetimagelist
}
142 \membersection{wxNotebook::GetPage
}\label{wxnotebookgetpage
}
144 \func{wxNotebookPage*
}{GetPage
}{\param{int
}{ page
}}
146 Returns the window at the given page position.
148 \membersection{wxNotebook::GetPageCount
}\label{wxnotebookgetpagecount
}
150 \constfunc{int
}{GetPageCount
}{\void}
152 Returns the number of pages in the notebook control.
154 \membersection{wxNotebook::GetPageImage
}\label{wxnotebookgetpageimage
}
156 \constfunc{int
}{GetPageImage
}{\void}
158 Returns the image index for the given page.
160 \membersection{wxNotebook::GetPageText
}\label{wxnotebookgetpagetext
}
162 \constfunc{wxString
}{GetPageText
}{\void}
164 Returns the string for the given page.
166 \membersection{wxNotebook::GetRowCount
}\label{wxnotebookgetrowcount
}
168 \constfunc{int
}{GetRowCount
}{\void}
170 Returns the number of rows in the notebook control.
172 \membersection{wxNotebook::GetSelection
}\label{wxnotebookgetselection
}
174 \constfunc{int
}{GetSelection
}{\void}
176 Returns the currently selected page, or -
1 if none was selected.
178 \membersection{wxNotebook::InsertPage
}\label{wxnotebookinsertpage
}
180 \func{bool
}{InsertPage
}{\param{int
}{ index
},
\param{wxNotebookPage*
}{ page
},
181 \param{const wxString\&
}{ text
},
182 \param{bool
}{ select = FALSE
},
183 \param{int
}{ imageId = -
1}}
185 Inserts a new page at the specified position.
187 \wxheading{Parameters
}
189 \docparam{index
}{Specifies the position for the new page.
}
191 \docparam{page
}{Specifies the new page.
}
193 \docparam{text
}{Specifies the text for the new page.
}
195 \docparam{select
}{Specifies whether the page should be selected.
}
197 \docparam{imageId
}{Specifies the optional image index for the new page.
}
199 \wxheading{Return value
}
201 TRUE if successful, FALSE otherwise.
205 Do not delete the page, it will be deleted by the notebook.
209 \helpref{wxNotebook::AddPage
}{wxnotebookaddpage
}
211 \membersection{wxNotebook::OnSelChange
}\label{wxnotebookonselchange
}
213 \func{void
}{OnSelChange
}{\param{wxNotebookEvent\&
}{ event
}}
215 An event handler function, called when the page selection is changed.
219 \helpref{wxNotebookEvent
}{wxnotebookevent
}
221 \membersection{wxNotebook::RemovePage
}\label{wxnotebookremovepage
}
223 \func{bool
}{RemovePage
}{\param{int
}{ page
}}
225 Deletes the specified page, without deleting the associated window.
227 \membersection{wxNotebook::SetImageList
}\label{wxnotebooksetimagelist
}
229 \func{void
}{SetImageList
}{\param{wxImageList*
}{ imageList
}}
231 Sets the image list for the page control.
235 \helpref{wxImageList
}{wximagelist
}
237 \membersection{wxNotebook::SetPadding
}\label{wxnotebooksetpadding
}
239 \func{void
}{SetPadding
}{\param{const wxSize\&
}{ padding
}}
241 Sets the amount of space around each page's icon and label, in pixels.
243 \membersection{wxNotebook::SetPageSize
}\label{wxnotebooksetpagesize
}
245 \func{void
}{SetPageSize
}{\param{const wxSize\&
}{ size
}}
247 Sets the width and height of the pages.
249 \membersection{wxNotebook::SetPageImage
}\label{wxnotebooksetpageimage
}
251 \func{bool
}{SetPageImage
}{\param{int
}{ page
},
\param{int
}{image
}}
253 Sets the image index for the given page.
{\it image
} is an index into
254 the image list which was set with
\helpref{wxNotebook::SetImageList
}{wxnotebooksetimagelist
}.
256 \membersection{wxNotebook::SetPageText
}\label{wxnotebooksetpagetext
}
258 \func{bool
}{SetPageText
}{\param{int
}{ page
},
\param{const wxString\&
}{text
}}
260 Sets the text for the given page.
262 \membersection{wxNotebook::SetSelection
}\label{wxnotebooksetselection
}
264 \func{int
}{SetSelection
}{\param{int
}{ page
}}
266 Sets the selection for the given page, returning the previous selection.
270 \helpref{wxNotebook::GetSelection
}{wxnotebookgetselection
}