'From Squeakland 3.8.5976 of 25 August 2004 [latest update: #267] on 28 August 2004 at 6:49:27 pm'! "Change Set: TabAmongFieldsPreference-dgd Date: 28 August 2004 Author: Diego Gomez Deck A new preference that acts like a global property #tabAmongFields. Requires TabAmongFields-fix-dgd posted some minutes ago. " Preferences addPreference: #tabAmongFields category: #morphic default: true balloonHelp: 'If true, the tab key can be used to switch the focus between text morphs.'. ! !Morph methodsFor: 'event handling' stamp: 'dgd 8/28/2004 18:42'! tabAmongFields ^ Preferences tabAmongFields or: [self hasProperty: #tabAmongFields] ! ! !Morph methodsFor: 'structure' stamp: 'dgd 8/28/2004 18:43'! pasteUpMorphHandlingTabAmongFields "Answer the nearest PasteUpMorph in my owner chain that has the tabAmongFields property, or nil if none" | aPasteUp | aPasteUp _ self owner. [aPasteUp notNil] whileTrue: [aPasteUp tabAmongFields ifTrue: [^ aPasteUp]. aPasteUp _ aPasteUp owner]. ^ nil! ! !PasteUpMorph methodsFor: 'event handling' stamp: 'dgd 8/28/2004 18:44'! handlesKeyboard: evt ^self isWorldMorph or:[evt keyCharacter == Character tab and:[self tabAmongFields]]! ! !PasteUpMorph methodsFor: 'event handling' stamp: 'dgd 8/28/2004 18:44'! keyStroke: anEvent "A keystroke has been made. Service event handlers and, if it's a keystroke presented to the world, dispatch it to #unfocusedKeystroke:" | selected | super keyStroke: anEvent. "Give event handlers a chance" selected := self selectedObject. selected isNil ifFalse:[ selected moveOrResizeFromKeystroke: anEvent ]. (anEvent keyCharacter == Character tab) ifTrue: [self tabAmongFields ifTrue:[^ self tabHitWithEvent: anEvent]]. self isWorldMorph ifTrue: [self keystrokeInWorld: anEvent]! !