[squeak-dev] The Trunk: Morphic-tonyg.1899.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Wed Feb 16 16:16:22 UTC 2022


Nice catch! Thanks!

Best,
Marcel
Am 16.02.2022 15:44:42 schrieb commits at source.squeak.org <commits at source.squeak.org>:
Tony Garnock-Jones uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-tonyg.1899.mcz

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

Name: Morphic-tonyg.1899
Author: tonyg
Time: 16 February 2022, 3:33:03.719368 pm
UUID: 0c424705-35f2-4062-a306-8bab3d613ee9
Ancestors: Morphic-mt.1898

Remove unwanted reimplementations of `handleMouseMove:` in PluggableListMorph and SimpleHierarchicalListMorph.

Looking at the available history, it seems that `handleMouseMove:` was copied-and-modified in these two classes from the main Morph implementation sometime before `handlesMouseMove:` was introduced to the image.

Compared to Morph's implementation, the list morphs both update some notion of a hover row, and then decide whether or not to proceed in a way that can be captured by a `handlesMouseMove:` implementation.

This change therefore changes the two classes' `handleMouseMove:` implementations to delegate back to Morph's implementation, after managing their hover row logic. It also moves the custom "should we proceed?" logic into `handlesMouseMove:` implementations.

=============== Diff against Morphic-mt.1898 ===============

Item was changed:
- SystemOrganization addCategory: #'Morphic-Balloon'!
- SystemOrganization addCategory: #'Morphic-Basic'!
SystemOrganization addCategory: #'Morphic-Basic-NewCurve'!
+ SystemOrganization addCategory: #'Morphic-Pluggable Widgets'!
- SystemOrganization addCategory: #'Morphic-Borders'!
SystemOrganization addCategory: #'Morphic-Collections-Arrayed'!
+ SystemOrganization addCategory: #'Morphic-Widgets'!
- SystemOrganization addCategory: #'Morphic-Demo'!
- SystemOrganization addCategory: #'Morphic-Events'!
SystemOrganization addCategory: #'Morphic-Explorer'!
+ SystemOrganization addCategory: #'Morphic-Borders'!
- SystemOrganization addCategory: #'Morphic-Kernel'!
- SystemOrganization addCategory: #'Morphic-Layouts'!
- SystemOrganization addCategory: #'Morphic-Menus'!
SystemOrganization addCategory: #'Morphic-Menus-DockingBar'!
+ SystemOrganization addCategory: #'Morphic-Menus'!
- SystemOrganization addCategory: #'Morphic-Pluggable Widgets'!
- SystemOrganization addCategory: #'Morphic-Sound-Synthesis'!
SystemOrganization addCategory: #'Morphic-Support'!
- SystemOrganization addCategory: #'Morphic-Text Support'!
SystemOrganization addCategory: #'Morphic-TrueType'!
+ SystemOrganization addCategory: #'Morphic-Basic'!
+ SystemOrganization addCategory: #'Morphic-Demo'!
- SystemOrganization addCategory: #'Morphic-Widgets'!
SystemOrganization addCategory: #'Morphic-Windows'!
+ SystemOrganization addCategory: #'Morphic-Balloon'!
+ SystemOrganization addCategory: #'Morphic-Kernel'!
+ SystemOrganization addCategory: #'Morphic-Sound-Synthesis'!
SystemOrganization addCategory: #'Morphic-Worlds'!
+ SystemOrganization addCategory: #'Morphic-Layouts'!
+ SystemOrganization addCategory: #'Morphic-Text Support'!
+ SystemOrganization addCategory: #'Morphic-Events'!

Item was changed:
----- Method: PluggableListMorph>>handleMouseMove: (in category 'events-processing') -----
handleMouseMove: anEvent
+ anEvent wasHandled ifFalse: [self hoverRow: (self rowAtLocation: anEvent position)].
+ super handleMouseMove: anEvent.!
- "Reimplemented because we really want #mouseMove when a morph is dragged around"
- anEvent wasHandled ifTrue:[^self]. "not interested"
- self hoverRow: (self rowAtLocation: anEvent position).
- (anEvent anyButtonPressed and:[anEvent hand mouseFocus == self]) ifFalse:[^self].
- anEvent wasHandled: true.
- self mouseMove: anEvent.
- (self handlesMouseStillDown: anEvent) ifTrue:[
- "Step at the new location"
- self startStepping: #handleMouseStillDown:
- at: Time millisecondClockValue
- arguments: {anEvent copy resetHandlerFields}
- stepTime: 1].
- !

Item was added:
+ ----- Method: PluggableListMorph>>handlesMouseMove: (in category 'event handling') -----
+ handlesMouseMove: anEvent
+ ^ anEvent anyButtonPressed and: [anEvent hand mouseFocus == self]!

Item was changed:
----- Method: SimpleHierarchicalListMorph>>handleMouseMove: (in category 'events-processing') -----
handleMouseMove: anEvent
+ anEvent wasHandled ifFalse: [self hoveredMorph: (self itemFromPoint: anEvent position)].
+ super handleMouseMove: anEvent.!
- "Reimplemented because we really want #mouseMove when a morph is dragged around"
- anEvent wasHandled ifTrue:[^self]. "not interested"
- self hoveredMorph: (self itemFromPoint: anEvent position).
- (anEvent anyButtonPressed and:[anEvent hand mouseFocus == self]) ifFalse:[^self].
- anEvent wasHandled: true.
- self mouseMove: anEvent.
- (self handlesMouseStillDown: anEvent) ifTrue:[
- "Step at the new location"
- self startStepping: #handleMouseStillDown:
- at: Time millisecondClockValue
- arguments: {anEvent copy resetHandlerFields}
- stepTime: 1].
- !

Item was added:
+ ----- Method: SimpleHierarchicalListMorph>>handlesMouseMove: (in category 'event handling') -----
+ handlesMouseMove: anEvent
+ ^ anEvent anyButtonPressed and: [anEvent hand mouseFocus == self]!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220216/6d8b1575/attachment.html>


More information about the Squeak-dev mailing list