X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ce4169a4d129fc6cd165b2e9ccc5cf5d48356020..755c41bf1ebddab912a4bfbe460041fec28aea07:/src/common/valtext.cpp?ds=sidebyside diff --git a/src/common/valtext.cpp b/src/common/valtext.cpp index a3b027ea0a..9fdf5b77e7 100644 --- a/src/common/valtext.cpp +++ b/src/common/valtext.cpp @@ -20,10 +20,6 @@ #pragma hdrstop #endif -#ifndef WX_PRECOMP - #include "wx/defs.h" -#endif - #if wxUSE_VALIDATORS #ifndef WX_PRECOMP @@ -285,7 +281,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 != '-') ) ) { @@ -305,7 +301,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; } @@ -314,4 +312,3 @@ static bool wxIsNumeric(const wxString& val) #endif // wxUSE_VALIDATORS - \ No newline at end of file