X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7102c47355e27d55f86d42cad4c2c1edfb533ae9..bfec7058d4c9f8d41c38ce1ddcbc2670548cf5c2:/src/common/valtext.cpp diff --git a/src/common/valtext.cpp b/src/common/valtext.cpp index 252793377a..530772a890 100644 --- a/src/common/valtext.cpp +++ b/src/common/valtext.cpp @@ -20,7 +20,7 @@ #pragma hdrstop #endif -#if wxUSE_VALIDATORS +#if wxUSE_VALIDATORS && wxUSE_TEXTCTRL #ifndef WX_PRECOMP #include @@ -303,8 +303,7 @@ static bool wxIsNumeric(const wxString& val) { // 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] != ',') && (val[i] != wxT('e')) && (val[i] != wxT('E'))) - if(!((i == 0) && (val[i] == '-'))) + if ((!isdigit(val[i])) && (val[i] != '.') && (val[i] != ',') && (val[i] != wxT('e')) && (val[i] != wxT('E')) && (val[i] != wxT('+')) && (val[i] != wxT('-'))) return FALSE; } return TRUE; @@ -333,4 +332,4 @@ bool wxTextValidator::IsNotInCharExcludeList(const wxString& val) } #endif - // wxUSE_VALIDATORS + // wxUSE_VALIDATORS && wxUSE_TEXTCTRL