X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a35701127e3e8d2c7fb433d85c7b3954ccbfc9f..09d350c0bc105653e7cd59a8290684a3c4e70d7e:/src/generic/numdlgg.cpp diff --git a/src/generic/numdlgg.cpp b/src/generic/numdlgg.cpp index d8a6f2ae5f..2c6ffa665d 100644 --- a/src/generic/numdlgg.cpp +++ b/src/generic/numdlgg.cpp @@ -105,15 +105,20 @@ wxNumberEntryDialog::wxNumberEntryDialog(wxWindow *parent, wxBeginBusyCursor(); wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); - +#if wxUSE_STATTEXT // 1) text message topsizer->Add( CreateTextSizer( message ), 0, wxALL, 10 ); +#endif // 2) prompt and text ctrl wxBoxSizer *inputsizer = new wxBoxSizer( wxHORIZONTAL ); + +#if wxUSE_STATTEXT // prompt if any if (!prompt.IsEmpty()) inputsizer->Add( new wxStaticText( this, wxID_ANY, prompt ), 0, wxCENTER | wxLEFT, 10 ); +#endif + // spin ctrl wxString valStr; valStr.Printf(wxT("%ld"), m_value); @@ -138,7 +143,7 @@ wxNumberEntryDialog::wxNumberEntryDialog(wxWindow *parent, #endif // 4) buttons - topsizer->Add( CreateButtonSizer( wxOK|wxCANCEL ), 0, wxCENTRE | wxALL, 10 ); + topsizer->Add( CreateButtonSizer( wxOK|wxCANCEL ), 0, wxEXPAND | wxALL, 10 ); #endif // !__SMARTPHONE__ @@ -169,6 +174,7 @@ void wxNumberEntryDialog::OnOK(wxCommandEvent& WXUNUSED(event)) if ( m_value < m_min || m_value > m_max ) { // not a number or out of range + m_value = -1; EndModal(wxID_CANCEL); } @@ -198,7 +204,7 @@ long wxGetNumberFromUser(const wxString& msg, wxNumberEntryDialog dialog(parent, msg, prompt, title, value, min, max, pos); if (dialog.ShowModal() == wxID_OK) - return dialog.GetValue(); + return dialog.GetValue(); return -1; }