[squeak-dev] The Trunk: Morphic-cmm.513.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Jan 12 16:36:09 UTC 2011
Chris Muller uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-cmm.513.mcz
==================== Summary ====================
Name: Morphic-cmm.513
Author: cmm
Time: 12 January 2011, 10:35:12.92 am
UUID: 16638693-c843-453b-90db-bb6095f4db3c
Ancestors: Morphic-cmm.512
- Present the message, "Enter text to narrow selection down to matching items" to users who have NOT discovered that menus accept keyboard input, instead of the users who already have.
=============== Diff against Morphic-cmm.512 ===============
Item was changed:
----- Method: MenuMorph>>handleFiltering: (in category 'keystroke helpers') -----
handleFiltering: evt
| matchString |
matchString := self valueOfProperty: #matchString ifAbsentPut: [ String new ].
matchString := evt keyValue = 8 " Character backspace asciiValue "
ifTrue: [
matchString isEmpty
ifTrue: [ matchString ]
ifFalse: [ matchString allButLast ] ]
ifFalse: [
matchString copyWith: evt keyCharacter ].
self setProperty: #matchString toValue: matchString.
+ self displayFiltered: evt!
- self displayFiltered: evt.
- self showKeyboardHelp !
Item was added:
+ ----- Method: MenuMorph>>hideKeyboardHelp (in category 'keystroke helpers') -----
+ hideKeyboardHelp
+ self deleteBalloon!
Item was changed:
----- Method: MenuMorph>>keyStroke: (in category 'keyboard control') -----
keyStroke: evt
+ self hideKeyboardHelp; noteRootMenuHasUsedKeyboard.
-
- self
- showKeyboardHelp;
- noteRootMenuHasUsedKeyboard.
self keyStrokeHandlers
+ detect: [:each | self perform: each with: evt]
+ ifNone: [self handleFiltering: evt]!
- detect: [ :each | self perform: each with: evt ]
- ifNone: [ self handleFiltering: evt ].!
Item was changed:
----- Method: MenuMorph>>popUpAt:forHand:in:allowKeyboard: (in category 'control') -----
popUpAt: aPoint forHand: hand in: aWorld allowKeyboard: aBoolean
+ "Present this menu at the given point under control of the given
- "Present this menu at the given point under control of the given
hand."
| evt |
aWorld submorphs
+ select: [:each | (each isKindOf: MenuMorph)
+ and: [each stayUp not]]
+ thenCollect: [:menu | menu delete].
- select: [ :each | (each isKindOf: MenuMorph)
- and: [each stayUp not]]
- thenCollect: [ :menu | menu delete].
-
self items isEmpty
ifTrue: [^ self].
-
MenuIcons decorateMenu: self.
-
(self submorphs
select: [:m | m isKindOf: UpdatingMenuItemMorph])
do: [:m | m updateContents].
"precompute width"
self
positionAt: aPoint
relativeTo: (selectedItem
ifNil: [self items first])
inWorld: aWorld.
aWorld addMorphFront: self.
"Acquire focus for valid pop up behavior"
hand newMouseFocus: self.
aBoolean
+ ifTrue: [hand newKeyboardFocus: self.
+ self showKeyboardHelp].
- ifTrue: [hand newKeyboardFocus: self].
evt := hand lastEvent.
(evt isKeyboard
or: [evt isMouse
and: [evt anyButtonPressed not]])
ifTrue: ["Select first item if button not down"
+ self moveSelectionDown: 1 event: evt
+ "Select first item if button not down"].
- self moveSelectionDown: 1 event: evt].
self updateColor.
self changed!
More information about the Squeak-dev
mailing list
|