Problem with Groups

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
RossG
Posts: 247
Joined: Thu Jan 08, 2015 7:38 am

Problem with Groups

Post by RossG » Thu May 19, 2016 12:06 am

I have a number of groups one of which doesn't appear
in the Project Browser with the others.

Then I find it - listed as a "Custom Control".

What causes this and how do I turn it back to
an ordinary group?

Might it be something to do with copying an identical
group? Seems that I have to un-group the copy before
re-grouping and re-naming it.

LC 7.1.4, Win XP.
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8836
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Problem with Groups

Post by FourthWorld » Thu May 19, 2016 12:51 am

Sounds like you turned off the group's selectGroupedControls property in the Inspector. Turn that back on and the group's interior controls will become selectable again, resuming normal group behavior.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

RossG
Posts: 247
Joined: Thu Jan 08, 2015 7:38 am

Re: Problem with Groups

Post by RossG » Thu May 19, 2016 10:42 pm

Thanks Richard.

What would I do without you?

Love and kisses XXX
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.

RossG
Posts: 247
Joined: Thu Jan 08, 2015 7:38 am

Re: Problem with Groups

Post by RossG » Tue May 24, 2016 7:07 pm

Still having big problems with this one.

In fact this operation sends LC into paroxysms of confusion to
such an extent that when I tried to stop it the only option that
worked was to close my stack.

The alert popped up and asked if I wanted to save changes
to the Inspector stack. So investigate with care.

Select the group and edit. You'll see a field I've added a field pct36T by
copying and pasting field pct36O.

Tried in both LC7.1.2 and 8.0
Attachments
Group Copy Test Both.zip
(1.79 KiB) Downloaded 83 times
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.

RossG
Posts: 247
Joined: Thu Jan 08, 2015 7:38 am

Re: Problem with Groups

Post by RossG » Tue May 31, 2016 7:59 pm

The Answer:

The width of the group!

So ungroup before adding to the group
then group again.

LC seems to use the same group name as before.
Neat.

Update: But still something strange going on.
The Inspector is erratic.
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6190
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Problem with Groups

Post by jacque » Wed Jun 01, 2016 6:59 pm

Note that LC will only remember the group's previous name when it is re-grouped if you remain on that card. Any navigation permanently unsets the group and the name is lost.

It isn't clear what you want to do but there is almost always a way to manage grouped controls without ungrouping them. If you can explain the goal we can help.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

RossG
Posts: 247
Joined: Thu Jan 08, 2015 7:38 am

Re: Problem with Groups

Post by RossG » Wed Jun 01, 2016 10:25 pm

The problem is that on adding an object to a group
and re-grouping the Inspector offers the same group
name as before without changing the group width to
include the added object. As a result of this the new
object doesn't appear in the IDE and other objects will
be reduced in size to fit within the group size. Thus a
field which I had set to be 475 wide appeared in the
Inspector as 370 odd wide.

Whether or not you ungroup doesn't make any difference.

There is also strange behavior in LC8 where I found
that three separate groups had been placed in another
group together.

Also found that a re-grouped group (grpA) will sometimes appear
as a sub-group of grpA.

If this isn't a bug.....
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6190
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Problem with Groups

Post by jacque » Thu Jun 02, 2016 12:46 am

If the group's lockLoc property is true, the group will not resize to accomodate new objects. If lockLoc is false, it should expand automatically to fit the contents. But if it doesn't, you can do this:

Code: Select all

set the width of grp x to the formattedWidth of grp x
The problem you describe with group layering sounds like one that others have seen when using the Project Browser to relayer controls by dragging. If that's what you did, you may have hit the issue where the Project Browser is displaying controls by name rather than by layer order. Relayering when controls are alphabetized will give inconsistent results. Use the settings button at the top right of the PB to set the display order to a numerical one.

There is a bug where the sorting order will not update its checkmark in the popdown button, but the sorting order of the actual controls in the PB will be correct. Once they are shown in layer order you should be able to drag them accurately.

If you don't want to use the PB to relayer, you can manually assign layer numbers in the property inspector.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

RossG
Posts: 247
Joined: Thu Jan 08, 2015 7:38 am

Re: Problem with Groups

Post by RossG » Sat Jun 04, 2016 12:48 pm

I didn't use the PB to change the groups.
I selected the group then "Edit Group".
Then I selected all the items in the group
and clicked on "Ungroup".


As a user I'm not very interested in the internal
workings of LC but I expect that if I ungroup a group
the group name will disappear in the same way
that a file disappears when I delete it.

For it to be otherwise is perverse.
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6190
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Problem with Groups

Post by jacque » Sat Jun 04, 2016 4:24 pm

It isn't necessary to edit the the group and select its controls before ungrouping. Just select the group as a whole with the Edit tool and ungroup it.

The preservation of the original group name is to protect you if you accidentally ungroup. You can immediately regroup and the group will restore itself. This is useful if the group contains a script, which would be lost forever if there was no way to restore the original. But the regrouping is transitory. Leaving the card will lose it.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 8836
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Problem with Groups

Post by FourthWorld » Sat Jun 04, 2016 4:37 pm

RossG wrote:I didn't use the PB to change the groups.
I selected the group then "Edit Group".
Then I selected all the items in the group
and clicked on "Ungroup".
While reproducing that I think I found the root cause: the PB isn't refreshing after using its "Ungroup" context menu item; report submitted:
http://quality.livecode.com/show_bug.cgi?id=17791
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

RossG
Posts: 247
Joined: Thu Jan 08, 2015 7:38 am

Re: Problem with Groups

Post by RossG » Sat Jun 04, 2016 9:28 pm

Richard

Thanks. More love and kisses XXX.
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.

RossG
Posts: 247
Joined: Thu Jan 08, 2015 7:38 am

Re: Problem with Groups

Post by RossG » Sat Jun 04, 2016 9:46 pm

jacque wrote:It isn't necessary to edit the the group and select its controls before ungrouping. Just select the group as a whole with the Edit tool and ungroup it.

The preservation of the original group name is to protect you if you accidentally ungroup. You can immediately regroup and the group will restore itself. This is useful if the group contains a script, which would be lost forever if there was no way to restore the original. But the regrouping is transitory. Leaving the card will lose it.
jacque

I can't imagine that I would ever "accidently" ungroup a group.
The point of my post is that when I add to a group and accept
the same group name the size of the group isn't changed to
accommodate the addition.

You can see the effect of this in the test stack I posted above.
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 6190
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Problem with Groups

Post by jacque » Sat Jun 04, 2016 11:14 pm

RossG wrote:I can't imagine that I would ever "accidently" ungroup a group.
The point of my post is that when I add to a group and accept
the same group name the size of the group isn't changed to
accommodate the addition.
The keyboard shortcut is Cmd-G which is the same as the shortcut to group (and also the shortcut for "find again") so it happens.
You can see the effect of this in the test stack I posted above.
As I mentioned, turn off lockLoc and it works as you expect. If you are not showing the native LC syntax in the property inspector, the checkbox is called "Lock size and position".
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”