Add sub-menu support for scripts

Features wanted...
waqu
Posts: 17
Joined: 04 Jan 2015 05:58
Location: Russia/Saint-Petersburg
Contact:

Add sub-menu support for scripts

Post by waqu »

Add the ability to create sub-menus in scripts.

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Add sub-menu support for scripts

Post by bdeshi »

you could use popupmenu()
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

FluxTorpedoe
Posts: 855
Joined: 05 Oct 2011 13:15

Re: Add sub-menu support for scripts

Post by FluxTorpedoe »

Hi’

And if you have more complex needs for dynamic menus or submenus,   load $YourMenu, , "s"   and   heredoc syntax   also come in handy, e.g.:

Code: Select all

"Regular Entry"
	msg 0;

"Submenu Entry<tab>>"
// ------------------>
  $Menu = <<<#>>>

"Submenu First Entry"
	msg 1;
"Submenu Second Entry"
	msg 2;

#>>>;
	load $Menu, , "s";
// ------------------<
Have a nice day, 8)
Flux

highend
Posts: 13309
Joined: 06 Feb 2011 00:33

Re: Add sub-menu support for scripts

Post by highend »

+99!

Thanks @SammaySarkar & FluxTorpedoe!

But... A native way for real menu structures would be greatly preferred...

- If you switch to a submenu, the whole main menu is gone (hard to grasp what else you could have clicked, even more so for larger menus)
- While it's possible to get the main menu back you can't do it without adding another "..\" entry for each submenu (or however you'd name it)
One of my scripts helped you out? Please donate via Paypal

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

Re: Add sub-menu support for scripts

Post by admin »

Got an idea for how to do this. Planned for 17.20...

highend
Posts: 13309
Joined: 06 Feb 2011 00:33

Re: Add sub-menu support for scripts

Post by highend »

:tup: :whistle: :mrgreen:
One of my scripts helped you out? Please donate via Paypal

highend
Posts: 13309
Joined: 06 Feb 2011 00:33

Re: Add sub-menu support for scripts

Post by highend »

@Flux

Can you create multiple nested submenus with your method?

Like:
Root menu entry 1
Sub menu 1
....Entry a
....Entry b
....Sub menu 2
........Entry c
Root menu entry 2
One of my scripts helped you out? Please donate via Paypal

FluxTorpedoe
Posts: 855
Joined: 05 Oct 2011 13:15

Re: Add sub-menu support for scripts

Post by FluxTorpedoe »

highend wrote:Can you create multiple nested submenus with your method?
Wicked… :kidding:

Never needed it before, but here it is, an example with sub-sub-menu and embedded warnings:
 — Variables must be quoted when used (else they are resolved prematurely)
 — Even XY vars, especially <crlf> (which breaks heredoc menus)
XY_Submenus.png
XY_Submenus.png (38.98 KiB) Viewed 3086 times

Code: Select all

"Main Menu A1"
	msg "Main Menu A1";


// --------------------------->
"Main Menu A2<tab>>"
	$var = "foo;bar";
  $Menu = <<<#>>>
"Submenu B1"
  msg "Submenu B1";


// ------------------>
"Submenu B2<tab>>"
  $SubMenu = <<<#)))
"SubSubmenu C1   [Regular]"
	msg "C1";
"SubSubmenu C2   [Vars not quoted => risk of error]"
  msg $var;
"SubSubmenu C3   [All vars quoted => OK]"
  msg "$var";
"SubSubmenu C4   [Even CRLF => use chr(13)]"
  msg "First line".chr(13)."Second Line";
#)));
   load $SubMenu, , "s";
// ------------------<


#>>>;
   load $Menu, , "s";
// ---------------------------<
[/size]
———————————————————————————
admin wrote:Got an idea for how to do this. Planned for 17.20...
Cool news! :beer:

Have a nice day, 8)
Flux

highend
Posts: 13309
Joined: 06 Feb 2011 00:33

Re: Add sub-menu support for scripts

Post by highend »

Cool Flux and thanks a lot for providing the example! Now the only thing I have to do is build a clever parser :biggrin:
Now the only thing I have to do is build a clever parser
Done :maf:
One of my scripts helped you out? Please donate via Paypal

highend
Posts: 13309
Joined: 06 Feb 2011 00:33

Re: Add sub-menu support for scripts

Post by highend »

Works nicely (these are generated by UMC...) :mrgreen:
Clicking on files / folders lead to a different menu...
GIF.gif
GIF.gif (69.48 KiB) Viewed 3059 times
One of my scripts helped you out? Please donate via Paypal

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

Re: Add sub-menu support for scripts

Post by klownboy »

Hey highend, how's it going? I see you must be still tweaking UMC. I'm still using it daily. When are we, or maybe for now I should say I, going to see another update. :)

It would be nice though if Don could give us fly-out sub-menus on mouse hovering where the original menus stayed visible. :whistle:
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

highend
Posts: 13309
Joined: 06 Feb 2011 00:33

Re: Add sub-menu support for scripts

Post by highend »

Hi Ken. Everything's fine here. Didn't had much time for UMC in the past. But I've added a few features recently (one of them is obviously nested submenus) and menus got a "match" property as well so that rebuilding XY's tree and list menus became possible. Unfortunately not all menu entries have an internal XY ID so I need to add scripts to recreate the same functionality :)
One of my scripts helped you out? Please donate via Paypal

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

Re: Add sub-menu support for scripts

Post by admin »

admin wrote:Got an idea for how to do this. Planned for 17.20...
Next beta supports multiple nested submenus with SC popupmenu()... :)

highend
Posts: 13309
Joined: 06 Feb 2011 00:33

Re: Add sub-menu support for scripts

Post by highend »

While you're (already) on it, can you add icon support for popupmenu() as well? Too many people like those shiny little (distracting) thingies...
One of my scripts helped you out? Please donate via Paypal

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

Re: Add sub-menu support for scripts

Post by admin »

You mean toolbar icons?

Post Reply