+ wxDialog dialog( this, -1, wxString("Notebook Sizer Test Dialog") );
+
+ // Begin with first hierarchy: a notebook at the top and
+ // and OK button at the bottom.
+
+ wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
+
+ wxNotebook *notebook = new wxNotebook( &dialog, -1 );
+ wxNotebookSizer *nbs = new wxNotebookSizer( notebook );
+ topsizer->Add( nbs, 1, wxGROW );
+
+ wxButton *button = new wxButton( &dialog, wxID_OK, "OK" );
+ topsizer->Add( button, 0, wxALIGN_RIGHT | wxALL, 10 );
+
+ // First page: one big text ctrl
+ wxTextCtrl *multi = new wxTextCtrl( notebook, -1, "TextCtrl.", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE );
+ notebook->AddPage( multi, "Page One" );
+
+ // Second page: a text ctrl and a button
+ wxPanel *panel = new wxPanel( notebook, -1 );
+ notebook->AddPage( panel, "Page Two" );
+
+ wxSizer *panelsizer = new wxBoxSizer( wxVERTICAL );
+
+ wxTextCtrl *text = new wxTextCtrl( panel, -1, "TextLine 1.", wxDefaultPosition, wxSize(250,-1) );
+ panelsizer->Add( text, 0, wxGROW|wxALL, 30 );
+ text = new wxTextCtrl( panel, -1, "TextLine 2.", wxDefaultPosition, wxSize(250,-1) );
+ panelsizer->Add( text, 0, wxGROW|wxALL, 30 );
+ wxButton *button2 = new wxButton( panel, -1, "Hallo" );
+ panelsizer->Add( button2, 0, wxALIGN_RIGHT | wxLEFT|wxRIGHT|wxBOTTOM, 30 );
+
+ panel->SetAutoLayout( TRUE );
+ panel->SetSizer( panelsizer );
+
+ // Tell dialog to use sizer
+
+ dialog.SetAutoLayout( TRUE );
+ dialog.SetSizer( topsizer );
+ topsizer->Fit( &dialog );
+ topsizer->SetSizeHints( &dialog );
+
+ dialog.ShowModal();