SetLayout() giving static values

Things you’d like to miss in the future...
PeterH
Posts: 2579
Joined: 21 Nov 2005 20:39
Location: Germany

SetLayout() giving static values

Post by PeterH » 04 Feb 2019 12:56

In the last time there were some changes regarding XY's reaction on screen changes. But my problem still exists:

I use SetLayout() to get info, especially for Pane1Width and Pane2Width. Basically it works well.
But: if I change the width of XY's screen, be it by draging the right edge to the left or right, or by moving XY to another -bigger- screen to fullscreen mode, so that the width of pane2 changes, the value of especially Pane2Width doesn't change at all!

I think/hope this can be called a :bug:

Oh - just found some more info: if I drag the splitter right or left, the values of Pane1/2Width do change.
And: if I first change the width of XY, and then once drag the splitter, both pane widths change to the corrected sizes :shock:
W7(x64) SP1 German
( +WXP SP3 )

admin
Site Admin
Posts: 47703
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: SetLayout() giving static values

Post by admin » 05 Feb 2019 16:08

Well, these are internally used values that get updated when needed. I'm not sure why I exposed them. I think I should remove them from this command.

PeterH
Posts: 2579
Joined: 21 Nov 2005 20:39
Location: Germany

Re: SetLayout() giving static values

Post by PeterH » 05 Feb 2019 21:12

Hm - I had expected that this command serves to expose the values it returns.

But OK: I need these values to "swap" (i.e.exchange) the sizes - be it horizontal or vertical - between pane1 and pane2. (So in the moment I read and then set them by SetLayout() ). Is there any other chance to do so? (With real/updated values, of course.)
W7(x64) SP1 German
( +WXP SP3 )

admin
Site Admin
Posts: 47703
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: SetLayout() giving static values

Post by admin » 06 Feb 2019 21:03

Not at the moment, sorry. When I find the time I will remove these values from SetLayout. They don't belong there.

Well, that said, I tried something anyway. No mention in change log. Next beta... (v19.60.0008)

PeterH
Posts: 2579
Joined: 21 Nov 2005 20:39
Location: Germany

Re: SetLayout() giving static values

Post by PeterH » 07 Feb 2019 00:01

Hey - at least for the situations I need & have tested it works now! :tup: :appl:

...but only, if you will not delete it :naughty:
W7(x64) SP1 German
( +WXP SP3 )

admin
Site Admin
Posts: 47703
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: SetLayout() giving static values

Post by admin » 07 Feb 2019 08:29

Hmm, okay. :wink:

PeterH
Posts: 2579
Joined: 21 Nov 2005 20:39
Location: Germany

Re: SetLayout() giving static values

Post by PeterH » 07 Feb 2019 11:13

:biggrin: Thanks a lot! :cup: :om:

By the way: still no idea how to get, (modify and then) set width and/or hight of panes by other means...
W7(x64) SP1 German
( +WXP SP3 )

admin
Site Admin
Posts: 47703
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: SetLayout() giving static values

Post by admin » 07 Feb 2019 11:15

Dragging the splitter? :mrgreen:

PeterH
Posts: 2579
Joined: 21 Nov 2005 20:39
Location: Germany

Re: SetLayout() giving static values

Post by PeterH » 07 Feb 2019 11:40

OK: that would be "manual automation" :lol:

Something like Chaplin's "modern times". (I think that was the name, wasn't it?)
W7(x64) SP1 German
( +WXP SP3 )

admin
Site Admin
Posts: 47703
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: SetLayout() giving static values

Post by admin » 18 Feb 2019 11:46

I saw it coming... had to remove this "fix". These values are not usable for the user. I will remove them from SetLayout().

SammaySarkar
Posts: 4205
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: SetLayout() giving static values

Post by SammaySarkar » 18 Feb 2019 11:51

WWait wait wait!
remove them from the returned layout string, okay, but please let them be definable with setlayout('Pane#Height/Width');
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

admin
Site Admin
Posts: 47703
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: SetLayout() giving static values

Post by admin » 18 Feb 2019 12:08

I should have said: I should remove them from SetLayout(). :)

I won't do anything now. It's an expert function anyway, so this might as well be solvable in the docs...

PeterH
Posts: 2579
Joined: 21 Nov 2005 20:39
Location: Germany

Re: SetLayout() giving static values

Post by PeterH » 18 Feb 2019 12:10

Will that mean there will be no way to get (and maybe also to set) these values? :(
While it wouldn't help much to set them, if I can't get them.

It would affect scripts! At least mine...
(I've used the partly wrong values for several years now...)

OK: if there would be any other solution to get and set pane widths and heights :whistle:
W7(x64) SP1 German
( +WXP SP3 )

admin
Site Admin
Posts: 47703
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: SetLayout() giving static values

Post by admin » 18 Feb 2019 12:13

What is that script doing?

SammaySarkar
Posts: 4205
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: SetLayout() giving static values

Post by SammaySarkar » 18 Feb 2019 12:16

ok, if I understood Don's comment right, he's just going to revert the "fix", so setlayout() might return out-of-date values, but you can still set the height/widths with it.

As for getting the values, use controlposition():

Code: Select all

gettoken(controlposition('L 1'), 4, '|'); // pane 1 height
gettoken(controlposition('L 2'), 3, '|'); // pane 2 width
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Post Reply