Expanding borders of Groups
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Expanding borders of Groups
If I make a group of 2 objects, where the largest is 120 x 120 pixels the group measures 128 x 128 pixels:
This is not always what one wants.
I often want my group to be the same size as the biggest object within it.
HOWEVER, if I resize my group to 120 x 120 pixels the component objects end up being displaced:
The way to avoid this is fiddly, but effective: one has to centre each component object using the
Properties Palette:
This is not always what one wants.
I often want my group to be the same size as the biggest object within it.
HOWEVER, if I resize my group to 120 x 120 pixels the component objects end up being displaced:
The way to avoid this is fiddly, but effective: one has to centre each component object using the
Properties Palette:
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Expanding borders of Groups
To speed things up, having grouped ones objects, one can then unGroup them
again and position them all together, and then reGroup them.
again and position them all together, and then reGroup them.
Re: Expanding borders of Groups
Richmond,
Just set the margins of the group to 0 (zero).
It will contract to the size of the largest object within.
Jim Lambert
Just set the margins of the group to 0 (zero).
It will contract to the size of the largest object within.
Jim Lambert
Re: Expanding borders of Groups
Rather it will contract to the extents of the objects within the group.
When you group objects LC adds a 4 pixel margin.
So if you have a 120x120 object and then group it, the group will be 128x128 - as your example shows.
Simply set the group's margin to 0, and you will end up with a group that is 120x120.
Jim Lambert
When you group objects LC adds a 4 pixel margin.
So if you have a 120x120 object and then group it, the group will be 128x128 - as your example shows.
Simply set the group's margin to 0, and you will end up with a group that is 120x120.
Jim Lambert
Re: Expanding borders of Groups
Besides margins, turn off lockLoc. It's preventing the group from automatically snapping to the size of the components.
You can turn it on again after it resizes if you want.
You can turn it on again after it resizes if you want.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Expanding borders of Groups
Thanks jacque and jimi both!
However, the dictionary says this:
However, the dictionary says this:
So I wonder why one needs to turn it OFF for a group.By default, the lockLocation property of a newly created control is set to false.
Re: Expanding borders of Groups
It's off by default unless something has changed the templateGroup, but in your images it's been turned on.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Expanding borders of Groups
Well, I locked my images, but I DIDN"T lock my Group when
I grouped the images.
Maybe, had I not locked the images initially . . . .
I grouped the images.
Maybe, had I not locked the images initially . . . .
Re: Expanding borders of Groups
I just tested in LC 8 and grouping does not set the lockLoc of the group to true. You may have had selectGroupedControls turned off when you locked what you thought was an image, and accidentally locked the group instead.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Livecode Opensource Backer
- Posts: 10099
- Joined: Fri Feb 19, 2010 10:17 am
Re: Expanding borders of Groups
I did that in 7.1.4.I just tested in LC 8