- m_panel->SetSize( size.x+20, size.y+20 );
- SetClientSize( size.x+20, size.y+20 );
+ 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->SetSizer( topSizer );
+ topSizer->Fit(m_panel);
+ topSizer->Fit(this);