Page 1 of 1
[FIXED]Missing :: in ctb RClick script can break RClick
Posted: 12 Feb 2015 19:10
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'".
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.
Re: SC load #ScriptIndex syntax doesn't work with ctb RClick
Posted: 12 Feb 2015 19:39
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.
Re: SC load #ScriptIndex syntax doesn't work with ctb RClick
Posted: 12 Feb 2015 20:25
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)
Missing :: in ctb RClick script can break RClick
Posted: 12 Feb 2015 20:33
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
Re: Missing :: in ctb RClick script can break RClick
Posted: 12 Feb 2015 20:41
by TheQwerty
SammaySarkar wrote:But still, removing the :: in LClick makes no difference, but removing them from RClick breaks RClick.
This I can confirm.
Re: Missing :: in ctb RClick script can break RClick
Posted: 13 Feb 2015 01:29
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.
Re: Missing :: in ctb RClick script can break RClick
Posted: 13 Feb 2015 06:18
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";
Re: Missing :: in ctb RClick script can break RClick
Posted: 13 Feb 2015 13:53
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.
Re: Missing :: in ctb RClick script can break RClick
Posted: 14 Feb 2015 11:37
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.
Re: Missing :: in ctb RClick script can break RClick
Posted: 14 Feb 2015 14:30
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
Re: [FIXED]Missing :: in ctb RClick script can break RClick
Posted: 15 Feb 2015 06:01
by bdeshi
Great. I can now finally outsource my ctb scripts as outlined in the first post.