[Bug?] Question about CTB right-click and load command

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
autocart
Posts: 1246
Joined: 26 Sep 2013 15:22

Re: [Bug?] Question about CTB right-click and load command

Post by autocart »

Null problemo, klownboy, I think I don't understand what CTBNoRClickDefaultCommands really should be doing.
I also don't find a really good documentation of that tweak. From the sound of it's name and a quick test it should just affect the display of the default commands in a CTB right click context menu, but not skip the context menu as a whole. Therefore I am literally just not sure what meaning it could have in the context of this thread. But I did not mind you asking. Glad that you try to help.

autocart
Posts: 1246
Joined: 26 Sep 2013 15:22

Re: [Bug?] Question about CTB right-click and load command

Post by autocart »

Ok, my evaluation of v22.30.0204:

With CTBNoRClickDefaultCommands=0 the load command in the first line of a CTB's right-click single-script will now pop the context menu, no matter what, it seems.

With CTBNoRClickDefaultCommands=1 it can be achieved that the right click on a CTB will immediately execute a script without the context menu, but that does not help, because I also want the script to be potentially useable to others as well.

That is exactly what I was afraid of. The bug get's "fixed" and destroys my scripting plans. But I am glad that I asked because if I had just went ahead with the script, then someone else would have reported the bug tomorrow and I would have coded for nothing.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: [Bug?] Question about CTB right-click and load command

Post by admin »

The help only talks about CTBNoRClickDefaultCommands=0 (tweaks are ignored in the help) and it seems to me that it works as advertised now, and it makes sense to me.

What do you want to happen instead?

autocart
Posts: 1246
Joined: 26 Sep 2013 15:22

Re: [Bug?] Question about CTB right-click and load command

Post by autocart »

Mainly, I want to use the same script for left and right click.
It would be easier and safer to manage the code if I could directly execute it on right click as well and then build my context menu on my own in the script. It would also be more flexible in general. But I now realized a good enough work around:
Using for the right-click:

Code: Select all

"foo"
 load "test", "foo"; //load script labeled "foo" from "test.xys"
"oof"
 load "test", "oof"; //load script labeled "oof" from "test.xys"
And using for the left-click:

Code: Select all

load "test", "ofo"; //load script labeled "ofo" from "test.xys"
Thanks for asking. All good enough now.

admin
Site Admin
Posts: 60357
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: [Bug?] Question about CTB right-click and load command

Post by admin »

Okidoki. :tup:

autocart
Posts: 1246
Joined: 26 Sep 2013 15:22

Re: [Bug?] Question about CTB right-click and load command

Post by autocart »

One last quick question:
Is it possible somehow to add custom icons on the left side of the items in a CTB's right-click context menu?
Similar to the icons in popupmenu()?

I assume "no", because I did not see a way. But I might be overlooking something.

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

Re: [Bug?] Question about CTB right-click and load command

Post by klownboy »

Hi again autocart. This works. Obviously the pic is with the tweak not set. With it set, the "Click" and beyond is not there.

Code: Select all

"foo|:cfi";
 load "test", "foo";
"ofo|:hotlist";
 load load "test", "ofo";
"oof|<xyicons>\refresh_04.ico";
 load "test", "oof";
Right click menu fefifo.jpg
Right click menu fefifo.jpg (6.18 KiB) Viewed 612 times
Last edited by klownboy on 23 Oct 2021 00:27, edited 1 time in total.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

autocart
Posts: 1246
Joined: 26 Sep 2013 15:22

Re: [Bug?] Question about CTB right-click and load command

Post by autocart »

klownboy wrote: 23 Oct 2021 00:18 Hi again autocart. This works.
Wow, cool! Thank you so much! :party:

JLoftus
Posts: 577
Joined: 22 Jan 2014 14:58

Re: [Bug?] Question about CTB right-click and load command

Post by JLoftus »

Just chiming in here to say this one tripped me up too. I'd been using a CTB with both left and right click actions for a couple years, and for me, "suddenly", the right click behavior changed to this context menu. I was about to post it as a question when I saw this thread. I changed the tweak to "1" and now it's back to working the way I have been accustomed. I guess I'm not really understanding why this behavior changed, but I'm thankful for this forum to help muddle through things like this.

Post Reply