[squeak-dev] The Inbox: Morphic-cbc.1665.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Jun 6 02:38:37 UTC 2020


A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-cbc.1665.mcz

==================== Summary ====================

Name: Morphic-cbc.1665
Author: cbc
Time: 5 June 2020, 7:38:31.284262 pm
UUID: c887ffd7-40ae-3547-8240-13186db081c8
Ancestors: Morphic-cbc.1664

Add support for locking a morph so that it doesn't accept keyboard actions - but is still accessible with the mouse.  Sending #rejectKeyboardFocus will make that morph completely ignore keyboard events of any kind.  A morph can be tested with #shouldRejectKeyboardFocus to see if this should happen.
DialogWindow has been modified to reject keyboard focus, so that in (say, ConfirmDialogs) you can still use the keyboard to interact with the keys AND you can interact with the message text via the mouse.
(Also updated StringMorph similarly.)

=============== Diff against Morphic-cbc.1664 ===============

Item was changed:
  ----- Method: DialogWindow>>createMessage: (in category 'initialization') -----
  createMessage: aString 
  	
  	messageMorph := aString asText asMorph.
  	messageMorph
  		name: 'Message';
  		readOnly: true;
  		setProperty: #indicateKeyboardFocus toValue: #never;
+ 		rejectKeyboardFocus.
- 		lock.
  	self setMessageParameters.	
  	^ messageMorph!

Item was added:
+ ----- Method: Morph>>rejectKeyboardFocus (in category 'accessing') -----
+ rejectKeyboardFocus
+ 	self rejectKeyboardFocus: true.!

Item was added:
+ ----- Method: Morph>>rejectKeyboardFocus: (in category 'accessing') -----
+ rejectKeyboardFocus: boolean
+ 	self setProperty: #rejectKeyboardFocus toValue: boolean!

Item was changed:
  ----- Method: Morph>>rejectsEvent: (in category 'events-processing') -----
  rejectsEvent: anEvent
  	"Return true to reject the given event. Rejecting an event means neither the receiver nor any of it's submorphs will be given any chance to handle it."
+ 	^self isLocked or: [self visible not or: [anEvent isKeyboard and: [self shouldRejectKeyboardFocus]]]!
- 	^self isLocked or:[self visible not]!

Item was added:
+ ----- Method: Morph>>rejectsKeyboardFocus (in category 'testing') -----
+ rejectsKeyboardFocus
+ 	^self valueOfProperty: #rejectKeyboardFocus ifAbsent: [false]!

Item was added:
+ ----- Method: Morph>>shouldRejectKeyboardFocus (in category 'testing') -----
+ shouldRejectKeyboardFocus
+ 	^self valueOfProperty: #rejectKeyboardFocus ifAbsent: [false]!

Item was changed:
  ----- Method: StringMorph>>wouldAcceptKeyboardFocus (in category 'event handling') -----
  wouldAcceptKeyboardFocus
+ 	^ self isLocked not and: [self shouldRejectKeyboardFocus not]!
- 	^ self isLocked not!



More information about the Squeak-dev mailing list