Page 1 of 1

hover to open "New" and "New Item" in context menu

Posted: 08 Oct 2024 21:40
by terrytw
Based on viewtopic.php?t=27931

I wish the context menu could behave same as normal menu items with automatic expansion of submenu.

Thank you!

Re: hover to open "New" and "New Item" in context menu

Posted: 09 Oct 2024 15:45
by eil
Since original topic is connected to menu scripted via popupmenu(), maybe popupnested() command can be used for desired results.

Re: hover to open "New" and "New Item" in context menu

Posted: 09 Oct 2024 18:22
by terrytw
eil wrote: 09 Oct 2024 15:45 Since original topic is connected to menu scripted via popupmenu(), maybe popupnested() command can be used for desired results.
I am using popnestedmenu already...Maybe you misread it.

Re: hover to open "New" and "New Item" in context menu

Posted: 26 Oct 2024 21:59
by terrytw
I have found a workaround.

Just use the script function "new" and its source file option.

Re: hover to open "New" and "New Item" in context menu

Posted: 26 Oct 2024 22:06
by xy123
terrytw wrote: 26 Oct 2024 21:59 Just use the script function "new" and its source file option.
Could you paste the code?

Re: hover to open "New" and "New Item" in context menu

Posted: 26 Oct 2024 22:21
by terrytw
xy123 wrote: 26 Oct 2024 22:06
terrytw wrote: 26 Oct 2024 21:59 Just use the script function "new" and its source file option.
Could you paste the code?

Code: Select all

		$menu = <<<MENU
-
#230
 ::New Folder|/"<xypath>\Data\Icons\XYicon_FolderGeneric.ico"|new(,,"<xypath>\Data\NewItems\New",ru);
 ::New Text File|/"%windir%\System32\notepad.exe"|new(,,"<xypath>\Data\NewItems\New.txt",ru);
 ::New Word Document|/"%ProgramData%\Microsoft\Windows\Start Menu\Programs\Word.lnk"|new(,,"<xypath>\Data\NewItems\New Word Document.docx",ru);
 ::New Excel Worksheet|/"%ProgramData%\Microsoft\Windows\Start Menu\Programs\Excel.lnk"|new(,,"<xypath>\Data\NewItems\New Excel Worksheet.xlsx",ru);
 -
 MENU;
		popupnested($menu, 7:="|");
#230 is only there for the name, it doesn't really do anything per se.
"7:="|"" means I am using "|" to separate sections in each line, the default is ";", I need to use ";" to separate multiple script command, which is irrelevant to this particular section so you can change it back if you want.
"ru" means going straight into edit file name mode and enable to ability to "ctrl+z" the new item action.

You need to have New.txt, New Word Document.docx, New Excel Worksheet.xlsx in <xypath>\Data\NewItems folder.

Re: hover to open "New" and "New Item" in context menu

Posted: 26 Oct 2024 23:09
by xy123
Got it, thank you.