Dynamically resize members of a group
Roger Guay
irog at mac.com
Sat May 9 17:04:54 EDT 2009
On May 9, 2009, at 2:00 PM, use-revolution-request at lists.runrev.com
wrote:
> Roger-
>
> Saturday, May 9, 2009, 10:11:23 AM, you wrote:
>
>> Can anyone suggest a way to dynamically resizing objects of a group
>> as
>> the group is resized? Specifically, I have a pair of lines who's
>> lengths I would like to adjust by resizing the group they belong to.
>> Thanks for your help.
>
> In rev 3.5 the resizeControl message is now sent to the group first. I
> handle it there and then resize the grouped controls individually.
>
> --
> -Mark Wieder
Thank you, Mark. Here is a script that answers my own question:
local foo1Pts,foo2Pts,y1,y2
on selectedObjectChanged
put line 1 of the points of grc foo1 into foo1Pts
put line 1 of the points of grc foo2 into foo2Pts
put item 2 of line 2 of the points of grc foo1 into y1
put item 2 of line 2 of the points of grc foo2 into y2
pass selectedObjectChanged
end selectedObjectChanged
on moveControl
put line 1 of the points of grc foo1 into foo1Pts
put line 1 of the points of grc foo2 into foo2Pts
put item 2 of line 2 of the points of grc foo1 into y1
put item 2 of line 2 of the points of grc foo2 into y2
pass moveControl
end moveControl
on resizeControl
put the mouseH into newX
set the points of grc foo1 to foo1Pts,newx,y1
set the points of grc foo2 to foo2Pts,newx,y2
end resizeControl
Thanks and cheers,
Roger
More information about the use-livecode
mailing list