- wxT("any other way."), wxPoint( 10,10) );
- wxSize size = text->GetBestSize();
- 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 );
+
+ if ( scrolled )
+ {
+ // Add a big window to ensure that scrollbars are shown when we set the
+ // panel size to a lesser size below.
+ topSizer->Add(new wxPanel(m_panel, wxID_ANY, wxDefaultPosition,
+ wxSize(600, 900)));
+ }
+
+ m_panel->SetSizer( topSizer );
+ if ( scrolled )
+ {
+ // Set the fixed size to ensure that the scrollbars are shown.
+ m_panel->SetSize(300, 300);
+
+ // And also actually enable them.
+ m_panel->SetScrollRate(10, 10);
+ }
+ else
+ {
+ // Use the fitting size for the panel if we don't need scrollbars.
+ topSizer->Fit(m_panel);
+ }
+
+ SetClientSize(m_panel->GetSize());