Navigator Update -- Drag and Drop!
gcanyon at gmail.com
Mon Feb 12 11:26:53 EST 2018
It took some effort :-)
I'm in an unusual position because the selection of objects in Navigator's
live display *really* messes with the traditional drag/drop messages and
the selection within the field I use for the list display. I tried very
hard to work around that many years back, but finally gave up, and used a
set of drag and drop code that just depended on mouseDown, mouseMove,
mouseUp, and mouseRelease. I think it was from Scott Rossi originally, but
I'm not sure.
The new code builds on that, and uses two stacks with their blendlevel set
to something like 80: one to represent the dragged objects, one to
highlight the targets.
Despite the mouse leaving the list and being over the drag stack, the
mouseMove messages still go to the list field. So I dispatch a message from
there to the drag stack, to keep things clean in the list field. There's a
lot of translation from local to screen coordinates. All of the code is
available in Navigator, or at the Navigator GitHub repository
<https://github.com/gcanyon/navigator>. It's not particularly clean at
present because I built it all wrong the first time, and then re-built it.
When I go back in I'll cut away the vestigial code. There is still a ton to
1. Dragging from stacks into Navigator.
2. Dragging from Navigator into another Navigator.
3. Alignment to existing controls in stacks I drag into -- this is why I
started the project in the first place.
If you have any questions, let me know.
On Mon, Feb 12, 2018 at 7:50 AM, Bob Sneidar via use-livecode <
use-livecode at lists.runrev.com> wrote:
> Sure like to know how you do that. I've tried but cannot get it to work.
> I'd like to make a smartObjects panel so I could store and clone common
> objects with scripts, properties and backscripts already intact, but I
> never was able to get the drag/drop functionality working.
> Bob S
> > On Feb 12, 2018, at 01:52 , Geoff Canyon via use-livecode <
> use-livecode at lists.runrev.com> wrote:
> > Drag and drop has always been just within a single Navigator window --
> > between Navigator windows, and not to/from open stacks. That changes (a
> > bit) today! You can now select any set of controls in a Navigator window
> > and drag them out of that window and onto any open stack. Detailed
> > documentation will come tomorrow, but there are notes below.
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
More information about the use-livecode