Tweaked IntEntry behavior

Changed behavior of IntEntry to stop it from continously selecting all
text as long as the mouse is over the input box.  It appears that
something continues to send kMouseEnterMessage messages while use is
typing, even if the mouse is still.  This caused the IntEntry select-all
multiple times and as the user typed would replace what they had already
written.

Also force value to be set within min >= value >= max when focus is lost.
This will get rid of bad values from the entry, such as 10q goes to 10,
40000 goes to 255, etc.
This commit is contained in:
Joel Madigan 2013-11-29 17:22:57 -05:00
parent 86dab97cac
commit 838382791e

View File

@ -64,7 +64,11 @@ bool IntEntry::onProcessMessage(Message* msg)
// text is automatically selected.
case kMouseEnterMessage:
requestFocus();
selectText(0, -1);
break;
// Reset value if it's out of bounds when focus is lost
case kFocusLeaveMessage:
setValue(MID(m_min, getValue(), m_max));
break;
case kMouseDownMessage: