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
Using a group's handles to resize controls within group
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 154
- Joined: Thu Jun 29, 2006 4:16 pm
Re: Using a group's handles to resize controls within group
- Attachments
-
- ResizeHandles.rev.zip
- (3.83 KiB) Downloaded 182 times
-
- VIP Livecode Opensource Backer
- Posts: 4036
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Using a group's handles to resize controls within group
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
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
- Attachments
-
- DragHandles_0_1BN.livecode.zip
- (4.01 KiB) Downloaded 197 times
-
- VIP Livecode Opensource Backer
- Posts: 154
- Joined: Thu Jun 29, 2006 4:16 pm
Re: Using a group's handles to resize controls within group
Well Bernd, that's impressive. Thank you very much for sharing your code and talent.
be well,
randy
be well,
randy