Page 2 of 3

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

Posted: Tue May 24, 2022 10:41 pm
by jacque
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.

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

Posted: Thu May 26, 2022 8:54 pm
by redfield
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: .

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

Posted: Thu May 26, 2022 10:17 pm
by FourthWorld
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.

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

Posted: Fri May 27, 2022 7:57 pm
by redfield
Okay cool. I have attached my very simple (and horrible) UI :D .

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

Posted: Fri May 27, 2022 9:57 pm
by FourthWorld
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.

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

Posted: Sat May 28, 2022 11:13 am
by redfield
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.

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

Posted: Sat May 28, 2022 12:28 pm
by stam
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)

Posted: Sat May 28, 2022 1:20 pm
by redfield
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).

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

Posted: Sat May 28, 2022 5:42 pm
by FourthWorld
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.

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

Posted: Sun May 29, 2022 12:52 am
by stam
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

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

Posted: Sun May 29, 2022 4:56 am
by bwmilby
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.

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

Posted: Tue May 31, 2022 6:36 pm
by redfield
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.

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

Posted: Tue May 31, 2022 6:42 pm
by FourthWorld
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?

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

Posted: Tue May 31, 2022 6:45 pm
by redfield
Ah sorry I changed my post already, please see above :)

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

Posted: Tue May 31, 2022 7:18 pm
by bwmilby
Look up “scaleFactor” in the dictionary. That may be what you are after.