- wxT("any other way."), wxPoint( 10,10) );
- wxSize size = text->GetBestSize();
-
- m_button = new wxButton(m_panel, Minimal_PopupButton, wxT("Press Me"), wxPoint(0, size.y + 10));
- size.y = m_button->GetRect().GetBottom();
- m_spinCtrl = new wxSpinCtrl(m_panel, Minimal_PopupSpinctrl, wxT("Hello"), wxPoint(0, size.y + 5));
- size.y = m_spinCtrl->GetRect().GetBottom();
-
- m_panel->SetSize( size.x+20, size.y+20 );
- SetClientSize( size.x+20, size.y+20 );
+ wxT("any other way.") );
+
+ m_button = new wxButton(m_panel, Minimal_PopupButton, wxT("Press Me"));
+ m_spinCtrl = new wxSpinCtrl(m_panel, Minimal_PopupSpinctrl, wxT("Hello"));
+ m_mouseText = new wxStaticText(m_panel, wxID_ANY,
+ wxT("<- Test Mouse ->"));
+
+ wxBoxSizer *topSizer = new wxBoxSizer( wxVERTICAL );
+ topSizer->Add( text, 0, wxALL, 5 );
+ topSizer->Add( m_button, 0, wxALL, 5 );
+ topSizer->Add( m_spinCtrl, 0, wxALL, 5 );
+ topSizer->Add( m_mouseText, 0, wxCENTRE|wxALL, 5 );
+
+ m_panel->SetAutoLayout( true );
+ m_panel->SetSizer( topSizer );
+ topSizer->Fit(m_panel);
+ topSizer->Fit(this);