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 \wxheading{Parameters
}
54 \docparam{parent
}{The parent window. Must be non-NULL.
}
56 \docparam{id
}{The window identifier.
}
58 \docparam{pos
}{The window position.
}
60 \docparam{size
}{The window size.
}
62 \docparam{style
}{The window style. Its value is a bit list of zero or more of
{\bf wxTC
\_MULTILINE},
63 {\bf wxTC
\_RIGHTJUSTIFY},
{\bf wxTC
\_FIXEDWIDTH} and
{\bf wxTC
\_OWNERDRAW}.
}
65 \docparam{name
}{The name of the control (used only under Motif).
}
67 \membersection{wxNotebook::
\destruct{wxNotebook
}}
69 \func{}{\destruct{wxNotebook
}}{\void}
71 Destroys the wxNotebook object.
73 \membersection{wxNotebook::AddPage
}\label{wxnotebookaddpage
}
75 \func{bool
}{AddPage
}{\param{wxNotebookPage*
}{ page
},
76 \param{const wxString\&
}{ text
},
77 \param{bool
}{ select = FALSE
},
78 \param{int
}{ imageId = -
1}}
82 \wxheading{Parameters
}
84 \docparam{page
}{Specifies the new page.
}
86 \docparam{text
}{Specifies the text for the new page.
}
88 \docparam{select
}{Specifies whether the page should be selected.
}
90 \docparam{imageId
}{Specifies the optional image index for the new page.
}
92 \wxheading{Return value
}
94 TRUE if successful, FALSE otherwise.
98 Do not delete the page, it will be deleted by the notebook.
102 \helpref{wxNotebook::InsertPage
}{wxnotebookinsertpage
}
104 \membersection{wxNotebook::AdvanceSelection
}\label{wxnotebookadvanceselection
}
106 \func{void
}{AdvanceSelection
}{\param{bool
}{ forward = TRUE
}}
108 Cycles through the tabs.
110 \membersection{wxNotebook::Create
}\label{wxnotebookcreate
}
112 \func{bool
}{Create
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
113 \param{const wxSize\&
}{ size
},
\param{long
}{ style =
0},
\param{const wxString\&
}{name = "notebook"
}}
115 Creates a notebook control. See
\helpref{wxNotebook::wxNotebook
}{wxnotebookconstr
} for a description
118 \membersection{wxNotebook::DeleteAllPages
}\label{wxnotebookdeleteallpages
}
120 \func{bool
}{DeleteAllPages
}{\void}
124 \membersection{wxNotebook::DeletePage
}\label{wxnotebookdeletepage
}
126 \func{bool
}{DeletePage
}{\param{int
}{ page
}}
128 Deletes the specified page, and the associated window.
130 \membersection{wxNotebook::GetImageList
}\label{wxnotebookgetimagelist
}
132 \constfunc{wxImageList*
}{GetImageList
}{\void}
134 Returns the associated image list.
138 \helpref{wxImageList
}{wximagelist
},
\helpref{wxNotebook::SetImageList
}{wxnotebooksetimagelist
}
140 \membersection{wxNotebook::GetPage
}\label{wxnotebookgetpage
}
142 \func{wxNotebookPage*
}{GetPage
}{\param{int
}{ page
}}
144 Returns the window at the given page position.
146 \membersection{wxNotebook::GetPageCount
}\label{wxnotebookgetpagecount
}
148 \constfunc{int
}{GetPageCount
}{\void}
150 Returns the number of pages in the notebook control.
152 \membersection{wxNotebook::GetPageImage
}\label{wxnotebookgetpageimage
}
154 \constfunc{int
}{GetPageImage
}{\void}
156 Returns the image index for the given page.
158 \membersection{wxNotebook::GetPageText
}\label{wxnotebookgetpagetext
}
160 \constfunc{wxString
}{GetPageText
}{\void}
162 Returns the string for the given page.
164 \membersection{wxNotebook::GetRowCount
}\label{wxnotebookgetrowcount
}
166 \constfunc{int
}{GetRowCount
}{\void}
168 Returns the number of rows in the notebook control.
170 \membersection{wxNotebook::GetSelection
}\label{wxnotebookgetselection
}
172 \constfunc{int
}{GetSelection
}{\void}
174 Returns the currently selected page, or -
1 if none was selected.
176 \membersection{wxNotebook::InsertPage
}\label{wxnotebookinsertpage
}
178 \func{bool
}{InsertPage
}{\param{int
}{ index
},
\param{wxNotebookPage*
}{ page
},
179 \param{const wxString\&
}{ text
},
180 \param{bool
}{ select = FALSE
},
181 \param{int
}{ imageId = -
1}}
183 Inserts a new page at the specified position.
185 \wxheading{Parameters
}
187 \docparam{index
}{Specifies the position for the new page.
}
189 \docparam{page
}{Specifies the new page.
}
191 \docparam{text
}{Specifies the text for the new page.
}
193 \docparam{select
}{Specifies whether the page should be selected.
}
195 \docparam{imageId
}{Specifies the optional image index for the new page.
}
197 \wxheading{Return value
}
199 TRUE if successful, FALSE otherwise.
203 Do not delete the page, it will be deleted by the notebook.
207 \helpref{wxNotebook::AddPage
}{wxnotebookaddpage
}
209 \membersection{wxNotebook::OnSelChange
}\label{wxnotebookonselchange
}
211 \func{void
}{OnSelChange
}{\param{wxNotebookEvent\&
}{ event
}}
213 An event handler function, called when the page selection is changed.
217 \helpref{wxNotebookEvent
}{wxnotebookevent
}
219 \membersection{wxNotebook::RemovePage
}\label{wxnotebookremovepage
}
221 \func{bool
}{RemovePage
}{\param{int
}{ page
}}
223 Deletes the specified page, without deleting the associated window.
225 \membersection{wxNotebook::SetImageList
}\label{wxnotebooksetimagelist
}
227 \func{void
}{SetImageList
}{\param{wxImageList*
}{ imageList
}}
229 Sets the image list for the page control.
233 \helpref{wxImageList
}{wximagelist
}
235 \membersection{wxNotebook::SetPadding
}\label{wxnotebooksetpadding
}
237 \func{void
}{SetPadding
}{\param{const wxSize\&
}{ padding
}}
239 Sets the amount of space around each page's icon and label, in pixels.
241 \membersection{wxNotebook::SetPageSize
}\label{wxnotebooksetpagesize
}
243 \func{void
}{SetPageSize
}{\param{const wxSize\&
}{ size
}}
245 Sets the width and height of the pages.
247 \membersection{wxNotebook::SetPageImage
}\label{wxnotebooksetpageimage
}
249 \func{bool
}{SetPageImage
}{\param{int
}{ page
},
\param{int
}{image
}}
251 Sets the image index for the given page.
{\it image
} is an index into
252 the image list which was set with
\helpref{wxNotebook::SetImageList
}{wxnotebooksetimagelist
}.
254 \membersection{wxNotebook::SetPageText
}\label{wxnotebooksetpagetext
}
256 \func{bool
}{SetPageText
}{\param{int
}{ page
},
\param{const wxString\&
}{text
}}
258 Sets the text for the given page.
260 \membersection{wxNotebook::SetSelection
}\label{wxnotebooksetselection
}
262 \func{int
}{SetSelection
}{\param{int
}{ page
}}
264 Sets the selection for the given page, returning the previous selection.
268 \helpref{wxNotebook::GetSelection
}{wxnotebookgetselection
}