]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/nbsizer.tex
second merge of the 2.2 branch (RL)
[wxWidgets.git] / docs / latex / wx / nbsizer.tex
1 \section{\class{wxNotebookSizer}}\label{wxnotebooksizer}
2
3 wxNotebookSizer is a specialized sizer to make sizers work in connection
4 with using notebooks. This sizer is different from any other sizer as
5 you must not add any children to it - instead, it queries the notebook class itself.
6 The only thing this sizer does is to determine the size of the biggest
7 page of the notebook and report an adjusted minimal size to a more toplevel
8 sizer.
9
10 In order to query the size of notebook page, this page needs to have its
11 own sizer, otherwise the wxNotebookSizer will ignore it. Notebook pages
12 get there sizer by assiging one to them using \helpref{wxWindow::SetSizer}{wxwindowsetsizer}
13 and setting the auto-layout option to TRUE using
14 \helpref{wxWindow::SetAutoLayout}{wxwindowsetautolayout}. Here is one
15 example showing how to add a notebook page that the notebook sizer is
16 aware of:
17
18 \begin{verbatim}
19 wxNotebook *notebook = new wxNotebook( &dialog, -1 );
20 wxNotebookSizer *nbs = new wxNotebookSizer( notebook );
21
22 // Add panel as notebook page
23 wxPanel *panel = new wxPanel( notebook, -1 );
24 notebook->AddPage( panel, "My Notebook Page" );
25
26 wxBoxSizer *panelsizer = new wxBoxSizer( wxVERTICAL );
27
28 // Add controls to panel and panelsizer here...
29
30 panel->SetAutoLayout( TRUE );
31 panel->SetSizer( panelsizer );
32 \end{verbatim}
33
34 See also \helpref{wxSizer}{wxsizer}, \helpref{wxNotebook}{wxnotebook}.
35
36 \wxheading{Derived from}
37
38 \helpref{wxSizer}{wxsizer}\\
39 \helpref{wxObject}{wxobject}
40
41 \latexignore{\rtfignore{\wxheading{Members}}}
42
43 \membersection{wxNotebookSizer::wxNotebookSizer}\label{wxnotebooksizerwxnotebooksizer}
44
45 \func{}{wxNotebookSizer}{\param{wxNotebook* }{notebook}}
46
47 Constructor. It takes an associated notebook as its only parameter.
48
49 \membersection{wxNotebookSizer::GetNotebook}\label{wxnotebooksizergetnotebook}
50
51 \func{wxNotebook*}{GetNotebook}{\void}
52
53 Returns the notebook associated with the sizer.
54