Re: Navigator Update -- Drag and Drop!

2018-02-12 Thread Geoff Canyon via use-livecode
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
. 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
do:

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.

gc

On Mon, Feb 12, 2018 at 7:50 AM, Bob Sneidar via use-livecode <
use-livecode@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@lists.runrev.com> wrote:
> >
> > Drag and drop has always been just within a single Navigator window --
> not
> > 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@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Navigator Update -- Drag and Drop!

2018-02-12 Thread Bob Sneidar via use-livecode
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 
>  wrote:
> 
> Drag and drop has always been just within a single Navigator window -- not
> 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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Navigator Update -- Drag and Drop!

2018-02-12 Thread Geoff Canyon via use-livecode
Drag and drop has always been just within a single Navigator window -- not
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.

I'm very much looking for feedback on the visual and physical method of
dragging. I put some effort into making it as intuitive as possible, so let
me know what works for you and what doesn't. More is coming...

You can get Navigator here
.

This update also fixes the issue of Navigator's behavior stacks polluting
the project browser and Navigator. I'm sure glad I wrote the export/restore
code -- I've done it about a dozen times now.

regards,

Geoff


Notes:

When you drag out from a Navigator window, the drag image will represent
all the controls being dragged: their size and position relative to each
other (their rects).

This can be any selection of controls from a Navigator window, so controls
from different cards, different stacks, it doesn't matter.

Available stacks to drop on will be highlighted. Drag over a stack, and the
focus narrows to that stack, showing the top-level groups in that stack.
Drag over a group, and that group will be highlighted, and on and on.

You can drop on a stack, or into any group on that stack, just by dragging
into it. All the controls will be positioned in their same relative
position, wherever you dropped them.

Holding the control key stops the entry/exit from groups and stacks, so if
you want to add something to a group, but place it outside the group's
current boundaries, just drag over the group to highlight it, then hold the
control key and drag to wherever you want to place the controls. This also
means you can place controls outside a stack's window by highlighting the
stack, then holding the control key while you drag back outside the stack.

All controls are copied at present, even controls from the same card you're
dragging to.

Dragging a card onto a stack copies the whole card (from another stack, or
duplicating it within a given stack).

Dragging a stack onto another stack makes it a substack of that stack.
Dragging it onto itself makes it a mainstack.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


UPDATE: Drag and Drop

2011-02-15 Thread Bob Sneidar
As far as the problems I have been having with drag and drop, I discovered I 
had a bad datagrid. When I deleted and recreated the datagrid, everything began 
to work properly again, with the exact same scripts (I saved and restored the 
scripts). Oddly, dropping onto any other column besides the third one worked, 
but dropping on the third column produced a bad dragDestination, and trying to 
get the dgIndex of the dragDestination returned empty. 

This frankly scares the bejesus out of me because at any point I can have a 
corrupted datagrid, and not know it until after I deploy. I am going to have to 
be very, very careful when working with these things. 

Also, the help says that the dragDestination is only available in the dragDrop 
handler, but I am using it in the dragReorderDrop handler (as per Datagrid 
Helper) and it works fine. Also, there is no help entry for dragReorderDrop. 

Bob



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode