X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/87d1e11fd413212a7eacc745bf28a583cc63e65b..cfad3750c3ecc821ffae8b9b3de852551270846d:/src/common/valtext.cpp diff --git a/src/common/valtext.cpp b/src/common/valtext.cpp index 7da74055f5..c3139ccfb6 100644 --- a/src/common/valtext.cpp +++ b/src/common/valtext.cpp @@ -34,6 +34,10 @@ #include #include +#ifdef __SALFORDC__ +#include +#endif + #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxTextValidator, wxValidator) @@ -270,7 +274,10 @@ void wxTextValidator::OnChar(wxKeyEvent& event) wxTextCtrl *textCtrl = (wxTextCtrl *)m_validatorWindow; int keyCode = event.KeyCode(); - if ( keyCode == WXK_DELETE || keyCode == WXK_RETURN || keyCode == WXK_BACK) + if (keyCode == WXK_DELETE || keyCode == WXK_RETURN || keyCode == WXK_BACK || + keyCode == WXK_HOME || keyCode == WXK_LEFT || keyCode == WXK_UP || + keyCode == WXK_RIGHT || keyCode == WXK_DOWN || keyCode == WXK_PRIOR || + keyCode == WXK_NEXT || keyCode == WXK_END || keyCode == WXK_HOME) { textCtrl->wxTextCtrl::OnChar(event); return ; @@ -291,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; @@ -306,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;