Relating the folder pane to the file pane

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
sclg
Posts: 26
Joined: 23 Sep 2009 15:47
Location: UK

Relating the folder pane to the file pane

Post by sclg » 30 Dec 2016 11:24

I'm sure I'm missing something obvious here...
Is it possible to lock the folder tree display on the left to the tab that is open?
Say I have five tabs, when I change to a different tab, it would be good if the file tree went to the state it was in when I was last on that tab.
As it is, it always stays the same in terms of which folders are expanded and which aren't.
Any ideas?

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

Re: Relating the folder pane to the file pane

Post by highend » 31 Dec 2016 11:29

XY doesn't provide that feature, so maybe a script?

Ofc this requires the user to switch tabs through the script^^

This could get you started:

Code: Select all

    $ini     = "<xydata>\trees.ini";
    $tabs    = get("tabs");
    $abbrev  = "1,2,3,4,5,6,7,8,9,0,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z";
    $tabList = "";
    while ($i++ < gettoken($tabs, "count", "|")) {
        $tabList = $tabList . gettoken($abbrev, $i, ",") . " - " . gettoken($tabs, $i, "|") . "|";
    }
    $tabIndex = regexreplace(popupmenu($tabList, , , , , 1), "^([a-z0-9] - )(.*)", "$2");
    $tabPath  = tab("get", "path", $tabIndex);
    if !(exists($ini)) { writefile($ini, , , "tu"); }
    setkey get("tree"), "tree", tab("get", "path"), $ini;
    seltab $tabIndex;
    $iniPaths = getsectionlist(, $ini);
    foreach($iniPath, $iniPaths, <crlf>) {
        if ($iniPath == $tabPath) {
            loadtree getkey("tree", $iniPath, $ini);
            break;
        }
    }

One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

sclg
Posts: 26
Joined: 23 Sep 2009 15:47
Location: UK

Re: Relating the folder pane to the file pane

Post by sclg » 31 Dec 2016 11:37

Thanks for the idea - obviously time to get to grip with scripts!

Post Reply