Cannot keep groups intact

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10309
Joined: Wed May 06, 2009 2:28 pm

Cannot keep groups intact

Post by dunbarx » Fri Dec 20, 2024 6:31 pm

In a project I have a few dozen small groups. Each group contains one field and one button. They are all similarly constructed, with the field on top of the button. A process selects certain groups in a certain order, and places them side by side in a line. I use the left and right properties of each group to locate the position of its upcoming adjacent neighbor This works just fine, sort of.

The groups keep changing their rects, invariably growing larger after many such operations. This ruins the result, with the groups spreading out along the line since their "size" properties keep changing. I have a tool that sets custom properties for the desired rect and loc of each group. Running that works fine, but after a few actual lineups, the rects change. How that is possible is the mystery. Why they ignore their rect-setting custom property is another.

I just tried setting the lockLoc and clipsToRect properties of each group. Will see if that makes a difference, though I cannot imagine how it should.

Craig

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10309
Joined: Wed May 06, 2009 2:28 pm

Re: Cannot keep groups intact

Post by dunbarx » Fri Dec 20, 2024 10:36 pm

Well, setting those two properties fixed the waywardness of those groups.

As I am fond of saying, I am happy to resolve a problem even if I do not understand the solution.

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10044
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Cannot keep groups intact

Post by FourthWorld » Fri Dec 20, 2024 10:37 pm

The lockLoc property prevents default resizing of objects.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10309
Joined: Wed May 06, 2009 2:28 pm

Re: Cannot keep groups intact

Post by dunbarx » Sat Dec 21, 2024 4:44 am

Richard. I know, and I should have just set it from the start. But that does not explain why they did that in the first place.

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10044
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Cannot keep groups intact

Post by FourthWorld » Sat Dec 21, 2024 5:43 am

dunbarx wrote:
Sat Dec 21, 2024 4:44 am
Richard. I know, and I should have just set it from the start. But that does not explain why they did that in the first place.
But it does. By default, groups adjust to be able to show their contents.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10309
Joined: Wed May 06, 2009 2:28 pm

Re: Cannot keep groups intact

Post by dunbarx » Sun Dec 22, 2024 2:59 am

Richard.

I never adjusted the relationship between the child button and the field. I only moved the group itself around the card.

This really happened. The first time or two I carefully resized the group boundaries so that it was just barely larger than the two child controls inside.That way when I created lines of groups I could control the spacing between them. When the groups started to expand erratically, the spacing became erratic.

Just me again?

Craig

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Cannot keep groups intact

Post by jacque » Sun Dec 22, 2024 6:45 pm

The default is to expand groups to fit the content. You have to change the group properties to turn that off.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10309
Joined: Wed May 06, 2009 2:28 pm

Re: Cannot keep groups intact

Post by dunbarx » Mon Dec 23, 2024 6:36 pm

Jacque.
The default is to expand groups to fit the content.
Sure, but the text of the field never changed. The button was actually a pulldown, but was sized so that no selection from its possible menu choices exceeded its width. I did that so that I could arrange the groups evenly spaced along a row.

When the groups expanded, they did so in both height and width, and always created a wider empty space on the left than on the right. That is they did not expand symmetrically about the child controls.

Just me. :wink:

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10044
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Cannot keep groups intact

Post by FourthWorld » Wed Dec 25, 2024 2:06 am

dunbarx wrote:
Sun Dec 22, 2024 2:59 am
Richard.

I never adjusted the relationship between the child button and the field. I only moved the group itself around the card.

This really happened. The first time or two I carefully resized the group boundaries so that it was just barely larger than the two child controls inside.That way when I created lines of groups I could control the spacing between them. When the groups started to expand erratically, the spacing became erratic.

Just me again?

Craig
Sounds odd, but without seeing an example I can't have an informed opinion about what's happening.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10309
Joined: Wed May 06, 2009 2:28 pm

Re: Cannot keep groups intact

Post by dunbarx » Wed Dec 25, 2024 9:42 pm

Richard, Jacque.

Not my first bizarre rodeo. Anyway, changing properties solved it, and you know what I think about solving problems without understanding how.

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10044
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Cannot keep groups intact

Post by FourthWorld » Thu Dec 26, 2024 2:23 am

dunbarx wrote:
Wed Dec 25, 2024 9:42 pm
Richard, Jacque.

Not my first bizarre rodeo. Anyway, changing properties solved it, and you know what I think about solving problems without understanding how.
Happy to help if it becomes possible to do so. What property changes fixed it?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10309
Joined: Wed May 06, 2009 2:28 pm

Re: Cannot keep groups intact

Post by dunbarx » Thu Dec 26, 2024 6:10 am

Richard.

I set the lockLoc of each group. I also set their clipsToRect property, which I had barely ever heard of, just because it was right there in the inspector. LockLoc does not prevent relocating a control under script control, just under mouse action, so arranging groups in a line was unaffected. But it made those groups behave in terms of sticking to their #@%^&$# widths and heights.

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10044
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Cannot keep groups intact

Post by FourthWorld » Thu Dec 26, 2024 6:04 pm

dunbarx wrote:
Thu Dec 26, 2024 6:10 am
I also set their clipsToRect property, which I had barely ever heard of, just because it was right there in the inspector.
Had you also tried not setting that property?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply