[FIXED]Missing :: in ctb RClick script can break RClick

Things you’d like to miss in the future...
Forum rules
:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:

:info: Please include the following information:
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".

:warnred20: :warnred20: :warnred20: :warnred20: :warnred20: READ THIS AND DO IT!!! :warnred20: :warnred20: :warnred20: :warnred20: :warnred20:
Post Reply
bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

[FIXED]Missing :: in ctb RClick script can break RClick

Post by bdeshi »

Actually these two has been bugging me for quiete sometime.

Code: Select all

scriptfile : <xyscripts>\ctb\menu.xys
ctb LClick : ::load "ctb\menu.xys", "#1", f;
          OR ::load "ctb\menu.xys", "#1", f;
ctb RClick : load "ctb\menu.xys", "#2", f;
script     :

Code: Select all

// ==LCLICK======================================
"MainMenu : mainmenu"
  popupmainmenu;
// ==RCLICK======================================
"windowmenu : windowmenu"
  popupmainmenu "window";
left click works fine, but right click says "The list of labels did not match any script in Script file 'ctb\menu.xys'".



:ninja:
And here's the second request:
when ctb leftclick has SC load with a single label, the labelled subscript executes directly, but if ctb rightclick has the same, it pops up a single-entry menu, requiring one extra click. load "ctb\menu.xys", "windowmenu";


I realize this may be applied to handle normal ctb right-click menu mechanism, but just as there's a tweak for that, can there also be a tweak for this please?

ed. removed :: where they were not.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: SC load #ScriptIndex syntax doesn't work with ctb RClick

Post by TheQwerty »

I cannot reproduce this in a fresh instance of 14.80.0233 - perhaps try posting menu.xys?
screenshot.36.png

For the second part why not just enable the CTBNoRClickDefaultCommands tweak? I'm not a fan but it achieves what you're after.
To see the attached files, you need to log into the forum.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: SC load #ScriptIndex syntax doesn't work with ctb RClick

Post by bdeshi »

menu.xys is exactly like 2nd codeblock, but here's the file in any case.
menu.xys
[/size]

The error dialog also comes up in both a fresh <xydata> and just ::fresh, with CTBNoRClickDefaultCommands=1 (I already have this enabled in my active setup)

More detail, all in a fresh datapath, nothing modified but the tweak and ctb.

if RClick is load "ctb\menu.xys", "windowmenu",f; & tweak = 0,
        on right-click I get: windowmenu/-/Click/Edit.../-/Customize Toolbar...
if RClick is load "ctb\menu.xys", "windowmenu",f; & tweak = 1,
        on right-click I get: windowmenu, a single-item menu
        (and like above on CTRL+Rclick)

if RClick is load "ctb\menu.xys", "#2",f; & tweak = 0,
        on right-click I get: /-/Click/Edit.../-/Customize Toolbar... (RC menuitem is missing)
if RClick is load "ctb\menu.xys", "#2",f; & tweak = 1,
        on right-click I get: "The list of labels did not match any script in Script file 'ctb\menu.xys'."
        (Click/Edit.../-/Customize Toolbar... on CTRL-Rclick, as if RC script was empty)
To see the attached files, you need to log into the forum.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Missing :: in ctb RClick script can break RClick

Post by bdeshi »

WAIT!
Turn out the :: was missing in RClick. ed: adding these solves both issues.

That looks like a silly mistake on my part.

But still, removing the :: in LCick makes no difference, but removing them from RClick breaks RClick.
IOW, the same script cause errors in RCLick, and not in LClick, only for missing optional instestines colons.
Still looks like a bug, albeit a different one. Cue retitling
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Missing :: in ctb RClick script can break RClick

Post by TheQwerty »

SammaySarkar wrote:But still, removing the :: in LClick makes no difference, but removing them from RClick breaks RClick.
This I can confirm.

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

Re: Missing :: in ctb RClick script can break RClick

Post by klownboy »

Sammay, I'm getting old but I thought this topic rang a bell. Take a look at this thread starting here http://www.xyplorer.com/xyfc/viewtopic. ... CTB#p80585 and continue on for a number of posts. Almost 2 years ago within a month.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Missing :: in ctb RClick script can break RClick

Post by bdeshi »

Ken from that thread wrote:Could you make a change or tweak that would bring up the menu loaded via the the right click without seeing the intermediate "_rightclicked" menu? An auto-executing section of a script such that we could set variable prior to displaying a menu would be even better, but I think it would be great if we could eliminate the appearance of the intermedate menu in anycase.
Heh, even that gets solved by adding ::'s before load "D:\Tools\XYplorer\Scripts\rightclicktest.xys", "_rightclicked";
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

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

Re: Missing :: in ctb RClick script can break RClick

Post by klownboy »

SammaySarkar wrote:Heh, even that gets solved by adding ::'s before load "D:\Tools\XYplorer\Scripts\rightclicktest.xys", "_rightclicked";
Yes, I noticed that but I guess I didn't 2 years ago. Looking back, this situation eventually resulted in Don getting perm variables to appear in XY built scripting menus since we couldn't do it with environmental variable on the fly. Thanks.

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

Re: Missing :: in ctb RClick script can break RClick

Post by admin »

A complex mess. A combination of three mini-bugs, partly going back as far as v8.40.0105 - 2009-09-18 14:30.

Let's see if the next beta is alright.

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

Re: Missing :: in ctb RClick script can break RClick

Post by klownboy »

It looks like you nailed it. I no longer need the :: in front of SC load on the right click do something similar to what I was doing here http://www.xyplorer.com/xyfc/viewtopic. ... CTB#p80585 and not have the intermediate "_rightclicked" single menu item come up.
Thanks Don

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: [FIXED]Missing :: in ctb RClick script can break RClick

Post by bdeshi »

Great. I can now finally outsource my ctb scripts as outlined in the first post.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Post Reply