Page 1 of 1
Cannot keep groups intact
Posted: Fri Dec 20, 2024 6:31 pm
by dunbarx
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
Re: Cannot keep groups intact
Posted: Fri Dec 20, 2024 10:36 pm
by dunbarx
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
Re: Cannot keep groups intact
Posted: Fri Dec 20, 2024 10:37 pm
by FourthWorld
The lockLoc property prevents default resizing of objects.
Re: Cannot keep groups intact
Posted: Sat Dec 21, 2024 4:44 am
by dunbarx
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
Re: Cannot keep groups intact
Posted: Sat Dec 21, 2024 5:43 am
by FourthWorld
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.
Re: Cannot keep groups intact
Posted: Sun Dec 22, 2024 2:59 am
by dunbarx
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
Re: Cannot keep groups intact
Posted: Sun Dec 22, 2024 6:45 pm
by jacque
The default is to expand groups to fit the content. You have to change the group properties to turn that off.
Re: Cannot keep groups intact
Posted: Mon Dec 23, 2024 6:36 pm
by dunbarx
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.
Craig
Re: Cannot keep groups intact
Posted: Wed Dec 25, 2024 2:06 am
by FourthWorld
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.
Re: Cannot keep groups intact
Posted: Wed Dec 25, 2024 9:42 pm
by dunbarx
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
Re: Cannot keep groups intact
Posted: Thu Dec 26, 2024 2:23 am
by FourthWorld
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?
Re: Cannot keep groups intact
Posted: Thu Dec 26, 2024 6:10 am
by dunbarx
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
Re: Cannot keep groups intact
Posted: Thu Dec 26, 2024 6:04 pm
by FourthWorld
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?