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{Event handling
}
20 To process input from a notebook control, use the following event handler macros to direct input to member
21 functions that take a
\helpref{wxNotebookEvent
}{wxnotebookevent
} argument.
24 \begin{twocollist
}\itemsep=
0pt
25 \twocolitem{{\bf EVT
\_NOTEBOOK\_PAGE\_CHANGED(id, func)
}}{The page selection was changed. Processes a
26 wxEVT
\_COMMAND\_NOTEBOOK\_PAGE\_CHANGED event.
}
27 \twocolitem{{\bf EVT
\_NOTEBOOK\_PAGE\_CHANGING(id, func)
}}{The page selection is about to be changed.
28 Processes a wxEVT
\_COMMAND\_NOTEBOOK\_PAGE\_CHANGING event.
}
33 \helpref{wxNotebookEvent
}{wxnotebookevent
},
\helpref{wxImageList
}{wximagelist
},
\rtfsp
34 \helpref{wxTabCtrl
}{wxtabctrl
}
36 \latexignore{\rtfignore{\wxheading{Members
}}}
38 \membersection{wxNotebook::wxNotebook
}\label{wxnotebookconstr
}
40 \func{}{wxNotebook
}{\void}
44 \func{}{wxNotebook
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
45 \param{const wxSize\&
}{ size
},
\param{long
}{ style =
0},
\param{const wxString\&
}{name = "notebook"
}}
47 Constructs a notebook control.
49 \wxheading{Parameters
}
51 \docparam{parent
}{The parent window. Must be non-NULL.
}
53 \docparam{id
}{The window identifier.
}
55 \docparam{pos
}{The window position.
}
57 \docparam{size
}{The window size.
}
59 \docparam{style
}{The window style. Its value is a bit list of zero or more of
{\bf wxTC
\_MULTILINE},
60 {\bf wxTC
\_RIGHTJUSTIFY},
{\bf wxTC
\_FIXEDWIDTH} and
{\bf wxTC
\_OWNERDRAW}.
}
62 \membersection{wxNotebook::
\destruct{wxNotebook
}}
64 \func{}{\destruct{wxNotebook
}}{\void}
66 Destroys the wxNotebook object.
68 \membersection{wxNotebook::AddPage
}\label{wxnotebookaddpage
}
70 \func{bool
}{AddPage
}{\param{wxNotebookPage*
}{ page
},
71 \param{const wxString\&
}{ text
},
72 \param{bool
}{ select = FALSE
},
73 \param{int
}{ imageId = -
1}}
77 \wxheading{Parameters
}
79 \docparam{page
}{Specifies the new page.
}
81 \docparam{text
}{Specifies the text for the new page.
}
83 \docparam{select
}{Specifies whether the page should be selected.
}
85 \docparam{imageId
}{Specifies the optional image index for the new page.
}
87 \wxheading{Return value
}
89 TRUE if successful, FALSE otherwise.
93 Do not delete the page, it will be deleted by the notebook.
97 \helpref{wxNotebook::InsertPage
}{wxnotebookinsertpage
}
99 \membersection{wxNotebook::AdvanceSelection
}\label{wxnotebookadvanceselection
}
101 \func{void
}{AdvanceSelection
}{\param{bool
}{ forward = TRUE
}}
103 Cycles through the tabs.
105 \membersection{wxNotebook::Create
}\label{wxnotebookcreate
}
107 \func{bool
}{Create
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
\param{const wxPoint\&
}{ pos = wxDefaultPosition
},
108 \param{const wxSize\&
}{ size
},
\param{long
}{ style =
0},
\param{const wxString\&
}{name = "notebook"
}}
110 Creates a notebook control. See
\helpref{wxNotebook::wxNotebook
}{wxnotebookconstr
} for a description
113 \membersection{wxNotebook::DeleteAllPages
}\label{wxnotebookdeleteallpages
}
115 \func{bool
}{DeleteAllPages
}{\void}
119 \membersection{wxNotebook::DeletePage
}\label{wxnotebookdeletepage
}
121 \func{bool
}{DeletePage
}{\param{int
}{ page
}}
123 Deletes the specified page.
125 \membersection{wxNotebook::GetImageList
}\label{wxnotebookgetimagelist
}
127 \constfunc{wxImageList*
}{GetImageList
}{\void}
129 Returns the associated image list.
133 \helpref{wxImageList
}{wximagelist
},
\helpref{wxNotebook::SetImageList
}{wxnotebooksetimagelist
}
135 \membersection{wxNotebook::GetPage
}\label{wxnotebookgetpage
}
137 \func{wxNotebookPage*
}{GetPage
}{\param{int
}{ page
}}
139 Returns the window at the given page position.
141 \membersection{wxNotebook::GetPageCount
}\label{wxnotebookgetpagecount
}
143 \constfunc{int
}{GetPageCount
}{\void}
145 Returns the number of pages in the notebook control.
147 \membersection{wxNotebook::GetPageImage
}\label{wxnotebookgetpageimage
}
149 \constfunc{int
}{GetPageImage
}{\void}
151 Returns the image index for the given page.
153 \membersection{wxNotebook::GetPageText
}\label{wxnotebookgetpagetext
}
155 \constfunc{wxString
}{GetPageText
}{\void}
157 Returns the string for the given page.
159 \membersection{wxNotebook::GetRowCount
}\label{wxnotebookgetrowcount
}
161 \constfunc{int
}{GetRowCount
}{\void}
163 Returns the number of rows in the notebook control.
165 \membersection{wxNotebook::GetSelection
}\label{wxnotebookgetselection
}
167 \constfunc{int
}{GetSelection
}{\void}
169 Returns the currently selected page, or -
1 if none was selected.
171 \membersection{wxNotebook::InsertPage
}\label{wxnotebookinsertpage
}
173 \func{bool
}{InsertPage
}{\param{int
}{ index
},
\param{wxNotebookPage*
}{ page
},
174 \param{const wxString\&
}{ text
},
175 \param{bool
}{ select = FALSE
},
176 \param{int
}{ imageId = -
1}}
178 Inserts a new page at the specified position.
180 \wxheading{Parameters
}
182 \docparam{index
}{Specifies the position for the new page.
}
184 \docparam{page
}{Specifies the new page.
}
186 \docparam{text
}{Specifies the text for the new page.
}
188 \docparam{select
}{Specifies whether the page should be selected.
}
190 \docparam{imageId
}{Specifies the optional image index for the new page.
}
192 \wxheading{Return value
}
194 TRUE if successful, FALSE otherwise.
198 Do not delete the page, it will be deleted by the notebook.
202 \helpref{wxNotebook::AddPage
}{wxnotebookaddpage
}
204 \membersection{wxNotebook::OnSelChange
}\label{wxnotebookonselchange
}
206 \func{void
}{OnSelChange
}{\param{wxNotebookEvent\&
}{ event
}}
208 An event handler function, called when the page selection is changed.
212 \helpref{wxNotebookEvent
}{wxnotebookevent
}
214 \membersection{wxNotebook::SetImageList
}\label{wxnotebooksetimagelist
}
216 \func{void
}{SetImageList
}{\param{wxImageList*
}{ imageList
}}
218 Sets the image list for the page control.
222 \helpref{wxImageList
}{wximagelist
}
224 \membersection{wxNotebook::SetPadding
}\label{wxnotebooksetpadding
}
226 \func{void
}{SetPadding
}{\param{const wxSize\&
}{ padding
}}
228 Sets the amount of space around each page's icon and label, in pixels.
230 \membersection{wxNotebook::SetPageSize
}\label{wxnotebooksetpagesize
}
232 \func{void
}{SetPageSize
}{\param{const wxSize\&
}{ size
}}
234 Sets the width and height of the pages.
236 \membersection{wxNotebook::SetPageImage
}\label{wxnotebooksetpageimage
}
238 \func{bool
}{SetPageImage
}{\param{int
}{ page
},
\param{int
}{image
}}
240 Sets the image index for the given page.
{\it image
} is an index into
241 the image list which was set with
\helpref{wxNotebook::SetImageList
}{wxnotebooksetimagelist
}.
243 \membersection{wxNotebook::SetPageText
}\label{wxnotebooksetpagetext
}
245 \func{bool
}{SetPageText
}{\param{int
}{ page
},
\param{const wxString\&
}{text
}}
247 Sets the text for the given page.
249 \membersection{wxNotebook::SetSelection
}\label{wxnotebooksetselection
}
251 \func{int
}{SetSelection
}{\param{int
}{ page
}}
253 Sets the selection for the given page, returning the previous selection.
257 \helpref{wxNotebook::GetSelection
}{wxnotebookgetselection
}