Fix decimal settings not permitting typing a '-' character

This commit is contained in:
Jonathan G Rennison
2020-12-21 20:34:38 +00:00
parent 93e7899c7f
commit bfbd2de477
2 changed files with 3 additions and 3 deletions

View File

@@ -480,9 +480,9 @@ bool IsValidChar(WChar key, CharSetFilter afilter)
case CS_ALPHANUMERAL: return IsPrintable(key);
case CS_NUMERAL: return (key >= '0' && key <= '9');
#if !defined(STRGEN) && !defined(SETTINGSGEN)
case CS_NUMERAL_DECIMAL: return (key >= '0' && key <= '9') || key == '.' || key == GetDecimalSeparatorChar();
case CS_NUMERAL_DECIMAL: return (key >= '0' && key <= '9') || key == '.' || key == '-' || key == GetDecimalSeparatorChar();
#else
case CS_NUMERAL_DECIMAL: return (key >= '0' && key <= '9') || key == '.';
case CS_NUMERAL_DECIMAL: return (key >= '0' && key <= '9') || key == '.' || key == '-';
#endif
case CS_NUMERAL_SPACE: return (key >= '0' && key <= '9') || key == ' ';
case CS_ALPHA: return IsPrintable(key) && !(key >= '0' && key <= '9');

View File

@@ -26,7 +26,7 @@
enum CharSetFilter {
CS_ALPHANUMERAL, ///< Both numeric and alphabetic and spaces and stuff
CS_NUMERAL, ///< Only numeric ones
CS_NUMERAL_DECIMAL, ///< Only numeric and decimal separaters
CS_NUMERAL_DECIMAL, ///< Only numeric, decimal separaters, and minus/negative
CS_NUMERAL_SPACE, ///< Only numbers and spaces
CS_ALPHA, ///< Only alphabetic values
CS_HEXADECIMAL, ///< Only hexadecimal characters