The Trunk: Morphic-mt.987.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Morphic-mt.987.mcz

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

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

Name: Morphic-mt.987
Author: mt
Time: 3 June 2015, 7:30:01.792 am
UUID: 61893b51-713a-044a-9f42-a9682768f6d1
Ancestors: Morphic-cmm.986

Fixes a regression in scroll bars that "automagically" scrolled on mouse move due to the latest changes.

Makes #wantsEveryMouseMove functional again and adds it to the EventHandler, too. It also duplicates the additional checks regarding mouse focus, submorphs, button down, etc.

=============== Diff against Morphic-cmm.986 ===============

Item was changed:
  Object subclass: #EventHandler
+ instanceVariableNames: 'mouseDownRecipient mouseDownSelector mouseMoveRecipient mouseMoveSelector mouseStillDownRecipient mouseStillDownSelector mouseUpRecipient mouseUpSelector mouseEnterRecipient mouseEnterSelector mouseLeaveRecipient mouseLeaveSelector mouseEnterDraggingRecipient mouseEnterDraggingSelector mouseLeaveDraggingRecipient mouseLeaveDraggingSelector keyStrokeRecipient keyStrokeSelector keyUpRecipient keyUpSelector keyDownRecipient keyDownSelector valueParameter startDragRecipient startDragSelector doubleClickSelector doubleClickRecipient doubleClickTimeoutSelector doubleClickTimeoutRecipient clickSelector clickRecipient keyboardFocusChangeRecipient keyboardFocusChangeSelector wantsEveryMouseMove'
- instanceVariableNames: 'mouseDownRecipient mouseDownSelector mouseMoveRecipient mouseMoveSelector mouseStillDownRecipient mouseStillDownSelector mouseUpRecipient mouseUpSelector mouseEnterRecipient mouseEnterSelector mouseLeaveRecipient mouseLeaveSelector mouseEnterDraggingRecipient mouseEnterDraggingSelector mouseLeaveDraggingRecipient mouseLeaveDraggingSelector keyStrokeRecipient keyStrokeSelector keyUpRecipient keyUpSelector keyDownRecipient keyDownSelector valueParameter startDragRecipient startDragSelector doubleClickSelector doubleClickRecipient doubleClickTimeoutSelector doubleClickTimeoutRecipient clickSelector clickRecipient keyboardFocusChangeRecipient keyboardFocusChangeSelector'
  classVariableNames: ''
  poolDictionaries: ''
  category: 'Morphic-Events'!
 
  !EventHandler commentStamp: '<historical>' prior: 0!
  Events in Morphic originate in a Hand, pass to a target morph, and are then dispatched by an EventHandler.  EventHandlers support redirection of mouse and keyboard activity by specifying and independent recipient object and message selector for each of the possible events.  In addition each eventHandler can supply an optional value parameter for distinguishing between, eg, events from a number of otherwise identical source morphs.
 
  The basic protocol of an event handler is to receive a message of the form
  mouseDown: event in: targetMorph
  and redirect this as one of
  mouseDownRecipient perform: mouseDownSelector0
  mouseDownRecipient perform: mouseDownSelector1 with: event
  mouseDownRecipient perform: mouseDownSelector2 with: event with: targetMorph
  mouseDownRecipient perform: mouseDownSelector3 with: event with: targetMorph with: valueParameter
  depending on the arity of the mouseDownSelector.
  !

Item was changed:
  ----- Method: EventHandler>>handlesMouseMove: (in category 'testing') -----
  handlesMouseMove: evt
+
+ ^ self wantsEveryMouseMove == true
+ or: [((((mouseMoveRecipient notNil and: [mouseMoveSelector notNil])
+ and: [evt hand hasSubmorphs not])
+ and: [evt anyButtonPressed])
+ and: [evt hand mouseFocus notNil])
+ and: [evt hand mouseFocus eventHandler == self]]!
- ^mouseMoveRecipient notNil and:[mouseMoveSelector notNil]!

Item was added:
+ ----- Method: EventHandler>>wantsEveryMouseMove (in category 'access') -----
+ wantsEveryMouseMove
+
+ ^ wantsEveryMouseMove!

Item was added:
+ ----- Method: EventHandler>>wantsEveryMouseMove: (in category 'access') -----
+ wantsEveryMouseMove: aBoolean
+
+ wantsEveryMouseMove := aBoolean.!

Item was changed:
  ----- Method: Morph>>handlesMouseMove: (in category 'event handling') -----
  handlesMouseMove: anEvent
  "Do I want to receive mouseMove: when the hand passes over the receiver?  Rules say that by default a morph gets #mouseMove iff
  * the hand is not dragging anything,
  + and some button is down,
  + and the receiver is the current mouse focus."
  self eventHandler ifNotNil: [^ self eventHandler handlesMouseMove: anEvent].
+ self wantsEveryMouseMove ifTrue: [^ true].
  anEvent hand hasSubmorphs ifTrue: [ ^ false ].
  (anEvent anyButtonPressed and: [ anEvent hand mouseFocus == self ]) ifFalse: [ ^ false ].
  ^ true!

Item was removed:
- ----- Method: ProportionalSplitterMorph>>wantsEveryMouseMove (in category 'events') -----
- wantsEveryMouseMove
-
- ^ true!