]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/valtext.cpp
compilation fix due to wxString(int) addition
[wxWidgets.git] / src / common / valtext.cpp
index 446572e6cce3c73f9e9bf9fd3e8358886e93c699..c3139ccfb6d404471f2c297dd23ea243a201535b 100644 (file)
 #include <string.h>
 #include <stdlib.h>
 
+#ifdef __SALFORDC__
+#include <clib.h>
+#endif
+
 #if !USE_SHARED_LIBRARY
 IMPLEMENT_DYNAMIC_CLASS(wxTextValidator, wxValidator)
 
@@ -294,7 +298,7 @@ void wxTextValidator::OnChar(wxKeyEvent& event)
                wxBell();
                return;
        }
-       if ( (m_validatorStyle & wxFILTER_NUMERIC) && !isdigit(keyCode) && keyCode != '.' )
+       if ( (m_validatorStyle & wxFILTER_NUMERIC) && !isdigit(keyCode) && keyCode != '.' && keyCode != '-')
        {
                wxBell();
                return;
@@ -309,6 +313,7 @@ static bool wxIsNumeric(const wxString& val)
        for ( i = 0; i < (int)val.Length(); i++)
        {
                if ((!isdigit(val[i])) && (val[i] != '.'))
+                 if(!((i == 0) && (val[i] == '-')))
                        return FALSE;
        }
        return TRUE;