Panes and CTBs

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
oblivion
Posts: 156
Joined: 13 Apr 2011 11:35

Panes and CTBs

Post by oblivion »

I have been trying to come up with a way to replicate the functionality of the dual pane button but slightly tweaked.

Easy enough to do what I want if I add another button and leave the dual pane button where it is: basically, I want the other pane to be pointed at the folder that's currently open, so I can just make a button that issues

Code: Select all

::#810
and I have what I want.

However, to switch the second pane off again, I need to either use the existing (now toggled) dual pane button, or have a right-click function for my ctb that just issues #800. Which feels inelegant.

I found a thread discussing the possibilities for a toggle function for ctbs that seemed to suggest a solution (in general) that effectively switched between two toolbars -- which is a fairly high maintenance solution :)

So I thought, can't I just look at the environment in some way and find out how many panes are open?

The xypane2 variable seems to be set with the last used path in pane 2 even if it's not currently open. And I can't find anything else helpful.

I can't find anything in the config that will let me change the default behaviour of the existing button.

I feel sure I'm missing something blindingly obvious. Am I?
-- bests, Tim

...This space unintentionally left blank.

klownboy
Posts: 4462
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: Panes and CTBs

Post by klownboy »

Hi oblivion,
I think a small script might be the best work around. You could remove the normal Dual Pane button from the toolbar and assign a new Customized User Button to this script.

Code: Select all

if !get("#800") {  //checks Dual Pane status
 goto "DUAL:1.<curpath>>>2||<curpath>>>2";}   // go to dual pane if not already or you could get the active pane first, $a_path = get("path", a) and use it instead of <curpath>
 else {#800;}   //goes back to single pane if already in Dual Pane
You can use the same button for your new Dual Pane CTB icon which is :dp. If you wanted, you can specify which paths you desire in each pane instead of the active path. The "2" in the script calls out the normal list view. You can change that to what ever view type you want. One pane could be details and the other list etc. See the choices in the help file under the scripting command "get" (e.g., "0" is details view). It's actually not a bad idea since often I may have left pane 2 in some odd ball folder. So I'd rather have it be in a specific one or the same as pane 1.
Ken

oblivion
Posts: 156
Joined: 13 Apr 2011 11:35

Re: Panes and CTBs

Post by oblivion »

Hi, klownboy!
klownboy wrote: I think a small script might be the best work around.
I think it might. Marvellous! Thanks!
-- bests, Tim

...This space unintentionally left blank.

klownboy
Posts: 4462
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440

Re: Panes and CTBs

Post by klownboy »

You're very welcome. I probably could have just went with a script that uses Command #810 to make the script as simple as...

Code: Select all

 if !get("#800") {#810;}  
   else {#800;}
But, with the other way you have control over the views you want like a detail view on a left vertical pane and thumbnail view on the right.

oblivion
Posts: 156
Joined: 13 Apr 2011 11:35

Re: Panes and CTBs

Post by oblivion »

klownboy wrote:You're very welcome. I probably could have just went with a script that uses Command #810 to make the script as simple as...

Code: Select all

 if !get("#800") {#810;}  
   else {#800;}
But, with the other way you have control over the views you want like a detail view on a left vertical pane and thumbnail view on the right.
I'm slightly ashamed to admit that I've gone with the simplified version for daily use, mostly because it doesn't override my folder view settings -- which vary depending on where I am. But I can see some good uses of variants of the original version of the code so I've stuck a copy in my UDC list -- so thanks twice over! :)
-- bests, Tim

...This space unintentionally left blank.

Post Reply