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. Processes a
30 wxEVT
\_COMMAND\_NOTEBOOK\_PAGE\_CHANGED event.
}
31 \twocolitem{{\bf EVT
\_NOTEBOOK\_PAGE\_CHANGING(id, func)
}}{The page selection is about to be changed.
32 Processes a wxEVT
\_COMMAND\_NOTEBOOK\_PAGE\_CHANGING event.
}
37 \helpref{wxNotebookEvent
}{wxnotebookevent
},
\helpref{wxImageList
}{wximagelist
},
\rtfsp
38 \helpref{wxTabCtrl
}{wxtabctrl
}
40 \latexignore{\rtfignore{\wxheading{Members
}}}
42 \membersection{wxNotebook::wxNotebook
}\label{wxnotebookconstr
}
44 \func{}{wxNotebook
}{\void}
48 \func{}{wxNotebook
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
49 \param{const wxSize\&
}{ size
},
\param{long
}{ style =
0},
\param{const wxString\&
}{name = "notebook"
}}
51 Constructs a notebook control.
53 \wxheading{Parameters
}
55 \docparam{parent
}{The parent window. Must be non-NULL.
}
57 \docparam{id
}{The window identifier.
}
59 \docparam{pos
}{The window position.
}
61 \docparam{size
}{The window size.
}
63 \docparam{style
}{The window style. Its value is a bit list of zero or more of
{\bf wxTC
\_MULTILINE},
64 {\bf wxTC
\_RIGHTJUSTIFY},
{\bf wxTC
\_FIXEDWIDTH} and
{\bf wxTC
\_OWNERDRAW}.
}
66 \docparam{name
}{The name of the control (used only under Motif).
}
68 \membersection{wxNotebook::
\destruct{wxNotebook
}}
70 \func{}{\destruct{wxNotebook
}}{\void}
72 Destroys the wxNotebook object.
74 \membersection{wxNotebook::AddPage
}\label{wxnotebookaddpage
}
76 \func{bool
}{AddPage
}{\param{wxNotebookPage*
}{ page
},
77 \param{const wxString\&
}{ text
},
78 \param{bool
}{ select = FALSE
},
79 \param{int
}{ imageId = -
1}}
83 \wxheading{Parameters
}
85 \docparam{page
}{Specifies the new page.
}
87 \docparam{text
}{Specifies the text for the new page.
}
89 \docparam{select
}{Specifies whether the page should be selected.
}
91 \docparam{imageId
}{Specifies the optional image index for the new page.
}
93 \wxheading{Return value
}
95 TRUE if successful, FALSE otherwise.
99 Do not delete the page, it will be deleted by the notebook.
103 \helpref{wxNotebook::InsertPage
}{wxnotebookinsertpage
}
105 \membersection{wxNotebook::AdvanceSelection
}\label{wxnotebookadvanceselection
}
107 \func{void
}{AdvanceSelection
}{\param{bool
}{ forward = TRUE
}}
109 Cycles through the tabs.
111 \membersection{wxNotebook::Create
}\label{wxnotebookcreate
}
113 \func{bool
}{Create
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
114 \param{const wxSize\&
}{ size
},
\param{long
}{ style =
0},
\param{const wxString\&
}{name = "notebook"
}}
116 Creates a notebook control. See
\helpref{wxNotebook::wxNotebook
}{wxnotebookconstr
} for a description
119 \membersection{wxNotebook::DeleteAllPages
}\label{wxnotebookdeleteallpages
}
121 \func{bool
}{DeleteAllPages
}{\void}
125 \membersection{wxNotebook::DeletePage
}\label{wxnotebookdeletepage
}
127 \func{bool
}{DeletePage
}{\param{int
}{ page
}}
129 Deletes the specified page, and the associated window.
131 \membersection{wxNotebook::GetImageList
}\label{wxnotebookgetimagelist
}
133 \constfunc{wxImageList*
}{GetImageList
}{\void}
135 Returns the associated image list.
139 \helpref{wxImageList
}{wximagelist
},
\helpref{wxNotebook::SetImageList
}{wxnotebooksetimagelist
}
141 \membersection{wxNotebook::GetPage
}\label{wxnotebookgetpage
}
143 \func{wxNotebookPage*
}{GetPage
}{\param{int
}{ page
}}
145 Returns the window at the given page position.
147 \membersection{wxNotebook::GetPageCount
}\label{wxnotebookgetpagecount
}
149 \constfunc{int
}{GetPageCount
}{\void}
151 Returns the number of pages in the notebook control.
153 \membersection{wxNotebook::GetPageImage
}\label{wxnotebookgetpageimage
}
155 \constfunc{int
}{GetPageImage
}{\void}
157 Returns the image index for the given page.
159 \membersection{wxNotebook::GetPageText
}\label{wxnotebookgetpagetext
}
161 \constfunc{wxString
}{GetPageText
}{\void}
163 Returns the string for the given page.
165 \membersection{wxNotebook::GetRowCount
}\label{wxnotebookgetrowcount
}
167 \constfunc{int
}{GetRowCount
}{\void}
169 Returns the number of rows in the notebook control.
171 \membersection{wxNotebook::GetSelection
}\label{wxnotebookgetselection
}
173 \constfunc{int
}{GetSelection
}{\void}
175 Returns the currently selected page, or -
1 if none was selected.
177 \membersection{wxNotebook::InsertPage
}\label{wxnotebookinsertpage
}
179 \func{bool
}{InsertPage
}{\param{int
}{ index
},
\param{wxNotebookPage*
}{ page
},
180 \param{const wxString\&
}{ text
},
181 \param{bool
}{ select = FALSE
},
182 \param{int
}{ imageId = -
1}}
184 Inserts a new page at the specified position.
186 \wxheading{Parameters
}
188 \docparam{index
}{Specifies the position for the new page.
}
190 \docparam{page
}{Specifies the new page.
}
192 \docparam{text
}{Specifies the text for the new page.
}
194 \docparam{select
}{Specifies whether the page should be selected.
}
196 \docparam{imageId
}{Specifies the optional image index for the new page.
}
198 \wxheading{Return value
}
200 TRUE if successful, FALSE otherwise.
204 Do not delete the page, it will be deleted by the notebook.
208 \helpref{wxNotebook::AddPage
}{wxnotebookaddpage
}
210 \membersection{wxNotebook::OnSelChange
}\label{wxnotebookonselchange
}
212 \func{void
}{OnSelChange
}{\param{wxNotebookEvent\&
}{ event
}}
214 An event handler function, called when the page selection is changed.
218 \helpref{wxNotebookEvent
}{wxnotebookevent
}
220 \membersection{wxNotebook::RemovePage
}\label{wxnotebookremovepage
}
222 \func{bool
}{RemovePage
}{\param{int
}{ page
}}
224 Deletes the specified page, without deleting the associated window.
226 \membersection{wxNotebook::SetImageList
}\label{wxnotebooksetimagelist
}
228 \func{void
}{SetImageList
}{\param{wxImageList*
}{ imageList
}}
230 Sets the image list for the page control.
234 \helpref{wxImageList
}{wximagelist
}
236 \membersection{wxNotebook::SetPadding
}\label{wxnotebooksetpadding
}
238 \func{void
}{SetPadding
}{\param{const wxSize\&
}{ padding
}}
240 Sets the amount of space around each page's icon and label, in pixels.
242 \membersection{wxNotebook::SetPageSize
}\label{wxnotebooksetpagesize
}
244 \func{void
}{SetPageSize
}{\param{const wxSize\&
}{ size
}}
246 Sets the width and height of the pages.
248 \membersection{wxNotebook::SetPageImage
}\label{wxnotebooksetpageimage
}
250 \func{bool
}{SetPageImage
}{\param{int
}{ page
},
\param{int
}{image
}}
252 Sets the image index for the given page.
{\it image
} is an index into
253 the image list which was set with
\helpref{wxNotebook::SetImageList
}{wxnotebooksetimagelist
}.
255 \membersection{wxNotebook::SetPageText
}\label{wxnotebooksetpagetext
}
257 \func{bool
}{SetPageText
}{\param{int
}{ page
},
\param{const wxString\&
}{text
}}
259 Sets the text for the given page.
261 \membersection{wxNotebook::SetSelection
}\label{wxnotebooksetselection
}
263 \func{int
}{SetSelection
}{\param{int
}{ page
}}
265 Sets the selection for the given page, returning the previous selection.
269 \helpref{wxNotebook::GetSelection
}{wxnotebookgetselection
}