[Cuis-dev] Morphic events changes proposal
Juan Vuletich
juan at cuis.st
Wed Nov 26 05:06:37 PST 2025
Hi Luciano,
These are very neat. Thank you!
They are now at GitHub.
Cheers,
On 2025-11-22 9:36 AM, Luciano Notarfrancesco via Cuis-dev wrote:
> 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:).
>
>
--
Juan Vuletich
www.cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20251126/65293146/attachment-0001.htm>
More information about the Cuis-dev
mailing list