Re: Add sub-menu support for scripts
Posted: 29 Oct 2016 11:09
No, just talking about nesting.
Forum for XYplorer Users and Developers
https://www.xyplorer.com/xyfc/
Code: Select all
> In a multi-line script all lines apart from the first line have to be indented by at least one space.
> Each non-indented line is interpreted as the first line of a separate script, and if there are more than one scripts in a loaded script resource (i.e. a multi-script) then a menu is popped where you can select the script to run.Code: Select all
text popupnested("Top|>Sub|>Sub|>>Sub2|>>Sub2|Top",,,,, 2);
$menu = <<<MENU
Top;;:paper;1
>Sub;;;4
>Sub
>>Sub2;;*.ini
>>Sub2
>>Sub2;;;2
Top;;<xy>
MENU;
text popupnested($menu);Code: Select all
$menu = <<<MENU
"Top 1"
msg 1;
"Top 2"
>"Sub 1"
msg 21;
>"Sub 2"
>>"SubSub 1"
msg 221;
>>"SubSub 2"
msg 222;
"Top 3"
msg 3;
MENU;
load $menu, , "s";Code: Select all
text popupnested("Top|>Sub<get char 0041 |>Sub|>>Sub2|>>Sub2|Top");Code: Select all
text popupnested("Top|>Sub<get char 0041>|>Sub|>>Sub2|>>Sub2|Top");
text popupnested("Top|>Sub<selimets |>|>Sub|>>Sub2|>>Sub2|Top");Code: Select all
$menu = <<<MENU
Top;;:paper;1
Sub;;;4
Sub
Sub2;;*.ini
Sub2
Sub2;;;2
Top;;<xy>
MENU;
text popupnested($menu);
Wow…admin wrote:I meant if you would create a menu caption "Sub<get char 0041 " ... sure, it's crazy, but users are crazy...
Well, why not, but the previous was quite clear too.admin wrote:One improvement I could add is to make this possible (that the top level does not have to be left-bound).
Code: Select all
text popupnested("Top| Sub| Sub| Sub2| Sub2|Top");I see your point. But for now I will keep it as it is. An optional submenu identifier can always be added later as an additional parameter.FluxTorpedoe wrote:What bothered me with "indent" as a submenu identifier was the fact that indentation would mean two completely different things depending on the context (standard scripting or popumenunested).
Plus, another submenu identifier would still be needed for multiline scripts, hence the incentive to keep indentation as it is and use another submenu identifier.
Code: Select all
"Top"
"Sub1"
"Sub11"
text "11";
"Sub12"
text "12";
"Sub2"
text "2";
"Top2"
text "T2";Code: Select all
Mp3 Special<:><:><:>4
Filename (Artist - Title.mp3) to ID3 Tag<:>#141;<:><:>4
Filename (Track - Artist - Title.mp3) to ID3 Tag<:>#142;<:><:>4
Filename (Artist - Album - Track - Title.mp3) to ID3 Tag<:>#143;<:><:>4
Filename (Artist - Year - Album - Track - Title.mp3) to ID3 Tag<:>#158;<:><:>4
The new SC popupnested is great Don, but revamping previously written large menus that use normal XY menu scripting can be quite a task. No problems when coming up with new menus. I have a few menus that I'd be better off starting from scratch (and I don't want to do that) than trying to update to use SC popupnested especially when there are long complicated run or open statements. So I'll second the motion for nested fly-out submenus in the typical XY menus that don't use SC popupmenu/popupnested.LittleBiG wrote:Won't something similar be possible later in CTB script?Code: Select all
"Top" "Sub1" "Sub11" text "11"; "Sub12" text "12"; "Sub2" text "2"; "Top2" text "T2";