]> git.saurik.com Git - wxWidgets.git/commitdiff
compiles with or without wxSpinCtrl now
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 9 Nov 1999 19:19:39 +0000 (19:19 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 9 Nov 1999 19:19:39 +0000 (19:19 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4460 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/numdlgg.cpp

index 0bcafcdc6094567e374e7e34b6abc050b75b0f1d..bd5fc0ebeb0887c0fd609fde3c67ae5410aaf8d3 100644 (file)
 // 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