[Cuis-dev] Morphic events changes proposal
Luciano Notarfrancesco
luchiano at gmail.com
Sat Nov 22 04:36:36 PST 2025
This is a little tweak intended to be applied on top of the previous change
set. When the preference focusFollowsMouse is enabled, it prevents doing it
while the hand is dragging something.
On Mon, Nov 17, 2025 at 3:10 PM Luciano Notarfrancesco <luchiano at gmail.com>
wrote:
> 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/20251122/dd90e6dd/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MouseOverHandler-dispatchMouseOverEvent.st
Type: application/octet-stream
Size: 3407 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20251122/dd90e6dd/attachment.obj>
More information about the Cuis-dev
mailing list