--- a/SimpleView.st Tue Feb 21 17:05:54 2006 +0100
+++ b/SimpleView.st Thu Feb 23 22:05:15 2006 +0100
@@ -6387,46 +6387,43 @@
!
mnemonicKey
- "get the mnemonic key or nil if undefined
- "
+ "get the mnemonic key or nil if undefined"
+
^ self objectAttributeAt:#mnemonicKey
!
-mnemonicKey:aSymbolOrNil
- "set or clear the mnemonic key
- "
+mnemonicKey:aSymbolOrNil
+ "set or clear the mnemonic key"
+
aSymbolOrNil isSymbol ifTrue:[
- self objectAttributeAt:#mnemonicKey put:aSymbolOrNil
+ self objectAttributeAt:#mnemonicKey put:aSymbolOrNil
] ifFalse:[
- self removeObjectAttribute:#mnemonicKey
- ].
-!
-
-mnemonicViewNext:aKeyEvent
+ self removeObjectAttribute:#mnemonicKey
+ ].
+!
+
+mnemonicViewNext:aKeyEvent
"a mnemonicKey event as forwarded from the keyboardProcessor - if there
- is the mnemonic-key defined for a subView return the view otherwise nil.
- "
+ is the mnemonic-key defined for a subView return the view otherwise nil."
+
|key rawKey mnemonic view|
- key := aKeyEvent key.
+ key := aKeyEvent key.
rawKey := aKeyEvent rawKey.
-
- (shown and:[subViews notNil]) ifTrue:[
-
- subViews do:[:aSubView|
- aSubView shown ifTrue:[
- ( aSubView enabled
- and:[(mnemonic := aSubView mnemonicKey) notNil
- and:[(mnemonic == rawKey or:[mnemonic == key])]]
- ) ifTrue:[
- ^ aSubView
- ].
-
- (view := aSubView mnemonicViewNext:aKeyEvent) notNil ifTrue:[
- ^ view
- ].
- ]
- ]
+ (shown and:[ subViews notNil ]) ifTrue:[
+ subViews do:[:aSubView |
+ aSubView shown ifTrue:[
+ (aSubView enabled
+ and:[
+ (mnemonic := aSubView mnemonicKey) notNil
+ and:[ (mnemonic == rawKey or:[ mnemonic == key ]) ]
+ ])
+ ifTrue:[ ^ aSubView ].
+ (view := aSubView mnemonicViewNext:aKeyEvent) notNil ifTrue:[
+ ^ view
+ ].
+ ]
+ ]
].
^ nil
!
@@ -6437,30 +6434,29 @@
"/ intentionally left blank here
!
-processShortcut:aKeyEvent
+processShortcut:aKeyEvent
"a shortcutKey event as forwarded from the keyboardProcessor - if there is the
- shortcut-key defined process the shortcut and return true otherwise false.
- "
+ shortcut-key defined process the shortcut and return true otherwise false."
+
|key|
shown ifTrue:[
- self enabled ifTrue:[
- (key := self shortcutKey) notNil ifTrue:[
- (key == aKeyEvent key or:[key == aKeyEvent rawKey]) ifTrue:[
- self requestFocus.
- (controller ? self) performShortcutAction.
- ^ true
- ]
- ].
- ].
-
- subViews notNil ifTrue:[
- subViews do:[:aSubView|
- (aSubView processShortcut:aKeyEvent) ifTrue:[
- ^ true
- ]
- ]
- ]
+ self enabled ifTrue:[
+ (key := self shortcutKey) notNil ifTrue:[
+ (key == aKeyEvent key or:[ key == aKeyEvent rawKey ]) ifTrue:[
+ self requestFocus.
+ (controller ? self) performShortcutAction.
+ ^ true
+ ]
+ ].
+ ].
+ subViews notNil ifTrue:[
+ subViews do:[:aSubView |
+ (aSubView processShortcut:aKeyEvent) ifTrue:[
+ ^ true
+ ]
+ ]
+ ]
].
^ false
!
@@ -6518,18 +6514,18 @@
!
shortcutKey
- "get the shortcut key
- "
+ "get the shortcut key"
+
^ self objectAttributeAt:#shortcutKey
!
-shortcutKey:aSymbolOrNil
- "set or clear the shortcut key
- "
- aSymbolOrNil isSymbol ifTrue:[
- self objectAttributeAt:#shortcutKey put:aSymbolOrNil
+shortcutKey:aSymbolOrNil
+ "set or clear the shortcut key"
+
+ aSymbolOrNil notNil ifTrue:[
+ self objectAttributeAt:#shortcutKey put:aSymbolOrNil
] ifFalse:[
- self removeObjectAttribute:#shortcutKey
+ self removeObjectAttribute:#shortcutKey
].
! !
@@ -9697,7 +9693,7 @@
!SimpleView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.539 2006-02-15 21:01:54 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libview/SimpleView.st,v 1.540 2006-02-23 21:05:15 cg Exp $'
! !
SimpleView initialize!