Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1220.mcz ==================== Summary ==================== Name: Morphic-mt.1220 Author: mt Time: 2 August 2016, 9:23:14.170882 am UUID: f900f8ec-e0be-0a43-8828-b5ecc0624b15 Ancestors: Morphic-mt.1219 I forgot to restore the keyboard shortcut functionality for confirmation dialogs. It has been there before my refactorings. =============== Diff against Morphic-mt.1219 =============== Item was changed: ----- Method: DialogWindow>>registerKeyboardShortcutFor: (in category 'constructing') ----- registerKeyboardShortcutFor: button "Take the first alpha-numeric character that is not already used as a shortcut, and use it as a shortcut." (button valueOfProperty: #normalLabel) asString in: [:normalLabel | normalLabel do: [:char | char isAlphaNumeric ifTrue: [ keyMap at: char asLowercase ifPresent: [] + ifAbsent: [ + button setProperty: #normalLabel toValue: ('{1} ({2})' format: {normalLabel. char asLowercase}). + button label: (button valueOfProperty: #normalLabel). - ifAbsent: [ - button label: ('{1} ({2})' format: {normalLabel. char}). ^ keyMap at: char asLowercase put: button ] ] ] ]! Item was changed: ----- Method: DialogWindow>>step (in category 'stepping and presenter') ----- step timeout ifNil: [^self]. timeout = 0 ifTrue: [ self stopStepping. selectedButton performAction] ifFalse: [ + selectedButton label: ('{1} [{2}]' format: { - selectedButton label: ('{1} ({2})' format: { selectedButton valueOfProperty: #normalLabel. timeout}). timeout := timeout - 1]! Item was changed: ----- Method: UserDialogBoxMorph class>>confirm:orCancel:title:at: (in category 'utilities') ----- confirm: aString orCancel: cancelBlock title: titleString at: aPointOrNil (self new title: titleString; message: aString; createButton: 'Yes' translated value: true; createButton: 'No' translated value: false; createButton: 'Cancel' translated value: nil; selectedButtonIndex: 1; "YES" + registerKeyboardShortcuts; yourself) in: [:dialog | ^ (aPointOrNil ifNil: [dialog getUserResponseAtHand] ifNotNil: [ dialog moveTo: aPointOrNil. dialog getUserResponse]) ifNil: [ cancelBlock value ]]! Item was changed: ----- Method: UserDialogBoxMorph class>>confirm:title:at: (in category 'utilities') ----- confirm: aString title: titleString at: aPointOrNil "UserDialogBoxMorph confirm: 'Make your choice carefully' withCRs title: 'Do you like chocolate?'" ^self new title: titleString; message: aString; createButton: 'Yes' translated value: true; createCancelButton: 'No' translated value: false; selectedButtonIndex: 1; "YES" + registerKeyboardShortcuts; getUserResponseAtHand! Item was changed: ----- Method: UserDialogBoxMorph class>>confirm:title:trueChoice:falseChoice:at: (in category 'utilities') ----- confirm: aString title: titleString trueChoice: trueChoice falseChoice: falseChoice at: aPointOrNil "UserDialogBoxMorph confirm: 'Make your choice carefully' withCRs title: 'Do you like chocolate?' trueChoice: 'Oh yessir!!' falseChoice: 'Not so much...'" ^self new title: titleString; message: aString; createButton: trueChoice translated value: true; createCancelButton: falseChoice translated value: false; selectedButtonIndex: 1; + registerKeyboardShortcuts; moveTo: (aPointOrNil ifNil: [ActiveWorld center]); getUserResponse! Item was changed: ----- Method: UserDialogBoxMorph class>>confirm:title:trueChoice:falseChoice:default:triggerAfter:at: (in category 'utilities') ----- confirm: aString title: titleString trueChoice: trueChoice falseChoice: falseChoice default: default triggerAfter: seconds at: aPointOrNil "UserDialogBoxMorph confirm: 'I like hot java' title: 'What do you say?' trueChoice: 'You bet!!' falseChoice: 'Nope' default: false triggerAfter: 12 at: 121@212" ^self new title: titleString; message: aString; createButton: trueChoice translated value: true; createCancelButton: falseChoice translated value: false; selectedButtonIndex: (default ifTrue: [1] ifFalse: [2]); + registerKeyboardShortcuts; moveTo: (aPointOrNil ifNil: [ActiveWorld center]); getUserResponseAfter: seconds! |
Free forum by Nabble | Edit this page |