Icon for an empty main menu entry in a script?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
highend
Posts: 13338
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Icon for an empty main menu entry in a script?

Post by highend »

Hi,

I just tried to add an icon to a "main menu entry" which itself doesn't execute any code but it's purpose is to divide the script into several main menus with sub menus (and only the sub menus execute code).

e.g.:

Code: Select all

"Convert &video files to...|<xypath>\<xyexe>"

"... 4:3 DVD-MPEG|<xypath>\<xyexe>"
	global $FFmpeg_Cmd, $TempFile, $InputPath, $OutputPath, $SelectedItems, $fopts, $gopts, $FileExtNew;
	$FFmpeg_Cmd = quote("<xydrive>\Tools\FFmpeg\ffmpeg.exe");
	$TempFile = "%temp%\~ffmpeg.bat";
	$InputPath = "<curpath>";
	$OutputPath = "<curpath>";
	$FileExtNew = "mpg";
	$gopts = "-i";
	$fopts = "-threads 4 -bufsize 102400k -target pal-dvd -pass 1 -b 2000k -aspect 4:3 -loglevel quiet";
	$SelectedItems = report("{Basename}?{Ext}|",1);
	$SelectedItems = substr($SelectedItems, 0, -1);
	sub "_Execute";
The icon for the submenu works but for the main menu only a ghosted X is shown until I manually hover over this entry.

Is there a way to always display the first icon as well?
Attachments
icons.jpg
icons.jpg (37.15 KiB) Viewed 628 times
One of my scripts helped you out? Please donate via Paypal

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Icon for an empty main menu entry in a script?

Post by Stefan »

highend wrote:Hi,

The icon for the submenu works but for the main menu only a ghosted X is shown until I manually hover over this entry.

Is there a way to always display the first icon as well?
Menu items for scripts without any code are always greyed-out, and so is the icon too, i guess.


So try this trick and add an code-block, even an single semicolon will do:

Code: Select all

"Convert &video files to...|<xypath>\<xyexe>"
   ;
"... 4:3 DVD-MPEG|<xypath>\<xyexe>"
   global xxxx
   xxxx
code-block for empty scripts, even an single semicolon will do
code-block for empty scripts, even an single semicolon will do
XYplorer_CTB_Icons-for-emtpy-Scripts2b.png (28.76 KiB) Viewed 623 times


If the semicolon trick would not had worked i had simply added an bit of dummy code:

Code: Select all

"Convert &video files to...|<xypath>\<xyexe>"
   msg "I Do Nothing, So DONT Click Me";
"... 4:3 DVD-MPEG|<xypath>\<xyexe>"
   global xxxx
   xxxx
Both will show you the icons as:
Icons for script menu without code
Icons for script menu without code
XYplorer_CTB_Icons-for-emtpy-Scripts.PNG (6.79 KiB) Viewed 624 times
Last edited by Stefan on 15 Jul 2011 08:16, edited 3 times in total.

highend
Posts: 13338
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Icon for an empty main menu entry in a script?

Post by highend »

The simple way works good enough (adding just a semicolon to the main menu entry).

Thanks Stefan! :)
One of my scripts helped you out? Please donate via Paypal

aurumdigitus
Posts: 1075
Joined: 30 May 2008 21:02
Location: Lake Erie

Re: Icon for an empty main menu entry in a script?

Post by aurumdigitus »

Stefan wrote:So try this trick and add an code-block, even an single semicolon will do:
A very handy titbit of information! Have wanted to make "the gray go away" for a long time.

Post Reply