[squeak-dev] The Trunk: Morphic-mt.903.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Apr 19 10:36:20 UTC 2015


Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.903.mcz

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

Name: Morphic-mt.903
Author: mt
Time: 19 April 2015, 12:35:43.345 pm
UUID: 76cd0e0e-5968-5246-ac59-c912e2e572b9
Ancestors: Morphic-mt.902

Changed mouse-down handling in Morph to be better configurable w/o subclassing.

That is, on a yellow-button press, always ask the event handler if any. Mouse-down-priority is now configurable.

=============== Diff against Morphic-mt.902 ===============

Item was changed:
  ----- Method: Morph>>mouseDown: (in category 'event handling') -----
  mouseDown: evt 
  	"Handle a mouse down event. The default response is to let my 
  	eventHandler, if any, handle it."
+ 
- 	evt yellowButtonPressed
- 		ifTrue: ["First check for option (menu) click"
- 			^ self yellowButtonActivity: evt shiftPressed].
  	self eventHandler
+ 		ifNotNil: [self eventHandler mouseDown: evt fromMorph: self].
+ 
+ 	"Check for option (menu) click"
+ 	evt yellowButtonPressed
+ 		ifTrue: [^ self yellowButtonActivity: evt shiftPressed].
- 		ifNotNil: [self eventHandler mouseDown: evt fromMorph: self]
  !

Item was changed:
  ----- Method: Morph>>mouseDownPriority (in category 'events-processing') -----
  mouseDownPriority
+ 	"Return the default mouse down priority for the receiver. This supports a morph to get mouse down before one of its children."
- 	"Return the default mouse down priority for the receiver"
  
+ 	^ self
+ 		valueOfProperty: #mouseDownPriority
+ 		ifAbsent: [(self isPartsDonor or: [self isPartsBin])
+ 			ifTrue:	[50]
+ 			ifFalse:	[0]].
+ 		
- 	^ (self isPartsDonor or: [self isPartsBin])
- 		ifTrue:	[50]
- 		ifFalse:	[0]
- 
  	"The above is a workaround for the complete confusion between parts donors and parts bins. Morphs residing in a parts bin may or may not have the parts donor property set; if they have they may or may not actually handle events. To work around this, parts bins get an equal priority to parts donors so that when a morph in the parts bin does have the property set but does not handle the event we still get a copy from picking it up through the parts bin. Argh. This just *cries* for a cleanup."
  	"And the above comment is Andreas's from 10/2000, which was formerly retrievable by a #flag: call which however caused a problem when trying to recompile the method from decompiled source."!

Item was added:
+ ----- Method: Morph>>mouseDownPriority: (in category 'events-processing') -----
+ mouseDownPriority: anInteger
+ 	
+ 	anInteger = 0 ifTrue: [^ self removeProperty: #mouseDownPriority].
+ 	
+ 	self
+ 		setProperty: #mouseDownPriority
+ 		toValue: anInteger.!



More information about the Squeak-dev mailing list