1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323
|
<HTML>
<head><title>wxNotebook</title></head>
<BODY BGCOLOR=#FFFFFF>
<A NAME="wxnotebook"></A><CENTER>
<A HREF="wx.htm"><img align=center src="contents.gif" BORDER=0 ALT="Contents"></A> <A HREF="wx22.htm#classref"><img align=center src="up.gif" BORDER=0 ALT="Up"></A> <A HREF="wx155.htm#wxnode"><img align=center src="back.gif" BORDER=0 ALT="Previous"></A> <A HREF="wx157.htm#wxnotebookevent"><img align=center src="forward.gif" BORDER=0 ALT="Next"></A> </CENTER><HR>
<H2>wxNotebook</H2>
<P>
This class represents a notebook control, which manages multiple windows with associated tabs.<P>
To use the class, create a wxNotebook object and call <A HREF="wx156.htm#wxnotebookaddpage">AddPage</A> or <A HREF="wx156.htm#wxnotebookinsertpage">InsertPage</A>,
passing a window to be used as the page. Do not explicitly delete the window for a page that is currently
managed by wxNotebook.<P>
<B>wxNotebookPage</B> is a typedef for wxWindow.<P>
<B><FONT COLOR="#FF0000">Derived from</FONT></B><P>
<A HREF="wx56.htm#wxcontrol">wxControl</A><BR>
<A HREF="wx260.htm#wxwindow">wxWindow</A><BR>
<A HREF="wx85.htm#wxevthandler">wxEvtHandler</A><BR>
<A HREF="wx158.htm#wxobject">wxObject</A><P>
<B><FONT COLOR="#FF0000">Include files</FONT></B><P>
<wx/notebook.h><P>
<B><FONT COLOR="#FF0000">Event handling</FONT></B><P>
To process input from a notebook control, use the following event handler macros to direct input to member
functions that take a <A HREF="wx157.htm#wxnotebookevent">wxNotebookEvent</A> argument.<P>
<TABLE>
<TR><TD VALIGN=TOP>
<B>EVT_NOTEBOOK_PAGE_CHANGED(id, func)</B>
</TD>
<TD VALIGN=TOP>
The page selection was changed. Processes a
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED event.
</TD></TR>
<TR><TD VALIGN=TOP>
<B>EVT_NOTEBOOK_PAGE_CHANGING(id, func)</B>
</TD>
<TD VALIGN=TOP>
The page selection is about to be changed.
Processes a wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING event.
</TD></TR>
</TABLE>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx157.htm#wxnotebookevent">wxNotebookEvent</A>, <A HREF="wx117.htm#wximagelist">wxImageList</A>,
<A HREF="wx233.htm#wxtabctrl">wxTabCtrl</A><P>
<B><FONT COLOR="#FF0000">Members</FONT></B><P>
<A HREF="#wxnotebookconstr">wxNotebook::wxNotebook</A><BR>
<A HREF="#topic616">wxNotebook::~wxNotebook</A><BR>
<A HREF="#wxnotebookaddpage">wxNotebook::AddPage</A><BR>
<A HREF="#wxnotebookadvanceselection">wxNotebook::AdvanceSelection</A><BR>
<A HREF="#wxnotebookcreate">wxNotebook::Create</A><BR>
<A HREF="#wxnotebookdeleteallpages">wxNotebook::DeleteAllPages</A><BR>
<A HREF="#wxnotebookdeletepage">wxNotebook::DeletePage</A><BR>
<A HREF="#wxnotebookgetimagelist">wxNotebook::GetImageList</A><BR>
<A HREF="#wxnotebookgetpage">wxNotebook::GetPage</A><BR>
<A HREF="#wxnotebookgetpagecount">wxNotebook::GetPageCount</A><BR>
<A HREF="#wxnotebookgetpageimage">wxNotebook::GetPageImage</A><BR>
<A HREF="#wxnotebookgetpagetext">wxNotebook::GetPageText</A><BR>
<A HREF="#wxnotebookgetrowcount">wxNotebook::GetRowCount</A><BR>
<A HREF="#wxnotebookgetselection">wxNotebook::GetSelection</A><BR>
<A HREF="#wxnotebookinsertpage">wxNotebook::InsertPage</A><BR>
<A HREF="#wxnotebookonselchange">wxNotebook::OnSelChange</A><BR>
<A HREF="#wxnotebookremovepage">wxNotebook::RemovePage</A><BR>
<A HREF="#wxnotebooksetimagelist">wxNotebook::SetImageList</A><BR>
<A HREF="#wxnotebooksetpadding">wxNotebook::SetPadding</A><BR>
<A HREF="#wxnotebooksetpagesize">wxNotebook::SetPageSize</A><BR>
<A HREF="#wxnotebooksetpageimage">wxNotebook::SetPageImage</A><BR>
<A HREF="#wxnotebooksetpagetext">wxNotebook::SetPageText</A><BR>
<A HREF="#wxnotebooksetselection">wxNotebook::SetSelection</A><BR>
<P>
<HR>
<A NAME="wxnotebookconstr"></A>
<H3>wxNotebook::wxNotebook</H3>
<P>
<B></B> <B>wxNotebook</B>()<P>
Default constructor.<P>
<B></B> <B>wxNotebook</B>(<B>wxWindow*</B><I> parent</I>, <B>wxWindowID </B><I>id</I>, <B>const wxPoint&</B><I> pos = wxDefaultPosition</I>,
<B>const wxSize&</B><I> size</I>, <B>long</B><I> style = 0</I>, <B>const wxString& </B><I>name = "notebook"</I>)<P>
Constructs a notebook control.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>parent</I><UL><UL>
The parent window. Must be non-NULL.</UL></UL>
<P>
<I>id</I><UL><UL>
The window identifier.</UL></UL>
<P>
<I>pos</I><UL><UL>
The window position.</UL></UL>
<P>
<I>size</I><UL><UL>
The window size.</UL></UL>
<P>
<I>style</I><UL><UL>
The window style. Its value is a bit list of zero or more of <B>wxTC_MULTILINE</B>,
<B>wxTC_RIGHTJUSTIFY</B>, <B>wxTC_FIXEDWIDTH</B> and <B>wxTC_OWNERDRAW</B>.</UL></UL>
<P>
<HR>
<A NAME="topic616"></A>
<H3>wxNotebook::~wxNotebook</H3>
<P>
<B></B> <B>~wxNotebook</B>()<P>
Destroys the wxNotebook object.<P>
<HR>
<A NAME="wxnotebookaddpage"></A>
<H3>wxNotebook::AddPage</H3>
<P>
<B>bool</B> <B>AddPage</B>(<B>wxNotebookPage*</B><I> page</I>,
<B>const wxString&</B><I> text</I>,
<B>bool</B><I> select = FALSE</I>,
<B>int</B><I> imageId = -1</I>)<P>
Adds a new page.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>page</I><UL><UL>
Specifies the new page.</UL></UL>
<P>
<I>text</I><UL><UL>
Specifies the text for the new page.</UL></UL>
<P>
<I>select</I><UL><UL>
Specifies whether the page should be selected.</UL></UL>
<P>
<I>imageId</I><UL><UL>
Specifies the optional image index for the new page.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
TRUE if successful, FALSE otherwise.<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
Do not delete the page, it will be deleted by the notebook.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx156.htm#wxnotebookinsertpage">wxNotebook::InsertPage</A><P>
<HR>
<A NAME="wxnotebookadvanceselection"></A>
<H3>wxNotebook::AdvanceSelection</H3>
<P>
<B>void</B> <B>AdvanceSelection</B>(<B>bool</B><I> forward = TRUE</I>)<P>
Cycles through the tabs.<P>
<HR>
<A NAME="wxnotebookcreate"></A>
<H3>wxNotebook::Create</H3>
<P>
<B>bool</B> <B>Create</B>(<B>wxWindow*</B><I> parent</I>, <B>wxWindowID </B><I>id</I>, <B>const wxPoint&</B><I> pos = wxDefaultPosition</I>,
<B>const wxSize&</B><I> size</I>, <B>long</B><I> style = 0</I>, <B>const wxString& </B><I>name = "notebook"</I>)<P>
Creates a notebook control. See <A HREF="wx156.htm#wxnotebookconstr">wxNotebook::wxNotebook</A> for a description
of the parameters.<P>
<HR>
<A NAME="wxnotebookdeleteallpages"></A>
<H3>wxNotebook::DeleteAllPages</H3>
<P>
<B>bool</B> <B>DeleteAllPages</B>()<P>
Deletes all pages.<P>
<HR>
<A NAME="wxnotebookdeletepage"></A>
<H3>wxNotebook::DeletePage</H3>
<P>
<B>bool</B> <B>DeletePage</B>(<B>int</B><I> page</I>)<P>
Deletes the specified page, and the associated window.<P>
<HR>
<A NAME="wxnotebookgetimagelist"></A>
<H3>wxNotebook::GetImageList</H3>
<P>
<B>wxImageList*</B> <B>GetImageList</B>() <B>const</B><P>
Returns the associated image list.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx117.htm#wximagelist">wxImageList</A>, <A HREF="wx156.htm#wxnotebooksetimagelist">wxNotebook::SetImageList</A><P>
<HR>
<A NAME="wxnotebookgetpage"></A>
<H3>wxNotebook::GetPage</H3>
<P>
<B>wxNotebookPage*</B> <B>GetPage</B>(<B>int</B><I> page</I>)<P>
Returns the window at the given page position.<P>
<HR>
<A NAME="wxnotebookgetpagecount"></A>
<H3>wxNotebook::GetPageCount</H3>
<P>
<B>int</B> <B>GetPageCount</B>() <B>const</B><P>
Returns the number of pages in the notebook control.<P>
<HR>
<A NAME="wxnotebookgetpageimage"></A>
<H3>wxNotebook::GetPageImage</H3>
<P>
<B>int</B> <B>GetPageImage</B>() <B>const</B><P>
Returns the image index for the given page.<P>
<HR>
<A NAME="wxnotebookgetpagetext"></A>
<H3>wxNotebook::GetPageText</H3>
<P>
<B>wxString</B> <B>GetPageText</B>() <B>const</B><P>
Returns the string for the given page.<P>
<HR>
<A NAME="wxnotebookgetrowcount"></A>
<H3>wxNotebook::GetRowCount</H3>
<P>
<B>int</B> <B>GetRowCount</B>() <B>const</B><P>
Returns the number of rows in the notebook control.<P>
<HR>
<A NAME="wxnotebookgetselection"></A>
<H3>wxNotebook::GetSelection</H3>
<P>
<B>int</B> <B>GetSelection</B>() <B>const</B><P>
Returns the currently selected page, or -1 if none was selected.<P>
<HR>
<A NAME="wxnotebookinsertpage"></A>
<H3>wxNotebook::InsertPage</H3>
<P>
<B>bool</B> <B>InsertPage</B>(<B>int</B><I> index</I>, <B>wxNotebookPage*</B><I> page</I>,
<B>const wxString&</B><I> text</I>,
<B>bool</B><I> select = FALSE</I>,
<B>int</B><I> imageId = -1</I>)<P>
Inserts a new page at the specified position.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>index</I><UL><UL>
Specifies the position for the new page.</UL></UL>
<P>
<I>page</I><UL><UL>
Specifies the new page.</UL></UL>
<P>
<I>text</I><UL><UL>
Specifies the text for the new page.</UL></UL>
<P>
<I>select</I><UL><UL>
Specifies whether the page should be selected.</UL></UL>
<P>
<I>imageId</I><UL><UL>
Specifies the optional image index for the new page.</UL></UL>
<P>
<B><FONT COLOR="#FF0000">Return value</FONT></B><P>
TRUE if successful, FALSE otherwise.<P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
Do not delete the page, it will be deleted by the notebook.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx156.htm#wxnotebookaddpage">wxNotebook::AddPage</A><P>
<HR>
<A NAME="wxnotebookonselchange"></A>
<H3>wxNotebook::OnSelChange</H3>
<P>
<B>void</B> <B>OnSelChange</B>(<B>wxNotebookEvent&</B><I> event</I>)<P>
An event handler function, called when the page selection is changed.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx157.htm#wxnotebookevent">wxNotebookEvent</A><P>
<HR>
<A NAME="wxnotebookremovepage"></A>
<H3>wxNotebook::RemovePage</H3>
<P>
<B>bool</B> <B>RemovePage</B>(<B>int</B><I> page</I>)<P>
Deletes the specified page, without deleting the associated window.<P>
<HR>
<A NAME="wxnotebooksetimagelist"></A>
<H3>wxNotebook::SetImageList</H3>
<P>
<B>void</B> <B>SetImageList</B>(<B>wxImageList*</B><I> imageList</I>)<P>
Sets the image list for the page control.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx117.htm#wximagelist">wxImageList</A><P>
<HR>
<A NAME="wxnotebooksetpadding"></A>
<H3>wxNotebook::SetPadding</H3>
<P>
<B>void</B> <B>SetPadding</B>(<B>const wxSize&</B><I> padding</I>)<P>
Sets the amount of space around each page's icon and label, in pixels.<P>
<HR>
<A NAME="wxnotebooksetpagesize"></A>
<H3>wxNotebook::SetPageSize</H3>
<P>
<B>void</B> <B>SetPageSize</B>(<B>const wxSize&</B><I> size</I>)<P>
Sets the width and height of the pages.<P>
<HR>
<A NAME="wxnotebooksetpageimage"></A>
<H3>wxNotebook::SetPageImage</H3>
<P>
<B>bool</B> <B>SetPageImage</B>(<B>int</B><I> page</I>, <B>int </B><I>image</I>)<P>
Sets the image index for the given page. <I>image</I> is an index into
the image list which was set with <A HREF="wx156.htm#wxnotebooksetimagelist">wxNotebook::SetImageList</A>.<P>
<HR>
<A NAME="wxnotebooksetpagetext"></A>
<H3>wxNotebook::SetPageText</H3>
<P>
<B>bool</B> <B>SetPageText</B>(<B>int</B><I> page</I>, <B>const wxString& </B><I>text</I>)<P>
Sets the text for the given page.<P>
<HR>
<A NAME="wxnotebooksetselection"></A>
<H3>wxNotebook::SetSelection</H3>
<P>
<B>int</B> <B>SetSelection</B>(<B>int</B><I> page</I>)<P>
Sets the selection for the given page, returning the previous selection.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx156.htm#wxnotebookgetselection">wxNotebook::GetSelection</A><P>
</BODY></HTML>
|