@@ -376,29 +376,19 @@ bool TextEdit::exceedsMaxWidth(wchar_t c)
376376/* *
377377 * Checks if input key character is valid to
378378 * be inserted at caret position in the text edit
379- * without breaking the constraint and wi
379+ * without breaking the text edit constraint.
380380 * @param key Key code.
381381 * @return True if character can be inserted, False if it cannot.
382382 */
383383bool TextEdit::isValidChar (Uint16 key)
384384{
385- // If constraint is "signed numeric", need to check:
386- // - user does not input a character before '-' or '+'
387- // - user enter either figure anywhere, or a sign at first position
388- // if (((_textEditConstraint == TEC_NUMERIC && key >= L'0' && key <= L'9') ||
389- // (_textEditConstraint == TEC_SIGNED_NUMERIC &&
390- // (_caretPos > 0 || (_value[0] != L'+' && _value[0] != L'-')) &&
391- // ((key >= L'0' && key <= L'9') || (_caretPos == 0 && (key == L'+' || key == L'-')))) ||
392- // (_textEditConstraint == TEC_NONE && ((key >= L' ' && key <= L'~') || key >= 160))) &&
393- // !exceedsMaxWidth((wchar_t)key))
394-
395385 switch (_textEditConstraint)
396386 {
397387 case TEC_NUMERIC_POSITIVE :
398388 return key >= L' 0' && key <= L' 9' ;
399389 break ;
400390
401- // If constraint is "signed numeric", need to check:
391+ // If constraint is "( signed) numeric", need to check:
402392 // - user does not input a character before '-' or '+'
403393 // - user enter either figure anywhere, or a sign at first position
404394 case TEC_NUMERIC :
0 commit comments