- long wDialog = 5*LAYOUT_X_MARGIN + wText + wPrompt;
- long hDialog = 2*LAYOUT_Y_MARGIN +
- sizeText.GetHeight() * lines.GetCount() +
- 2*LAYOUT_Y_MARGIN +
- hText +
- 2*LAYOUT_Y_MARGIN +
- sizeBtn.GetHeight() +
- 2*LAYOUT_Y_MARGIN;
-
- // create the controls
- // -------------------
+ // 2) prompt and text ctrl
+ wxBoxSizer *inputsizer = new wxBoxSizer( wxHORIZONTAL );
+ // prompt if any
+ if (!prompt.IsEmpty())
+ inputsizer->Add( new wxStaticText( this, -1, prompt ), 0, wxCENTER | wxLEFT, 10 );
+ // spin ctrl
+ wxString valStr;
+ valStr.Printf(wxT("%lu"), m_value);
+ m_spinctrl = new wxSpinCtrl(this, -1, valStr, wxDefaultPosition, wxSize( 140, -1 ) );
+ m_spinctrl->SetRange((int)m_min, (int)m_max);
+ inputsizer->Add( m_spinctrl, 1, wxCENTER | wxLEFT | wxRIGHT, 10 );
+ // add both
+ topsizer->Add( inputsizer, 1, wxEXPAND | wxLEFT|wxRIGHT, 5 );
+
+#if wxUSE_STATLINE
+ // 3) static line
+ topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
+#endif