How to Zoom in/out group content

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

palanolho
Posts: 122
Joined: Sat Apr 27, 2013 11:40 pm

Re: How to Zoom in/out group content

Post by palanolho » Wed Jul 03, 2013 9:31 pm

Greetings Bernd,

Sorry for the delay, but have had some later work on my job and some other stuffs got in the way and so, I was not able to reply faster. My apologies.

I have been looking to it and it looks like what I needed.

I'll try to add the modifications to my script and see how it works (and if I can make it work lol ) and I'll let you know

Many thanks for your time

Kind regards,
- Miguel

jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

Re: How to Zoom in/out group content

Post by jalz » Thu May 15, 2014 3:12 pm

Hi Bernd

Just wanted to thank you for posting/sharing this stack, its something I was contemplating adding to my print preview screen. I'll try and dissect it and see if I can understand it.

All the best
Jalz

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: How to Zoom in/out group content

Post by bn » Thu May 15, 2014 5:45 pm

Hi jalz,

feel free to ask if you get stuck. This is tricky stuff. As Miguel and I found out.

You might also have a look at this thread

http://forums.runrev.com/phpBB2/viewtop ... =8&t=19493

which is basically the same topic.

Kind regards
Bernd

jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

Re: How to Zoom in/out group content

Post by jalz » Mon Jul 21, 2014 10:49 am

Hi Bernd,

I have a quick question on this if you dont mind?
How did you work out the MesDim values from. If I select 100% and select the red box, the custom property MesDim is 893,174,1178,448 - however if I select the size and position pane I get the values 852, 196 1137, 470. Is there a trick I am missing?

The uLocationAt100Percent property has the same figures as in the sizebox.


Thanks
Jalz

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: How to Zoom in/out group content

Post by bn » Mon Jul 21, 2014 11:09 am

Hi Jalz,

MesDim and uLocationAt100Percent are customproperties of every object in the group you want to zoom. They are set when you configure your zoom-group and the objects are at 100 percent size and at 100 percent location. This is what the button "setLoc of objects" at the lower left is for: you place all objects at 100 percent size to the location you want them at 100 percent size and press the button. You do that only once. Unless you want to change the location or size of objects you should not click the button again sine it would record wrong dimensions and locations if the zoom is not at 100 percent.

I hope this is what you are seeing.

Kind regards
Bernd

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: How to Zoom in/out group content

Post by bn » Mon Jul 21, 2014 5:03 pm

Hi Jalz,

sorry for the confusion I created in previous post. I replied without actually looking at the code.

I see the same as what you describe: in main_App4 the rect of objects at 100 percent is not what the customProperty MesDim contains.

To change that you can change the script of button "setloc of objcts" and replace the repeat loop in handler setLocsOfGroupMembersAsCustomProperties with this:

Code: Select all

repeat with i = 1 to nrElems
          put line i of  eList into tControl
          set the uLocationAt100Percent of control tControl to the loc of control tControl
          set the mesDim of control tControl to the rect of control tControl -- added BN
     end repeat 
new line commented -- added BN

apart from not using the correct scaling the functionality of the zooming was not affected, now if you have placed your objects in "group game_content_area" at 100% at zoom level 100% they should scale correctly.

If you have any more problems with this feel free to ask here or to pm me (private mail via forum)

Kind regards
Bernd

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: How to Zoom in/out group content

Post by jmburnod » Tue Jul 22, 2014 12:31 pm

Salut Bernd,

I played with main_app4.
It works fine for me.
I just add some lines for fields in a main_app5 version
Changed can be found with this comment

Code: Select all

for fields added jmb 
Kind regards
Jean-Marc
Attachments
main_app5.livecode.zip
(70.5 KiB) Downloaded 205 times
https://alternatic.ch

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: How to Zoom in/out group content

Post by bn » Tue Jul 22, 2014 2:04 pm

Salut Jean-Marc,

I just did essentially the same for Jalz. He wanted to have text fields. The only difference is when setting the custom property I use the "effective textSize" in case a user drops just a standard field into the group without specifying the textSize. Then "textSize" without "effective" returns empty because the field uses the textSize of an object higher in the hierarchy like card stack or group.

And I don't set the textHeight because it automatically adjusts automatically.

Kind regards

Bernd

Post Reply