Strange effect with geometry scaling

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

Post Reply
mvillion
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 107
Joined: Sun Feb 24, 2013 12:29 pm

Strange effect with geometry scaling

Post by mvillion » Fri Jun 23, 2017 6:48 pm

Hi

I have an app that its minimum size is 1024 x 768 and you can grab the corner and scale it bigger.
I have two cards in that app
I have a datagrid in both.
I have set up the properties of those datagrid to resize according to the window size using geometry.
When I grab the corner and manually resize, both works perfectly. The window resizes and the datagrid scales accordingly.
BUT
If I maximise the window and enter the cards, one data grid correctly rescales to the full window size and one does not.
The one that does not will rescale as soon as I unmaximise the windows and drag the corner.

I have check the geometry and both are identical in the scale to RIGHT and BOTTOM are selected and nothing else.

I do not know what the difference is or how to ask Livecode to check geometry.

Any ideas?

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Strange effect with geometry scaling

Post by MaxV » Tue Jun 27, 2017 12:16 pm

When you switch card the resize message is not sent to the card, so it's remain to the old size value.
so you need to use this trick:

Code: Select all

on OpenCard
   put the width of me into tx
   set the width of this stack to (tx + 1)
end OpenCard
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Strange effect with geometry scaling

Post by [-hh] » Tue Jun 27, 2017 1:05 pm

Yet another option is to use revUpdateGeometry.
shiftLock happens

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Strange effect with geometry scaling

Post by jacque » Tue Jun 27, 2017 5:32 pm

Just send the resizestack message yourself:

Code: Select all

on preopencard 
  resizestack 
end preopencard
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Strange effect with geometry scaling

Post by MaxV » Wed Jun 28, 2017 9:27 am

jacque wrote:Just send the resizestack message yourself:

Code: Select all

on preopencard 
  resizestack 
end preopencard
This get the error no message found.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Strange effect with geometry scaling

Post by jacque » Wed Jun 28, 2017 8:36 pm

MaxV wrote:
jacque wrote:Just send the resizestack message yourself:

Code: Select all

on preopencard 
  resizestack 
end preopencard
This get the error no message found.
It would depend on where the resizeStack handler is located, and if there is one. If the developer hasn't created a resizeStack handler then it won't be found. Also, I should have added the parameters to the call:

Code: Select all

on preopencard 
  resizestack the width of this stack,the height of this stack
end preopencard
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

MaxV
Posts: 1579
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Strange effect with geometry scaling

Post by MaxV » Thu Jun 29, 2017 3:13 pm

Jacque,
your code create errors.
You can't use that way. At least not in Livecode 9.
You can't call resizeStack message. You can use only this way:

Code: Select all

on ReasizeStack
   ...
   pass resizeStack
end ResizeStack
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7228
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Strange effect with geometry scaling

Post by jacque » Thu Jun 29, 2017 8:14 pm

I've called resizeStack in several apps without errors, but the stack does have to have a resizeStack handler in the message hierarchy where the engine can find it. However, I see now that that OP isn't using a resizeStack handler at all, he's using the geometry settings.

In that case, he should call "revUpdateGeometry" instead and it should work.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

mvillion
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 107
Joined: Sun Feb 24, 2013 12:29 pm

Re: Strange effect with geometry scaling

Post by mvillion » Sat Jul 01, 2017 3:28 pm

Ok. Thanks peeps for the guidance.

I have found the perfect solution combining the best of all entries


on preopencard
put the width of me into tx
set the width of this stack to (tx + 1)
end preopencard

Simples

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”