How to "re-resize" Stack (elements)
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 7266
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: How to "re-resize" Stack (elements)
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
HyperActive Software | http://www.hyperactivesw.com
Re: How to "re-resize" Stack (elements)
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 .
-
- VIP Livecode Opensource Backer
- Posts: 9867
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: How to "re-resize" Stack (elements)
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.
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: How to "re-resize" Stack (elements)
Okay cool. I have attached my very simple (and horrible) UI .
- Attachments
-
- ai.livecode.zip
- (3.22 KiB) Downloaded 104 times
-
- VIP Livecode Opensource Backer
- Posts: 9867
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: How to "re-resize" Stack (elements)
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: How to "re-resize" Stack (elements)
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.
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.
Re: How to "re-resize" Stack (elements)
As a rule of thumb it’s good to define a minimum stack size - what would you say that is?
Re: How to "re-resize" Stack (elements)
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).
-
- VIP Livecode Opensource Backer
- Posts: 9867
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: How to "re-resize" Stack (elements)
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?redfield wrote: ↑Sat May 28, 2022 11:13 amYes 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.
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: How to "re-resize" Stack (elements)
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 104 times
Re: How to "re-resize" Stack (elements)
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 115 times
Brian Milby
Script Tracker https://github.com/bwmilby/scriptTracker
Script Tracker https://github.com/bwmilby/scriptTracker
Re: How to "re-resize" Stack (elements)
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 . 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.
-
- VIP Livecode Opensource Backer
- Posts: 9867
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: How to "re-resize" Stack (elements)
Much of life is simple. Communicating often less so.
Where are those attachments?I have attached two screenshots...
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: How to "re-resize" Stack (elements)
Ah sorry I changed my post already, please see above
Re: How to "re-resize" Stack (elements)
Look up “scaleFactor” in the dictionary. That may be what you are after.
Brian Milby
Script Tracker https://github.com/bwmilby/scriptTracker
Script Tracker https://github.com/bwmilby/scriptTracker