Group resizing.

Alex Tweedly alex at tweedly.net
Sun May 3 14:28:25 EDT 2020


No, I don't, and that's probably what I should be doing.

I had not expected that changing the LEFT of a control would change both 
X *and* Y coordinates of the enclosing group - but that is what seems to 
happen; and that at least makes sense - any change to the control causes 
an adjustment to both dimensions of the enclosing group.

The surprise now is that changing the WIDTH of that control (which I do 
in the previous statement), which also could change both left & right X 
coords of the control, didn't also have that effect. Maybe because in 
this case the width setting didn't actually change the values - so it 
optimized out actually setting them, or adjusting to allow for it.

Anyway - thanks Brian, I can now get back to my "10-minute cleanup task" 
that I started 8 hours ago :-)

Alex.

On 03/05/2020 16:38, Brian Milby via use-livecode wrote:
> Do you have the group size/position locked (lockLocation property)? If not, moving a control could change the rect.
>
> Thanks,
> Brian
> On May 3, 2020, 10:28 AM -0400, Håkan Liljegren via use-livecode <use-livecode at lists.runrev.com>, wrote:
>> You probably need to lock messages in the beginning of your resizeControl. Otherwise the group will adapt to your resizing of your controls. I usually begin with both lock messages and lock screen, but the last is more for optimization.
>>
>> Håkan
>> On 3 May 2020, 16:22 +0200, Alex Tweedly via use-livecode <use-livecode at lists.runrev.com>, wrote:
>>> I realized after the discussion last week about resizing that I was
>>> missing the benefits of "resizeControl" being sent to each group, so I
>>> changed one of my resize handlers to make use of groups (adding a few
>>> groups along the way).
>>>
>>> And it all went wrong :-(
>>>
>>> Eventually I traced it down to the following ... and don't know if I'm
>>> missing something or if I've bumped into a bug.
>>>
>>> The resize handler is
>>>
>>>> on resizeControl
>>>>     set the width of field "list titles" of me to the width of me - 20
>>>>     put "B" && the rect of me && the bottom of me &CR after msg
>>>>     set the left of field "list titles" of me to 10
>>>>     put "C" && the rect of me && the bottom of me &CR after msg
>>>>     local tR
>>>>     put 10, the top of me, the right of me -10, the bottom of me-10 into tR
>>>>     set the rect of fld "List" of me to tR
>>>> end resizeControl
>>> Note the two "put ... msg" statements. - for no reason I can figure out,
>>> the "bottom of me" changes between these two statements. Here's the
>>> output from the message box:
>>>
>>>> B 5,32,331,468 468
>>>> C 6,32,325,2618 2618
>>>> B 5,32,331,471 471
>>>> C 5,32,320,2622 2622
>>>> B 5,32,331,473 473
>>>> C 5,32,320,2626 2626
>>>>
>>> If I comment out that "set the left of ..." statement, all apparently
>>> works as expected.
>>>
>>> Why should setting the 'left' of a control change the bottom of its
>>> enclosing group ?
>>>
>>> And why change it to an apparently silly value ?
>>>
>>> -- Alex.
>>>
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list