Page 1 of 1

move pane divider

Posted: 26 Oct 2018 15:02
by silentDriver
Hello,

is there a way to move the pane divider through a script? or to trigger a script when changing panes?

What i want to achieve is to give about 80% screen state to the active pane, so I can still see the filenames of the inactive pane, and if I change to the other pane (click or shortcut), move the divider to get that 80% to the now active pane.

greetings and thanks!

Re: move pane divider

Posted: 26 Oct 2018 15:44
by klownboy
Hi silentDriver, you can easily do that through the use of layouts. You could save a layout with pane 1 being 80% and save another layout with pane 2 being 80%. A layout is nothing more than a text file and it will include/save the width of the pane. Look under the top menu Window. There you'll see "Save layout..." and "Load layout...". There are also scripting commands setlayout and loadlayout. So once you've saved layouts they can be easily called via a small script to toggle between your desired layouts via a keyboard shortcut or Customized Toolbar Button. We can help you further later if you need it.

I was in a rush earlier, but if all your other layout attributes are the same, all you really need to do is use the SC setlayout command to adjust your pane 1 and or pane 2 widths. Enter the following code in the addressbar.

Code: Select all

setlayout(Pane1Width=520);
First I would save a layout as I mentioned above. Save the layout to a new "layout" folder if it's not already there under your XY data folder. Open the text file for that newly saved layout and it will reveal all the changeable layout attributes like Pane2Width=220. Also, take a look at the help file for setlayout and loadlayout. You may be also interested in an excellent script for changing nearly every aspect in XYplorer, SessionManager viewtopic.php?f=7&t=8691

Re: move pane divider

Posted: 26 Oct 2018 21:05
by silentDriver
thank you, I didn't realize layouts saved this information. Is there a way to trigger the loadlayout() on changing panes? or it must be triggered manually through a shortcut or button?

Re: move pane divider

Posted: 26 Oct 2018 22:02
by klownboy
silentDriver wrote: 26 Oct 2018 21:05 Is there a way to trigger the loadlayout() on changing panes? or it must be triggered manually through a shortcut or button?
I don't believe you can trigger a layout change automatically when changing panes. You'd need a script to change panes and change layout. As I mentioned if you are only changing the sizes of the panes you only need to invoke setlayout. Are you normally in dual pane? If not, you can check for that in a script and change to dual pane. If you are, you need only to focus pane 2 and then load a layout or use setlayout. You could have a User Defined Command or Customized Keyboard shortcut or CTB to cycle between them. Change the width numbers to suit. For example:

Code: Select all

	if(get("pane")=="1") {             //checks if pane 1 has focus
		focus p2; setlayout(Pane1Width=220,Pane2Width=1220);}   // give pane 2 focus and size
	else {
		focus p1; setlayout(Pane1Width=1220,Pane2Width=220);}  // give pane 1 focus and size

Re: move pane divider

Posted: 30 Oct 2018 11:55
by silentDriver
thank you very much! :tup: :tup: