Tabbed text morphs
Chris Muller
afunkyobject at yahoo.com
Wed Oct 27 02:26:02 UTC 2004
Hi Brian, I remember seeing some tabbing support built into Morphic. I'm
working on a UI utility in Morphic and ended up wrapping a TextMorph with my
own "EntryFieldMorph" objects that end up controlling the TextMorph for me. It
was easy-enough with Morphic to implement EntryFieldMorph>>#handleKeystroke:
and check the incoming KeyboardEvent's keyCharacter for Character tab, as in..
handleKeystroke: aKeyboardEvent
| keyPressed |
aKeyboardEvent wasHandled ifTrue: [ ^self ].
keyPressed _ aKeyboardEvent keyCharacter.
keyPressed = (self preferred: #keyForFocusShift) ifTrue: [ ^self shiftFocus:
aKeyboardEvent ].
keyPressed = ...
I don't see any harm in case-logic for checking hot keys..
A one liner to shiftFocus:
aKeyboardEvent hand newKeyboardFocus: self nextTabStopMorph
More information about the Squeak-dev
mailing list
|