Sticky Tree

Discuss and share scripts and script files...
bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Sticky Tree

Post by bdeshi »

Sticky Tree: A plugin for XYplorer
Makes the tree panel follow the active pane -- an alternative to dual trees.
Image
Image
(better screencaps coming)

INSTALL

This is a combination of an external script written in AutoIt3, and a launcher script written in XYscript.
  • download the attached stickytree.zip. the archive contains:
    * stickytree.exe: the stickytree executable.        

    * stickytree.au3: The source autoit3 script.        

    * stickytree.xys: the xyscript loader.              

    * stickytree.ico: an icon that can be used in a ctb.

    * stickytree.onyx.ico: an alternative icon.         

    * stickytree.readme.txt: a readme text file.        

    * LICENSE: License of the project (MIT License).    
  • extract the archive contents to <xyscripts>\stickytree\. (See Notes below if you want to use a different location.)
  • make sure Dual Pane view is enabled.
  • that's it, all set! now you can just execute the XYScript to start sticky tree.
  • rerun the xyscript or disable Dual Pane view to stop.

INSTALL CTB
  • the XYScript is fully perpared to be used as a ctb. Just set the following command as both left- and right-click scripts of a ctb:
    ::load "<xyscripts>\stickytree\stickytree.xys",,'f'; // adjust path if necessary.
  • and done! the script will take care of ctb icon and caption as well.
  • left-click will toggle sticky tree. Right-click will show a config menu.

NOTES
  • The preferred independent method of stopping is to run this command in XY:
    ::copydata $P_STICKYTREE_HWND, "QUIT", 0;
    The script also quits when XY quits, and, depending on config, when DP is disabled.
  • the permavar $P_STICKYTREE_EXEC can define the command for running the executable script.
    this allows for running the source au3 script with the autoit interpreter. AutoIt3 version must be >= v3.3.15.1.
    ::perm $P_STICKYTREE_EXEC = 'path\to\autoit\beta\autoit.exe path\to\stickytree.au3';
  • the perm variable $P_STICKYTREE_PATH can control the path to the exe and the ini config.
    (In fact, if the files are in a non-default location, this permavar should be defined for the ctb config to find the correct ini file.)
  • both permavars can contain single-quoted variable path for portable path-keeping. Eg,
    ::perm $P_STICKYTREE_PATH = '<xyscripts>\_ext\stickytree';
    ::perm $P_STICKYTREE_EXEC = '<xypath>\..\au3beta\autoit3.exe $P_STICKYTREE_PATH\stickytree.au3';
  • if the script doesn't start, run this to unset two session permavars and retry:
    ::unset $P_STICKYTREE_TOGGLE, $P_STICKYTREE_HWND;
    This can happen for example, when XY was closed with the script running.
-------------------------------------------------------------------------
DOWNLOADS
Latest release:
stickytree-v1.1.1.0.zip
* bug fix: nav panels were not following horiz. pane split
(455.65 KiB) Downloaded 150 times
-------------------------------------------------------------------------
Older releases:
stickytree-v1.1.0.0.zip
* infotip conflict gone.
* configs.
(455.45 KiB) Downloaded 124 times
stickytree-v0.9.9.9.zip
* the xyscript runs gracefully outside of ctb.
* proactive bugfix in the au3 re 0-length data.
(444.85 KiB) Downloaded 169 times
-------------------------------------------------------------------------
Thanks for using this thing, and don't hesitate to report bugs or feature suggestions! :)

Credits
The stickytree.ico file is generated from the bamboo.png icon of FatCow's "farm-fresh" iconset, licensed under a Creative Commons Attribution 3.0 license.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

klownboy
Posts: 4052
Joined: 28 Feb 2012 19:27

Re: Sticky Tree

Post by klownboy »

Hey Sammay, the new version of your stickytree script is working great. I made a couple of minor adjustments to suit my own case where I don't usually have a dual pane unless I'm ready to transfer files or perform similar operations. So I added a simple if !get("#800") {#800;} at the start of the script and in the final else statements, I added a loadlayout("normal"); to get me back to my typical configuration when it's exits stickytree and returns the icon to the relaxed state. Of course users could do whatever they want including loading a sessionmanager session.

I see here viewtopic.php?f=3&t=20121 where you are trying to get a resolution on the tooltip issue.

By the way, if invoking by a User Defined Command, have you found it best to simply use userbutton '38',1; in a Run Script command? It seems to work fine that way or using a combination of a UDC and a CTB.

Thanks Sammay once again! :tup:
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Sticky Tree

Post by bdeshi »

klownboy wrote: 25 Feb 2019 18:05 By the way, if invoking by a User Defined Command, have you found it best to simply use userbutton '38',1; in a Run Script command?
Yes, this works perfectly fine.
klownboy wrote: 25 Feb 2019 18:05 I made a couple of minor adjustments to suit my own case [...] Of course users could do whatever they want including loading a sessionmanager session.
Exactly. The xyscript is only provided as a basic starting point showing how to call the autoit3 code. You don't even need to use the given stickytree.xys at all.
The operation from XYplorer's side in its entirety is the following:
* To start sticky tree: set perm $P_STICKYTREE_TOGGLE=1 and run stickytree.exe <hwnd>
* To stop sticky tree: set perm $P_STICKYTREE_TOGGLE=0 or unset it.
That's it. The au3 code continuously polls this variable and will shut down whenever it's != 1, or when dualpanes is turned off.
Keeping these two core steps intact, you can freely integrate stickytree with any xyscript-managed workflow.

Thanks for trying this out!
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

klownboy
Posts: 4052
Joined: 28 Feb 2012 19:27

Re: Sticky Tree

Post by klownboy »

SammaySarkar wrote: 25 Feb 2019 22:31 The au3 code continuously polls this variable and will shut down whenever it's != 1, or when dualpanes is turned off.
I noticed that (i.e., dual panes turning stickytree off). However, when you exit that way, the stickytree CTB icon is left in the depressed state. Not a big deal - you can't really control every situation. A user could make their own dual pane modified CTB which controlled the state of that icon as well. I'd probably always exit stickytree via the assigned CTB or UDC. Thanks again for the cool script.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

xyuser2020
Posts: 5
Joined: 11 Mar 2019 05:53

Re: Sticky Tree

Post by xyuser2020 »

Hi SammaySarkar,

Thank you for creating this script. I was looking for such a solution since some time and came across your script only recently.

This is the first script I have ever installed/used within xyplorer and am very happy with it. I would like to provide a feedback regarding an error at my end: After loading the script, I get an error "Invalid button indes: -1" on line 10 (if !(ctbicon(, $ctb)) {). What can I do to avoid this error.

Thanks again.

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Sticky Tree

Post by bdeshi »

Thanks for trying this out!

Please try the latest v0.9.9.9 in the first post. That warning should go away.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

xyuser2020
Posts: 5
Joined: 11 Mar 2019 05:53

Re: Sticky Tree

Post by xyuser2020 »

Thanks a ton. It works. :-)

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Sticky Tree

Post by bdeshi »

This "nightly" version can let infotips shine through! But there's a precondition:
Configuration > Information > File Info Tips > Initial delay in milliseconds has to be something around or less than 300 ms.
The script's main loop frequency now is 0.5s (2Hz). Infotip "displayability" is not exactly 100% though.
No luck with hoverboxes yet.
Attachments
stickytree-v0.9.10.0.zip
* possibility of unobstructed infotips.
* main loop runs only when XY window is active.
(450.69 KiB) Downloaded 135 times
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

klownboy
Posts: 4052
Joined: 28 Feb 2012 19:27

Re: Sticky Tree

Post by klownboy »

Hi Sammay, I hate to give anything but positive comments especially on scripts because I know how much time and effort goes into them, but I've noticed that the latest version v0.9.10.0 is noticeably less responsive than version 0.9.9.9. when switching from pane to pane. Is v0.9.10.0 still a work in progress? I ask because you referred to it as a "nightly" build.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Sticky Tree

Post by bdeshi »

yep, exactly. It should feel slower because the main loop now runs once every 500ms, earlier it was just 10 ms. Additionally on pane change each tooltips under XYplorer are checked for visibility, this might contribute to lag. Admittedly I only tested on my own machine, so the speed cost for this step could very well vary wildly among different systems.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

klownboy
Posts: 4052
Joined: 28 Feb 2012 19:27

Re: Sticky Tree

Post by klownboy »

OK thanks Sammay. I assume you had to increase the main loop frequency (from 10 ms to 500 ms) to accommodate InfoTip display or at least they are tied in? I may have to sacrifice InfoTips for speed while in StickyTree. Though I like the fact that your v0.9.10.0 is only looping when XY is active.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Sticky Tree

Post by bdeshi »

Actually the loop frequency was always directly dependent on Configuration > Information > File Info Tips > Initial delay in milliseconds. for showing infotips. If that option's value is larger than loop freqeuncy, infotips will never show no matter how long it takes.

Right now I'm making a basic GUI to accomodate a few configurable settings. I'll try to add a couple options to control the tradeoff between infotip awareness and responsiveness. The "official" and "nightly" versions will be merged then.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

klownboy
Posts: 4052
Joined: 28 Feb 2012 19:27

Re: Sticky Tree

Post by klownboy »

SammaySarkar wrote: 16 Mar 2019 20:58 Actually the loop frequency was always directly dependent on Configuration > Information > File Info Tips > Initial delay in milliseconds. for showing infotips. If that option's value is larger than loop freqeuncy, infotips will never show no matter how long it takes.
OK, I figured that was the case based on your previous comments.
SammaySarkar wrote: 16 Mar 2019 20:58 making a basic GUI to accomodate a few configurable settings
Configurable is always nice option. :tup: :)
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Sticky Tree

Post by bdeshi »

v1.x published finally. download in first post.

This version has extensive modifications throughout the codebase. I'd recommend a "clean install", ie, remove all earlier stickytree files and associated scripts.

* The tooltip battle is finally over, means the script doesn't block infotips or hoverboxes any more.
  Many thanks to klownboy for testing the new mechanism!
* A handful of configurable options are added, along with a user-friendly config menu in the ctb script.
  The script can now:
    * auto-toggle dualpane if needed.
    * restore last layout after stopping.
    * start passively, then autoactivate when dualpane is enabled, and drop to background when its disabled.

See the first post for details.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Sticky Tree

Post by bdeshi »

v1.1.1.0: a bug fix: nav panels were not following horizontal pane split resizes. (AutoIt has a weird way of comparing strings.)
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Post Reply