X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d1af991f497a5e95d8f8ab15a4e4a4a4c375928f..ab70fb1de13ea6b185c20fe7e2fa4fd0c065733f:/src/common/valtext.cpp diff --git a/src/common/valtext.cpp b/src/common/valtext.cpp index f891889826..27e3d04cd6 100644 --- a/src/common/valtext.cpp +++ b/src/common/valtext.cpp @@ -40,13 +40,11 @@ #include #endif -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxTextValidator, wxValidator) BEGIN_EVENT_TABLE(wxTextValidator, wxValidator) EVT_CHAR(wxTextValidator::OnChar) END_EVENT_TABLE() -#endif static bool wxIsNumeric(const wxString& val); @@ -271,7 +269,7 @@ void wxTextValidator::OnChar(wxKeyEvent& event) if ( m_validatorWindow ) { - int keyCode = event.KeyCode(); + int keyCode = (int)event.KeyCode(); // we don't filter special keys and Delete if ( @@ -281,7 +279,7 @@ void wxTextValidator::OnChar(wxKeyEvent& event) ((m_validatorStyle & wxFILTER_ALPHA) && !isalpha(keyCode)) || ((m_validatorStyle & wxFILTER_ALPHANUMERIC) && !isalnum(keyCode)) || ((m_validatorStyle & wxFILTER_NUMERIC) && !isdigit(keyCode) - && keyCode != '.' && keyCode != '-') + && keyCode != '.' && keyCode != ',' && keyCode != '-') ) ) { @@ -301,7 +299,9 @@ static bool wxIsNumeric(const wxString& val) int i; for ( i = 0; i < (int)val.Length(); i++) { - if ((!isdigit(val[i])) && (val[i] != '.')) + // Allow for "," (French) as well as "." -- in future we should + // use wxSystemSettings or other to do better localisation + if ((!isdigit(val[i])) && (val[i] != '.') && (val[i] != ',')) if(!((i == 0) && (val[i] == '-'))) return FALSE; } @@ -310,4 +310,3 @@ static bool wxIsNumeric(const wxString& val) #endif // wxUSE_VALIDATORS - \ No newline at end of file