X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/678cd6de66095373ebaed01d8d013f256cac326b..2463329cd36c305f4007445049a89439fb7e62a9:/src/generic/numdlgg.cpp?ds=sidebyside diff --git a/src/generic/numdlgg.cpp b/src/generic/numdlgg.cpp index 0bcafcdc60..bd5fc0ebeb 100644 --- a/src/generic/numdlgg.cpp +++ b/src/generic/numdlgg.cpp @@ -50,6 +50,11 @@ // this is where wxGetNumberFromUser() is declared #include "wx/generic/textdlgg.h" +#if !wxUSE_SPINCTRL + // wxTextCtrl will do instead of wxSpinCtrl if we don't have it + #define wxSpinCtrl wxTextCtrl +#endif + // ---------------------------------------------------------------------------- // private classes // ---------------------------------------------------------------------------- @@ -151,7 +156,14 @@ wxNumberEntryDialog::wxNumberEntryDialog(wxWindow *parent, void wxNumberEntryDialog::OnOK(wxCommandEvent& WXUNUSED(event)) { +#if !wxUSE_SPINCTRL + wxString tmp = m_spinctrl->GetValue(); + if ( wxSscanf(tmp, _T("%ld"), &m_value) != 1 ) + m_value = -1; + else +#else m_value = m_spinctrl->GetValue(); +#endif if ( m_value < m_min || m_value > m_max ) { // not a number or out of range