How to "re-resize" Stack (elements)

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

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

Re: How to "re-resize" Stack (elements)

Post by jacque » Tue May 24, 2022 10:41 pm

Sorry, I wasn't trying to be argumentative, I just thought a few code examples would be helpful. I assumed you might have some library code you could share. I can't remember ever seeing any examples, but if there's a link here I'd follow it. I'm thinking of a particular stack (not mine) that could benefit. I do agree that each stack may need different methods, I'm just not sure how to start with yours.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

redfield
Posts: 95
Joined: Thu Apr 04, 2019 1:41 pm

Re: How to "re-resize" Stack (elements)

Post by redfield » Thu May 26, 2022 8:54 pm

I have started playing with the GM - one card, one field. Is it a bug or a feature that it is not possible to scale AND position the element? In the GM, in scale mode I create a link (red bar) to the right edge and the bottom edge. When I then switch to position mode and create the same links, the links in scale mode have disappeared :shock: .

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: How to "re-resize" Stack (elements)

Post by FourthWorld » Thu May 26, 2022 10:17 pm

Some like the Geometry Manager, but I've never found the click click click click click click click much of a savings over scripting, while the explicit and complete control scripting offers cannot be beat when control is what you're looking for.

If you can post the UI stack in question I'd be happy to use it as another example like others I've done here before. Or maybe a search for resizestack with my name may pull those earlier exercises and posts up for useful reference.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

redfield
Posts: 95
Joined: Thu Apr 04, 2019 1:41 pm

Re: How to "re-resize" Stack (elements)

Post by redfield » Fri May 27, 2022 7:57 pm

Okay cool. I have attached my very simple (and horrible) UI :D .
Attachments
ai.livecode.zip
(3.22 KiB) Downloaded 95 times

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: How to "re-resize" Stack (elements)

Post by FourthWorld » Fri May 27, 2022 9:57 pm

redfield wrote:
Fri May 27, 2022 7:57 pm
Okay cool. I have attached my very simple (and horrible) UI :D .
Do you want that layout centered, or are there fields or other objects you want resized as well?

Please describe the layout goals and I'll see what I can do.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

redfield
Posts: 95
Joined: Thu Apr 04, 2019 1:41 pm

Re: How to "re-resize" Stack (elements)

Post by redfield » Sat May 28, 2022 11:13 am

Yes my aim is to resize the window and with it all the elements. Also the elements need to be relocated relative to the new window size, so that they don't disappear when shrinking the window.
I have two different screens, one with high resolution and one with lower resolution. The stack is good enough on the high resolution screen, but on the other screen the fields and so on are unnecessarily large. Thus on that screen I want to grab the window corner with the mouse, make the window smaller and with it all the elements relative to the new window size (+ relocation). And all this vice versa of course, when the window is being enlarged again.

stam
Posts: 2634
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: How to "re-resize" Stack (elements)

Post by stam » Sat May 28, 2022 12:28 pm

As a rule of thumb it’s good to define a minimum stack size - what would you say that is?

redfield
Posts: 95
Joined: Thu Apr 04, 2019 1:41 pm

Re: How to "re-resize" Stack (elements)

Post by redfield » Sat May 28, 2022 1:20 pm

In the Stack Inspector I have defined the MIN to 900 (Width) and 470 (Height) and the MAX to 1200 and 770 (which are also the initial values).

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: How to "re-resize" Stack (elements)

Post by FourthWorld » Sat May 28, 2022 5:42 pm

redfield wrote:
Sat May 28, 2022 11:13 am
Yes my aim is to resize the window and with it all the elements. Also the elements need to be relocated relative to the new window size, so that they don't disappear when shrinking the window.
I have two different screens, one with high resolution and one with lower resolution. The stack is good enough on the high resolution screen, but on the other screen the fields and so on are unnecessarily large. Thus on that screen I want to grab the window corner with the mouse, make the window smaller and with it all the elements relative to the new window size (+ relocation). And all this vice versa of course, when the window is being enlarged again.
Thank you for that description. To make sure I understand what you're aiming for, could I trouble you to post two screen shots, one showing the layout you'd like in the smallest size and the other at the largest size?

With that in hand I can show you how to automate the layout for both, and everything in between.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

stam
Posts: 2634
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: How to "re-resize" Stack (elements)

Post by stam » Sun May 29, 2022 12:52 am

redfield wrote:
Fri May 27, 2022 7:57 pm
Okay cool. I have attached my very simple (and horrible) UI :D .
Without knowing what exactly you're after, this is an approximation based purely on the geometry manager, taking about 2 mins max to set up.
Have a look at the various GM rules - the squiggly lines in the GM give relative repositioning/resizing (clicking twice on a rule).
If there is something specific you were trying to achieve that isn't doable just with the GM, it may also require scripting in the resizeStack handler... but don't know what you're aiming to do...

HTH
Stam
Attachments
ai.livecode.zip
(4.75 KiB) Downloaded 97 times

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: How to "re-resize" Stack (elements)

Post by bwmilby » Sun May 29, 2022 4:56 am

redfield wrote:
Thu May 26, 2022 8:54 pm
Is it a bug or a feature that it is not possible to scale AND position the element?
It is a design decision. In one direction (H or V), you can either position or scale. You can have a single object that scales one direction and positions on the other. stam's example does that for the line. One other thing you can do is look at the custom property sets for objects once you set the GM settings. There is a set for the GM properties. The GM does a couple things that I don't like though. If moving objects based on other objects, the side referenced may not be the best. This is only a function of the IDE though, the GM code has the capability to do what I want in this case.
Attachments
GMa.livecode.zip
(2.79 KiB) Downloaded 100 times
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

redfield
Posts: 95
Joined: Thu Apr 04, 2019 1:41 pm

Re: How to "re-resize" Stack (elements)

Post by redfield » Tue May 31, 2022 6:36 pm

So it seems to me that I haven't been able to describe well enough what I want to achieve, although it's so simple :oops: . I was going to attach two screenshots, but it makes no sense, because they look the same (cause that's the aim). After resizing the window everything should look completely the same - just bigger or smaller. The window is smaller (bigger) and all the fields, etc. are too. In width and height. And everything stays centered, means the general layout should stay the same. I don't know how else to put it or what kind of screenshots to provide.
Last edited by redfield on Tue May 31, 2022 6:44 pm, edited 1 time in total.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: How to "re-resize" Stack (elements)

Post by FourthWorld » Tue May 31, 2022 6:42 pm

redfield wrote:
Tue May 31, 2022 6:36 pm
So it seems to me that I haven't been able to describe well enough what I want to achieve, although it's so simple :oops: .
Much of life is simple. Communicating often less so. ;)
I have attached two screenshots...
Where are those attachments?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

redfield
Posts: 95
Joined: Thu Apr 04, 2019 1:41 pm

Re: How to "re-resize" Stack (elements)

Post by redfield » Tue May 31, 2022 6:45 pm

Ah sorry I changed my post already, please see above :)

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: How to "re-resize" Stack (elements)

Post by bwmilby » Tue May 31, 2022 7:18 pm

Look up “scaleFactor” in the dictionary. That may be what you are after.
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”