Page 1 of 1

Icon for an empty main menu entry in a script?

Posted: 15 Jul 2011 07:42
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?

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

Posted: 15 Jul 2011 07:59
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
XYplorer_CTB_Icons-for-emtpy-Scripts2b.png


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:
XYplorer_CTB_Icons-for-emtpy-Scripts.PNG

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

Posted: 15 Jul 2011 08:03
by highend
The simple way works good enough (adding just a semicolon to the main menu entry).

Thanks Stefan! :)

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

Posted: 15 Jul 2011 19:45
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.