+
+ // layout constraints
+
+ panel = new wxPanel(m_notebook);
+ panel->SetAutoLayout( TRUE );
+
+ c = new wxLayoutConstraints;
+ c->top.SameAs( panel, wxTop, 10 );
+ c->height.AsIs( );
+ c->left.SameAs( panel, wxLeft, 10 );
+ c->width.PercentOf( panel, wxWidth, 40 );
+
+ wxButton *pMyButton = new wxButton(panel, ID_BUTTON_TEST1, "Test Button &1" );
+ pMyButton->SetConstraints( c );
+
+ c = new wxLayoutConstraints;
+ c->top.SameAs( panel, wxTop, 10 );
+ c->bottom.SameAs( panel, wxBottom, 10 );
+ c->right.SameAs( panel, wxRight, 10 );
+ c->width.PercentOf( panel, wxWidth, 40 );
+
+ wxButton *pMyButton2 = new wxButton(panel, ID_BUTTON_TEST2, "Test Button &2" );
+ pMyButton2->SetConstraints( c );
+
+ m_notebook->AddPage(panel, "wxLayoutConstraint");
+
+ // sizer
+
+ panel = new wxPanel(m_notebook);
+ panel->SetAutoLayout( TRUE );
+
+ wxBoxSizer *sizer = new wxBoxSizer( wxHORIZONTAL );
+
+ sizer->Add( new wxButton(panel, -1, "Test Button &1" ), 3, wxALL, 10 );
+ sizer->Add( 20,20, 1 );
+ sizer->Add( new wxButton(panel, -1, "Test Button &2" ), 3, wxGROW|wxALL, 10 );
+
+ panel->SetSizer( sizer );
+
+ m_notebook->AddPage(panel, "wxSizer");