Dual Pane Button

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
sl23
Posts: 223
Joined: 03 Feb 2015 23:34

Dual Pane Button

Post 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';
  }

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Dual Pane Button

Post 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...
One of my scripts helped you out? Please donate via Paypal

sl23
Posts: 223
Joined: 03 Feb 2015 23:34

Re: Dual Pane Button

Post 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?

mazot
Posts: 42
Joined: 20 Apr 2020 23:19

Re: Dual Pane Button

Post by mazot »

I had to play with the script a little and came up with this.
splitPane%.xys
(746 Bytes) Downloaded 90 times
hope it does what you want.

sl23
Posts: 223
Joined: 03 Feb 2015 23:34

Re: Dual Pane Button

Post 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.

Post Reply