custom resize group handler
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
custom resize group handler
I need a resize group handler. The code examples for this posted in the thread at http://forums.runrev.com/viewtopic.php? ... ler#p26344 aren't working for me. (The first doesn't operate as expected and the second one throws errors in the code.)
I've attached a visual example of what I'm trying to accomplish. That is, simply to be able to grab a lower-right handle for a group and drag resize the group with fields repositioned horizontally and vertically. I need to be doing this for lots of different groups, so I need to understand how to build an all-purpose and generic solution.
Any help with this is greatly appreciated.
Thanks
Bill
I've attached a visual example of what I'm trying to accomplish. That is, simply to be able to grab a lower-right handle for a group and drag resize the group with fields repositioned horizontally and vertically. I need to be doing this for lots of different groups, so I need to understand how to build an all-purpose and generic solution.
Any help with this is greatly appreciated.
Thanks
Bill
- Attachments
-
- resize group example.livecode.zip
- (1.5 KiB) Downloaded 268 times
Re: custom resize group handler
Hi Bill,
This should get you started. Create a graphic, group the graphic, set the margins of the new group to 1, set the selectGroupedControls of the group to false and set the script of the group to
Now use the pointer tool to resize the group.
Kind regards,
Mark
This should get you started. Create a graphic, group the graphic, set the margins of the new group to 1, set the selectGroupedControls of the group to false and set the script of the group to
Code: Select all
on resizeControl
if the long id of the target is the long id of me then
put the rect of me into myRect
add 1 to item 1 of myRect
add 1 to item 2 of myRect
subtract 1 from item 3 of myRect
subtract 1 from item 4 of myRect
set the rect of grc 1 of me to myRect
end if
end resizeControl
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: custom resize group handler
Thanks Mark but I don't follow. In case my description and the attached stack was not clear, I need a way for the user to resize a group of objects as indicated in the stack I provided. To be clear, the user would grab the resize handle within the grouped object and move it horizontally/vertically and the grouped objects would resize as pictured in the stack I provided.
I don't follow how your suggestion accomplishes this. Thanks for clarification.
I don't follow how your suggestion accomplishes this. Thanks for clarification.
Re: custom resize group handler
Hi,
What you describe is exactly what my script does. The only difference is that this works when you resize your object with the pointer tool. If you want, you can use four tiny buttons that the user can drag with the browse tool and set the rect of your group accordingly the locations of the tiny buttons. My script should run automatically whenever you set the rect of your group. If it doesn't, just send the resizeControl message to it whenever you deem appropriate.
Kind regards,
Mark
What you describe is exactly what my script does. The only difference is that this works when you resize your object with the pointer tool. If you want, you can use four tiny buttons that the user can drag with the browse tool and set the rect of your group accordingly the locations of the tiny buttons. My script should run automatically whenever you set the rect of your group. If it doesn't, just send the resizeControl message to it whenever you deem appropriate.
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: custom resize group handler
Thanks Mark. I'm still new to this and need help with concepts. If you could in any way actually make the required edits to the stack I attached that would help get me going. You refer to "pointer tool" and "browse tool". By "browse tool" do you mean the user's mouse?
Mark wrote:Hi,
What you describe is exactly what my script does. The only difference is that this works when you resize your object with the pointer tool. If you want, you can use four tiny buttons that the user can drag with the browse tool and set the rect of your group accordingly the locations of the tiny buttons. My script should run automatically whenever you set the rect of your group. If it doesn't, just send the resizeControl message to it whenever you deem appropriate.
Kind regards,
Mark
-
- VIP Livecode Opensource Backer
- Posts: 4003
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: custom resize group handler
Hi Bill,
here is your stack with the resizing.
it is commented in the code of the graphic handler.
since you mentioned a stack that I posted
Kind regards
Bernd
here is your stack with the resizing.
it is commented in the code of the graphic handler.
since you mentioned a stack that I posted
I would be interested in what errors it did throw and when. I tested the stack and did not find errors. Please mention Operating System and Livecode / Runrev Version.and the second one throws errors in the code.)
Kind regards
Bernd
Re: custom resize group handler
Hi,
My time is too valuable to take stacks from this forum and edit them, but clearly Bernd doesn't mind doing so. I guess you don't need my advise now.
Best,
Mark
My time is too valuable to take stacks from this forum and edit them, but clearly Bernd doesn't mind doing so. I guess you don't need my advise now.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: custom resize group handler
Thanks much Bernd. That works wonderfully. Exactly as expected. Much appreciated.
The errors I had experienced referenced in earlier posts was when I was on LiveCode 4.6.x on Mac OS 10.6.8. I've recently updated to LC 5.5. I haven't retested the other code in this version.
Thanks again for the handholding on this one. I'll look forward to digging through the code to gain understanding on this.
Best,
Bill
The errors I had experienced referenced in earlier posts was when I was on LiveCode 4.6.x on Mac OS 10.6.8. I've recently updated to LC 5.5. I haven't retested the other code in this version.
Thanks again for the handholding on this one. I'll look forward to digging through the code to gain understanding on this.
Best,
Bill
bn wrote:Hi Bill,
here is your stack with the resizing.
it is commented in the code of the graphic handler.
since you mentioned a stack that I postedI would be interested in what errors it did throw and when. I tested the stack and did not find errors. Please mention Operating System and Livecode / Runrev Version.and the second one throws errors in the code.)
Kind regards
Bernd
Re: custom resize group handler
Bernd:
I just tested your "Resize with handle" stack from the other thread and got the attached error on LC 5.5 Mac 10.6.8 when in browse mode and selecting the bottom gray circle and attempting to drag it. That's what I had done before. Maybe that's not what a user is supposed to do but that's the first thing I thought to try.
Thanks again for the great working code you posted in the ResizeGroup stack.
Regards,
Bill
I just tested your "Resize with handle" stack from the other thread and got the attached error on LC 5.5 Mac 10.6.8 when in browse mode and selecting the bottom gray circle and attempting to drag it. That's what I had done before. Maybe that's not what a user is supposed to do but that's the first thing I thought to try.
Thanks again for the great working code you posted in the ResizeGroup stack.
Regards,
Bill
-
- VIP Livecode Opensource Backer
- Posts: 4003
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: custom resize group handler
Hi Bill,
thanks for pointing the error out.
It turns out that I used the long id for the current object, which includes the whole path to the stack. This throws an error the if you click on the handle of the object the first time you open the stack and the stack path has changed.
As soon as you Alt-click on an object it aquires the correct path to the control. Since I tested on the same stack with a constant path I did not notice this.
Kind regards
Bernd
thanks for pointing the error out.
It turns out that I used the long id for the current object, which includes the whole path to the stack. This throws an error the if you click on the handle of the object the first time you open the stack and the stack path has changed.
As soon as you Alt-click on an object it aquires the correct path to the control. Since I tested on the same stack with a constant path I did not notice this.
Kind regards
Bernd
Re: custom resize group handler
Hello,
I do not speak English very well so sorry for saying bad words.
Thank you for your excellent stack but I have a problem with the quicktime players.
I can not seem to me to "take off" the controller reziser!?!
Do you have a solution? thank you in advance
I do not speak English very well so sorry for saying bad words.
Thank you for your excellent stack but I have a problem with the quicktime players.
I can not seem to me to "take off" the controller reziser!?!
Do you have a solution? thank you in advance
-
- VIP Livecode Opensource Backer
- Posts: 4003
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: custom resize group handler
Hi lolokiki,
welcome to the forum.
what do you mean by "quicktime players"? Do you want to hide the controls of a player object?
Please try to explain a little more what you want to do and what the problem is.
Kind regards
Bernd
welcome to the forum.
what do you mean by "quicktime players"? Do you want to hide the controls of a player object?
Please try to explain a little more what you want to do and what the problem is.
Kind regards
Bernd
Re: custom resize group handler
I think the custom resize handles are not being removed from the player control when not needed..
Re: custom resize group handler
I have an application where the user has images, text fields, sounds and videos (by quicktime players). I was looking for a way to change the size of all these and I found your app on the forum. It responds almost entirely to my desires but if the user tries to resize the quicktime player the user is stuck on resizing script.
I hope I was a little clearer? :-s
I hope I was a little clearer? :-s
-
- VIP Livecode Opensource Backer
- Posts: 4003
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: custom resize group handler
Hi lolokiki,
do you mean the stack I posted in this thread called "ResizeGoup_0.0.4"? or the stack mentioned also in this thread which is posted in thread
http://forums.runrev.com/viewtopic.php? ... ler#p54555
called "Resize with handle_0.0.2"?
Kind regards
Bernd
do you mean the stack I posted in this thread called "ResizeGoup_0.0.4"? or the stack mentioned also in this thread which is posted in thread
http://forums.runrev.com/viewtopic.php? ... ler#p54555
called "Resize with handle_0.0.2"?
Kind regards
Bernd