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 \membersection{wxNotebook::
\destruct{wxNotebook
}}
68 \func{}{\destruct{wxNotebook
}}{\void}
70 Destroys the wxNotebook object.
72 \membersection{wxNotebook::AddPage
}\label{wxnotebookaddpage
}
74 \func{bool
}{AddPage
}{\param{wxNotebookPage*
}{ page
},
75 \param{const wxString\&
}{ text
},
76 \param{bool
}{ select = FALSE
},
77 \param{int
}{ imageId = -
1}}
81 \wxheading{Parameters
}
83 \docparam{page
}{Specifies the new page.
}
85 \docparam{text
}{Specifies the text for the new page.
}
87 \docparam{select
}{Specifies whether the page should be selected.
}
89 \docparam{imageId
}{Specifies the optional image index for the new page.
}
91 \wxheading{Return value
}
93 TRUE if successful, FALSE otherwise.
97 Do not delete the page, it will be deleted by the notebook.
101 \helpref{wxNotebook::InsertPage
}{wxnotebookinsertpage
}
103 \membersection{wxNotebook::AdvanceSelection
}\label{wxnotebookadvanceselection
}
105 \func{void
}{AdvanceSelection
}{\param{bool
}{ forward = TRUE
}}
107 Cycles through the tabs.
109 \membersection{wxNotebook::Create
}\label{wxnotebookcreate
}
111 \func{bool
}{Create
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
112 \param{const wxSize\&
}{ size
},
\param{long
}{ style =
0},
\param{const wxString\&
}{name = "notebook"
}}
114 Creates a notebook control. See
\helpref{wxNotebook::wxNotebook
}{wxnotebookconstr
} for a description
117 \membersection{wxNotebook::DeleteAllPages
}\label{wxnotebookdeleteallpages
}
119 \func{bool
}{DeleteAllPages
}{\void}
123 \membersection{wxNotebook::DeletePage
}\label{wxnotebookdeletepage
}
125 \func{bool
}{DeletePage
}{\param{int
}{ page
}}
127 Deletes the specified page, and the associated window.
129 \membersection{wxNotebook::GetImageList
}\label{wxnotebookgetimagelist
}
131 \constfunc{wxImageList*
}{GetImageList
}{\void}
133 Returns the associated image list.
137 \helpref{wxImageList
}{wximagelist
},
\helpref{wxNotebook::SetImageList
}{wxnotebooksetimagelist
}
139 \membersection{wxNotebook::GetPage
}\label{wxnotebookgetpage
}
141 \func{wxNotebookPage*
}{GetPage
}{\param{int
}{ page
}}
143 Returns the window at the given page position.
145 \membersection{wxNotebook::GetPageCount
}\label{wxnotebookgetpagecount
}
147 \constfunc{int
}{GetPageCount
}{\void}
149 Returns the number of pages in the notebook control.
151 \membersection{wxNotebook::GetPageImage
}\label{wxnotebookgetpageimage
}
153 \constfunc{int
}{GetPageImage
}{\void}
155 Returns the image index for the given page.
157 \membersection{wxNotebook::GetPageText
}\label{wxnotebookgetpagetext
}
159 \constfunc{wxString
}{GetPageText
}{\void}
161 Returns the string for the given page.
163 \membersection{wxNotebook::GetRowCount
}\label{wxnotebookgetrowcount
}
165 \constfunc{int
}{GetRowCount
}{\void}
167 Returns the number of rows in the notebook control.
169 \membersection{wxNotebook::GetSelection
}\label{wxnotebookgetselection
}
171 \constfunc{int
}{GetSelection
}{\void}
173 Returns the currently selected page, or -
1 if none was selected.
175 \membersection{wxNotebook::InsertPage
}\label{wxnotebookinsertpage
}
177 \func{bool
}{InsertPage
}{\param{int
}{ index
},
\param{wxNotebookPage*
}{ page
},
178 \param{const wxString\&
}{ text
},
179 \param{bool
}{ select = FALSE
},
180 \param{int
}{ imageId = -
1}}
182 Inserts a new page at the specified position.
184 \wxheading{Parameters
}
186 \docparam{index
}{Specifies the position for the new page.
}
188 \docparam{page
}{Specifies the new page.
}
190 \docparam{text
}{Specifies the text for the new page.
}
192 \docparam{select
}{Specifies whether the page should be selected.
}
194 \docparam{imageId
}{Specifies the optional image index for the new page.
}
196 \wxheading{Return value
}
198 TRUE if successful, FALSE otherwise.
202 Do not delete the page, it will be deleted by the notebook.
206 \helpref{wxNotebook::AddPage
}{wxnotebookaddpage
}
208 \membersection{wxNotebook::OnSelChange
}\label{wxnotebookonselchange
}
210 \func{void
}{OnSelChange
}{\param{wxNotebookEvent\&
}{ event
}}
212 An event handler function, called when the page selection is changed.
216 \helpref{wxNotebookEvent
}{wxnotebookevent
}
218 \membersection{wxNotebook::RemovePage
}\label{wxnotebookremovepage
}
220 \func{bool
}{RemovePage
}{\param{int
}{ page
}}
222 Deletes the specified page, without deleting the associated window.
224 \membersection{wxNotebook::SetImageList
}\label{wxnotebooksetimagelist
}
226 \func{void
}{SetImageList
}{\param{wxImageList*
}{ imageList
}}
228 Sets the image list for the page control.
232 \helpref{wxImageList
}{wximagelist
}
234 \membersection{wxNotebook::SetPadding
}\label{wxnotebooksetpadding
}
236 \func{void
}{SetPadding
}{\param{const wxSize\&
}{ padding
}}
238 Sets the amount of space around each page's icon and label, in pixels.
240 \membersection{wxNotebook::SetPageSize
}\label{wxnotebooksetpagesize
}
242 \func{void
}{SetPageSize
}{\param{const wxSize\&
}{ size
}}
244 Sets the width and height of the pages.
246 \membersection{wxNotebook::SetPageImage
}\label{wxnotebooksetpageimage
}
248 \func{bool
}{SetPageImage
}{\param{int
}{ page
},
\param{int
}{image
}}
250 Sets the image index for the given page.
{\it image
} is an index into
251 the image list which was set with
\helpref{wxNotebook::SetImageList
}{wxnotebooksetimagelist
}.
253 \membersection{wxNotebook::SetPageText
}\label{wxnotebooksetpagetext
}
255 \func{bool
}{SetPageText
}{\param{int
}{ page
},
\param{const wxString\&
}{text
}}
257 Sets the text for the given page.
259 \membersection{wxNotebook::SetSelection
}\label{wxnotebooksetselection
}
261 \func{int
}{SetSelection
}{\param{int
}{ page
}}
263 Sets the selection for the given page, returning the previous selection.
267 \helpref{wxNotebook::GetSelection
}{wxnotebookgetselection
}