Page 2 of 2

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

Posted: 22 Oct 2021 18:40
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.

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

Posted: 22 Oct 2021 19:37
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.

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

Posted: 22 Oct 2021 20:06
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?

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

Posted: 22 Oct 2021 20:41
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.

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

Posted: 22 Oct 2021 20:51
by admin
Okidoki. :tup:

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

Posted: 22 Oct 2021 21:41
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.

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

Posted: 23 Oct 2021 00:18
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 765 times

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

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

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

Posted: 26 Oct 2021 18:20
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.