MiniTreeSwitcher

Discuss and share scripts and script files...
Native2904
Posts: 72
Joined: 23 Apr 2025 18:48
Location: Aachen

Re: MiniTreeSwitcher

Post by Native2904 »

klownboy wrote: 21 Jan 2026 18:20 Hey highend thanks for the update. I noted a syntax error on the line using SC button. "mintree " has to be quoted at least if syntax checking is on.
"Mini tree context menu|:minitree" button "minitree", 2;

This may be of value to other users, since version 0.2, I added a small hidden script label which simply changes from mini to maxi on a right click so something that simple doesn't require using the menu. My right click in the Edit User Button is: #489; load "<xyscripts>\MiniTreeSwitcher.xys", "_CTB_ICON"; and the added hidden label is:

"_CTB_ICON"; if get("#489") {ctbstate("1",); ctbicon(":minitree",); } else {ctbstate("0",);ctbicon(":maxitree", ); }
Hello, maybe you would like to help me -
I tried to use your button but I don't really understand how it is built.
I get the following error message:



How do I enter this? I looked in the help, but unfortunately without success..



Thank you in advance.
Last edited by Native2904 on 23 Jan 2026 14:00, edited 1 time in total.
Lts. 64-bit XY-Port. ƒ Cascadia Code @ Windows 11 Pro 24H2 ▣ 1920x1080 ⇵ 115%
Glückauf

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

Re: MiniTreeSwitcher

Post by klownboy »

highend's script is up to v0.5.2 now. Let's wait until he looks at my previous post comment before doing anything with your above comment.

highend
Posts: 14690
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: MiniTreeSwitcher

Post by highend »

v0.5.3 is up, it should now toggle the custom toolbar button for the script (if one is used) even if the script is triggered by another method
MiniTreeSwitcher_v0.5.3.xys
(6.85 KiB) Downloaded 11 times
To get this to work look at the description in the script:

Code: Select all

    // ID of the custom toolbar button used, e.g.: "26" for "ctb26"
    // Set it to "0", if no ctb is used...
    // Hold CTRL while hovering over your ctb to show the ID of the button
    // Default = 0 => No ctb button used
    $tbID = 0;
In my case (my button in the toolbar is "ctb26") I would set it to:
$tbID = 26;

@Ken
v0.5.2 toggled the tree button but only if
01. It was invoked through a ctb
02. The toggle entry was used (not a mini tree entry at the top)

@Native2904
The new script doesn't use labels anymore
You just use this script line to invoke it, the rest is handled internally / via the menu entries of it:

Code: Select all

load "<xyscripts>\Minitree\MiniTreeSwitcher_v0.5.3.xys";
One of my scripts helped you out? Please donate via Paypal

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

Re: MiniTreeSwitcher

Post by klownboy »

v0.5.2 toggled the tree button but only if
01. It was invoked through a ctb
02. The toggle entry was used (not a mini tree entry at the top)
Well I didn't get a icon change even using the toggle from mini to maxi menu item which kind of surprised me and yes, I was running it from a CTB.

No matter, it's running great now. I'm still going to add back the right click capability to quickly change from mini (the last one used) to maxi. It works doing what I did before (i.e, using a new label as mentioned previously). I'm curious though, is there any way to invoke your function update_tb_btn($viaBtn, $tbID) (using "1" for $viaBtn and my CTB ID 23 for $tbID) on the right click entry in the Edit User Button dialog instead to do the same thing...not a big deal. I'm not aware that I can call out a function from there. I've already changed it by adding the label.

highend
Posts: 14690
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: MiniTreeSwitcher

Post by highend »

Doable by using a perm variable...

E.g. for the ctb right click:

Code: Select all

perm $P_Tree_Toggle = 1; load "path to\MiniTreeSwitcher.xys";
And in the script before the $menu definition:

Code: Select all

    perm $P_Tree_Toggle;
    if ($P_Tree_Toggle) {
        $P_Tree_Toggle = 0;
        #489;
        update_tb_btn(1, $tbID);
        end true;
    }
But here is v0.5.4 where I have implemented this feature natively.
You only need the same script line for the right click ctb that you already use for the left click...
MiniTreeSwitcher_v0.5.4.xys
(7.02 KiB) Downloaded 8 times
One of my scripts helped you out? Please donate via Paypal

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

Re: MiniTreeSwitcher

Post by klownboy »

Thanks highend for incorporating the right click. It works fine and saves the user from having do a left click of the CTB and then hit the toggle menu item. I'm going to have to start using mini trees more often now. :)

@ Native290, if you been reading the posts since your last one, you know already that you can now put the same entry for right click that you have for left click
load "<xyscripts>\MiniTreeSwitcher.xys";. The right click will toggle the tree from mini (last one used) to maxi and visa versa.

Native2904
Posts: 72
Joined: 23 Apr 2025 18:48
Location: Aachen

Re: MiniTreeSwitcher

Post by Native2904 »

Thank you for your help.
@Klownboy
But could you give me a hint as to what I did wrong above?
Even if it’s obsolete now.
Lts. 64-bit XY-Port. ƒ Cascadia Code @ Windows 11 Pro 24H2 ▣ 1920x1080 ⇵ 115%
Glückauf

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

Re: MiniTreeSwitcher

Post by klownboy »

This was supposed to be entered in the "On right-click" line in the Edit User Button for the CTB:
#489; load "<xyscripts>\MiniTreeSwitcher.xys", "_CTB_ICON";

and the following was to be added to the script (at the very end):

Code: Select all

"_CTB_ICON";
	if get("#489") {ctbstate("1",); ctbicon(":minitree",); }
	else {ctbstate("0",);ctbicon(":maxitree", ); }
It worked in that it toggled the icon when changing from mini to maxi, but it didn't do a status update to the MiniTreeSwitcher.cgf file, which highend added in the more recent versions of the script. From your post, it doesn't look like you did exactly that.

Native2904
Posts: 72
Joined: 23 Apr 2025 18:48
Location: Aachen

Re: MiniTreeSwitcher

Post by Native2904 »

Thank you for your patience, and apologies if my questions were off-context or disrupted the discussion.
Lts. 64-bit XY-Port. ƒ Cascadia Code @ Windows 11 Pro 24H2 ▣ 1920x1080 ⇵ 115%
Glückauf

highend
Posts: 14690
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: MiniTreeSwitcher

Post by highend »

So, everyone's happy now?
One of my scripts helped you out? Please donate via Paypal

Native2904
Posts: 72
Joined: 23 Apr 2025 18:48
Location: Aachen

Re: MiniTreeSwitcher

Post by Native2904 »

@Highend
Of course :beer:
Lts. 64-bit XY-Port. ƒ Cascadia Code @ Windows 11 Pro 24H2 ▣ 1920x1080 ⇵ 115%
Glückauf

highend
Posts: 14690
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: MiniTreeSwitcher

Post by highend »

Thanks for the donation btw (I guess it's yours) :tup:
One of my scripts helped you out? Please donate via Paypal

Native2904
Posts: 72
Joined: 23 Apr 2025 18:48
Location: Aachen

Re: MiniTreeSwitcher

Post by Native2904 »

Ja
Lts. 64-bit XY-Port. ƒ Cascadia Code @ Windows 11 Pro 24H2 ▣ 1920x1080 ⇵ 115%
Glückauf

highend
Posts: 14690
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: MiniTreeSwitcher

Post by highend »

Rewritten the first post and linked the current versions.
If you already have v0.5.4 you don't need to update to v0.5.5, it only got a bit more descriptions added but no functional changes / additions
One of my scripts helped you out? Please donate via Paypal

Post Reply