Relayering Madness

Geoff Canyon gcanyon at gmail.com
Fri Mar 15 21:39:59 EDT 2019


On Thu, Mar 14, 2019 at 4:24 PM J. Landman Gay via use-livecode <
use-livecode at lists.runrev.com> wrote:

> I guess I'm not sure what the problem was, I relayer groups all the
> time. I change the layer number in the group's property inspector
> though, since I don't use the Project Browser. Maybe it's different there.
>

The Project Browser allows you to drag anything to any layer, in a group or
out, and will make it happen. I believe (although I have not looked at the
code lately) that it does this by setting relayerGroupedControls to true.
Evidence for this is the fact that dragging a control to the layer just
above a group -- just below the group in the Project Browser -- will place
the control into the group.

<shameless plug>

This is how Navigator used to work as well. Several updates ago I changed
Navigator to use a sequence of steps involving editing groups, and setting
relayerGroupedControls to true only if necessary, so that:

1. Dragging to the layer just above a group does *not* place the control
into the group; just to the appropriate layer.
2. Dragging to a layer *in* a group moves the control into the group, at
that layer.
3. The above works even with nested groups (just checked, and I'm very
happy with my past self!) Meaning that if you have this:

stack "Untitled 1"
card id 1002
|  group id 1011 (1011)
|  |  group id 1006 (1006)
|  |  |  button "Button" (1003)
|  |  |  button "Button" (1007)
|  |  |  button "Button" (1004)
|  |  |  button "Button" (1005)
|  |  |  button "Button" (1009)
|  |  button "Button" (1010)
|  |  button "Button" (1008)
|  button "Button" (1012)
|  button "Button" (1013)

And you drag button id 1013 just under button id 1009, you get this:

stack "Untitled 1"
card id 1002
|  group id 1011 (1011)
|  |  group id 1006 (1006)
|  |  |  button "Button" (1003)
|  |  |  button "Button" (1007)
|  |  |  button "Button" (1004)
|  |  |  button "Button" (1005)
|  |  |  button "Button" (1009)
|  |  button "Button" (1013)
|  |  button "Button" (1010)
|  |  button "Button" (1008)
|  button "Button" (1012)

Note that button id 1013 is now in group id 1011, but it is *not* in group
id 1006.

Holding the option/alt key is not needed for any of this.



More information about the use-livecode mailing list