Page 2 of 2

Re: Using a group's handles to resize controls within group

Posted: Mon Apr 28, 2014 2:33 am
by Randy Hengst
Hello Tom and Bernd,

I've been playing around with this idea by using a 2009 stack of Bernd's from the LiveCode site.

I can't figure out how to add a handle to the bottom left of the group. I've attached my effort. The bottom right handle works, because it's essentially Bernd's… with only chaning the width. The bottom left image does change the size of the group, but it goes the opposite way the mouse moves… any thoughts as to what I've missed would be appreicated. I assume it's something obvious to the trained eye, but I can't see it.

Thanks for any hlep you can provide.

be well,
randy

Re: Using a group's handles to resize controls within group

Posted: Mon Apr 28, 2014 11:08 am
by bn
Hi Randy,

manipulating the left side is a bit tricky since moving left with the mouse decreases the x value but increases the width. Now I refer to the right side of the graphic and do the math.

Additionally I added code to avoid that the user can drag the border of the control off the left or right border of the card.

Funny to see old code. Today I would use a slightly different naming convention for script local variables (prepending them with "s" and would probably terminate the send in time in a mouseUp / mouseRelease handler but the current code works and I did not change that.
And I would refer to the graphic by name (graphic "SumSelectCoverRect" of the owner of me) to avoid confusion in case you add another graphic and change the layer.

Kind regards
Bernd

Re: Using a group's handles to resize controls within group

Posted: Mon Apr 28, 2014 1:55 pm
by Randy Hengst
Well Bernd, that's impressive. Thank you very much for sharing your code and talent.

be well,
randy