[Cuis-dev] Morphic events changes proposal
Luciano Notarfrancesco
luchiano at gmail.com
Mon Nov 17 00:10:18 PST 2025
Here's the changes I recently made to Morphic events to try and improve
drag & drop. Let me know what you think. The change set adds the following
protocol:
- Morph>>dragEnter: and dragLeave: analogous to the existing mouseEnter:,
mouseLeave: and mouseHover:localPosition:, but they are only called when
the hand is dragging something (i.e., it's not empty, has submorphs) and
the morph answers true to handlesDragOver: (analogous to the existing
handlesMouseOver:);
- Morph>>dragHover:localPosition: and handlesDragHover (parallel to the
existing mouseHover:localPosition: and handlesMouseHover);
- Morph>>dragCancel is called by the hand if the user presses ESC while
dragging this morph; this gives the dragged morph an opportunity to cancel
the drag, for example by deleting itself or returning to its original owner
and position (but by default does nothing).
Also, I fixed a problem when creating MouseScrollEvents: the vertical
direction was given priority, and horizontal scroll events were missed. And
I also added a delta instance variable to MouseScrollEvent, instead of
throwing it away, so a consumer of the event has the opportunity to scroll
in both directions simultaneously and at the correct speed. This
information is optional, and might not be available in all platforms (I
tried only Mac), but from what I read it is now quite standard (except in
legacy Linux X11). It's very useful for navigating a ZUI, which is what I'm
doing.
Other systems also separate mouseEnter/etc from dragEnter/etc, so I tried
to do the same, I don't want to reinvent anything. Let me know if anyone
has any better or different ideas.
The change set also includes some unrelated changes, please review: a
method to draw arcs that was missing in AbstractVectorCanvas, and two
methods to scale and translate PlacedMorphs (I'm not sure if the best
selector is scaleBy:around: or scaleBy:about:).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20251117/0ec0cb9e/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 7664-CuisCore-LucianoEstebanNotarfrancesco-2025Oct20-22h00m-len.010.cs.st
Type: application/octet-stream
Size: 17064 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20251117/0ec0cb9e/attachment-0001.obj>
More information about the Cuis-dev
mailing list