What would be the best way of validating input in TextMorph (for instance, allowing input only of numeric characters or only of small cap letters)?
From a UI perspective, if the typed character is invalid (or makes an
invalid situation), then simply refuse it; put nothing into the TextMorph, and, optionally, flash it.
On Wed, Aug 28, 2013 at 3:57 PM, Casimiro de Almeida Barreto casimiro.barreto@gmail.com wrote:
What would be the best way of validating input in TextMorph (for instance, allowing input only of numeric characters or only of small cap letters)?
Just a small hint to another project: https://www.hpi.uni-potsdam.de/hirschfeld/trac/SqueakCommunityProjects/wiki/...
There is a widget that can convert input using a block:
UiLineEdit new helpText: 'Enter number here...'; converter: [:txt | txt select: [:char | char isDigit]]; autoConvert: true; openInHand.
Basically, it is implemented with a TextMorph that is converting the resulting text after each #keyStroke:. :)
Best, Marcel
-- View this message in context: http://forum.world.st/How-to-validate-content-in-TextMorph-tp4705558p4705784... Sent from the Squeak - Dev mailing list archive at Nabble.com.
squeak-dev@lists.squeakfoundation.org