Page 1 of 1

Dual Pane Button

Posted: 31 May 2021 18:42
by sl23
I use single pane mostly, but there are often times when dual pane is required.

Here's what I would like to do:
Have a button that loads a script to enlarge the size of XY's window (user adjustable) and show the dual panes with a ratio of say 70/30 (again, user adjustable).

I downloaded a DualPane50/50 script which sort of works if the DP is active. But I have no clue as to where to start editing it to allow it to open the second pane and change the window size (if possible).

Can it even be done?

Here's the script for DualPane50/50 found on the forum (thanks to whoever the author is, I couldn't find it again):

Code: Select all

// Adjust panes so they are equal size
"Adjust Pane Size"
  if (Get('#800')) {
    $current = SetLayout();
    $dim = Get('#801', 'Height', 'Width');
    $size = RegexMatches($current, 'Pane[12]' . $dim . '=\d+', '+');
    $size = RegexReplace($size, 'Pane[12]' . $dim . '=');
    $size = Eval($size) + GetKey('SplitterWidth', 'General');
    $half = Floor($size / 2);
    SetLayout("Pane1$dim=$half,Pane2$dim=$half");
    Status "Panes resized to a $dim of $half px.",, 'ready';
  } else {
    Status 'Panes are not resized in single pane mode.',,'alert';
  }

Re: Dual Pane Button

Posted: 31 May 2021 19:03
by highend

Code: Select all

    if (!get("#800")) { #800; }

    // Doh! Now the dual pane is visible no matter what
    // Time to start searching the forum for the right thread that lists undocumented script commands and it will reveal the one that is necessary to resize the XY window...
And the rest is simple math...

Re: Dual Pane Button

Posted: 31 May 2021 21:14
by sl23
Actually, I had the idea around 13 years ago with CubicExplorer, but it didn't have dual pane. Marko started working on it but due to personal issues, which I helped advise with, he gave up development.

So, no, I didn't search the forum for answers to that. I found the script for DP50 which reminded me of my FR with CE. I searched the forum for anything useful. Why are you being so rude?

Re: Dual Pane Button

Posted: 02 Jun 2021 20:18
by mazot
I had to play with the script a little and came up with this.
splitPane%.xys
hope it does what you want.

Re: Dual Pane Button

Posted: 02 Jun 2021 21:05
by sl23
Thanks mazot, works a treat, very kind :tup:
My aim was to enquire if it was possible to get XY window dimensions and adjust those to suit the dual pane being opened.
So, for example, XY window width= 600 in single pane use, click a button to activate a script that opens the dual pane and widens XY window to a specified percentage, just as you stated. If dual pane is open, then clicking the button again would close it. Perhaps I'm expecting too much though?

No matter, you're script is great help and very much appreciated.