[Morphic][BUG?][Drag&Drop] mouseLeaveDragging events occure too many and these at wrong times

Stephan Rudlof sr at evolgo.de
Mon Mar 27 17:44:36 UTC 2000


Bob and others,

the changeset in the ML mail with subject

"[Morphic][Events][Drag&Drop] Event handler for border crossing mouse
events: What do you think about the implementation?"

(new thread started) supplies a much better solution to the problem as
the suggestion below...


Regards,

Stephan


Stephan Rudlof wrote:
> 
> Here is my suggestion for mouseUp events: HandMorph>>
> 
> handleMouseUp: evt
>         "Stephan's variant..."
>         "Dispatch a mouseUp event."
>         | oldFocus |
>         clickState ~~ #idle ifTrue: [self checkForDoubleClick: evt].
>         "drop morphs being carried, if any"
>         self hasSubmorphs ifTrue: [self dropMorphsEvent: evt].
>         ">>>>>mouseDownMorph = nil ifTrue: [^ self].<<<<<"
>         oldFocus _ mouseDownMorph.
>         "make sure that focus becomes nil."
>         mouseDownMorph _ nil.
>         "mouse focus transaction ends when mouse goes up"
>         oldFocus ifNotNil: [oldFocus mouseUp: (self transformEvent: evt)].
>         dragOverMorphs copy do:
>                 [:m |
>                 dragOverMorphs remove: m.
>                 oldFocus notNil ifTrue: [m mouseLeaveDragging: (evt transformedBy: (m
> transformFrom: self))]]
> 
> It eats up superfluous mouseUp events. Now just the mouseDown variant is
> missing...
> 
> Greetings,
> 
> Stephan

-- 
Stephan Rudlof (sr at evolgo.de)
   "Genius doesn't work on an assembly line basis.
    You can't simply say, 'Today I will be brilliant.'"
    -- Kirk, "The Ultimate Computer", stardate 4731.3





More information about the Squeak-dev mailing list