Display text anywhere on the menu screen

E2B v1.97A+ and grub4dos 0.4.6a 2017-12-23 and later. 
The setmenu --string command can be used to display strings on menus (date&time requires grub4dos 0.4.6a 2019-08-09 and E2B v1.B5 or later).
grub4dos maintains a list of up to 16 strings which it will write on top of each menu until the list is cleared.
Note: For E2B v1.B8+ - use new iINDEX syntax. Do not mix non-iINDEX commands with iINDEX commands.
setmenu --string=[X]=[-]Y=COLOR="STRING"  max 16 commands - (deprecated syntax - do not useor
New syntax:
setmenu --string=iINDEX=[X]=[-]Y=COLOR="STRING"  iINDEX = i0-i15 (E2B v1.B8 and later only, grub4dos 2019-12-30+)
  X: If no X or s then text is centred  on screen, if m then text centred across menu area.
  -Y represents the count from the bottom - e.g. -0 = bottom.
  "STRING"="date&time=FORMAT"  will update date FORMAT every second.
  e.g. "date&time=MMM.dd.yyyy  HH:mm:ss"
  e.g. "date&time=dd/MMM/yy AP hh:mm:ss"
  "STRING"="date&time"  ISO8601 format. equivalent to: "date&time=yyyy-MM-dd  HH:mm:ss"
  --string=iINDEX to disable the specified index. 
  --string= to clear all strings.
Note: Use only 0xRRGGBB or 0xrrggbb00RRGGBB for COLOR.

See this blog post for an example of how to add random jokes onto your menu screen.

You can add up to 16 setmenu --string commands to write text anywhere onto the grub4dos menu display.
Add the following lines to your \_ISO\MyE2B.cfg file for each string you want to write:
#                        x    y    colour       "text to display"
setmenu --string=66=15=0xFFFF00="STRING1 ångström at 66,15"
setmenu --string=i0=66=15=0xFFFF00="STRING1 ångström at 66,15"
If you save the file as UTF-8, you can include non-ASCII characters within the double-quotes.
You can specify a background colour for --strings - e.g. 0xFFFFFF001111FF.
You can also specify standard ASCII characters using their hexedecimal value - e.g. \x03 or their unicode value, e.g. \X00C4 for Ä (note use lower case x for ASCII and upper-case X for 4-character hex unicode values).

# display ångström, yellow text on grey background - centre across menu area on bottom line of screen
setmenu --string=i0=m=-0=0x44444400FFFF00="\X212Bngstr\X00F6m"           

Up to 16 --string commands are cached\remembered and will be displayed on all menus.

You should avoid writing strings inside the menu area as may cover menu entries.

You can use \n inside string to start the text on a new line (setmenu --string=0=33=0xFF0000="How are you\nFRED"). Note that the strings are written after the menu border and menu entries are displayed, so characters and spaces can overwrite the menu area.

Strings will use the 'standard' console text background colour unless you specify a background colour. For this reason it is always best to use a back background colour for the 'color standard=' console colour.

You can clear the --string cache of all previous string commands using setmenu --string=

Clear a string using, e.g. setmenu --string=i0

You can use echo -mem=0x3a8000=1024 to view first 1024 bytes of current --string values.

Note: When you reload the main menu (using F8 in the Main Menu), E2B will clear all strings before MyE2B.cfg is loaded and run.

Using --string in multiple menus

If you wish to use --string commands on different menus, e.g. in \_ISO\LINUX\!!CONFIG\linux.mnu and \_ISO\BACKUP\!!CONFIG\backup.mnu, etc. in order to write different strings to different menus, you must delete all previous strings first.

Note that the .mnu file must be enumerated first, so we must place it in the !!CONFIG sub-folder.


# clear strings buffer because only 16 allowed
setmenu --string=
# write string commands to string command buffer
setmenu --string=66=15=0xFFFF00="\X212Bngstr\X00F6m"  
setmenu --string=66=16=0xFFFF00="Hello!"  
setmenu --string=66=17=0xFFFF00="How are you"  
#                        x    y    colour       "text to display"

# clear strings buffer
setmenu --string=
# write new string commands to string command buffer
#                x   y  colour  "text to display"
setmenu --string=i0=66=14=0xFFFF00="STRING1 ångström at 66,14"
setmenu --string=i1=66=15=0xFFFF00="\X212Bngstr\X00F6m"
setmenu --string=i2=66=16=0xFFFF00="Hello!"  
setmenu --string=i3=66=17=0xFFFF00="How are you"

You can only use a maximum of 16 string commands (i0-i15).

As an alternative, you can place the commands in a menu batch file, e.g. to place strings on the BACKUP menu.
# clear strings buffer - only 16 allowed
setmenu --string=
# write new string commands to string command buffer
#                x   y  colour  "text to display"
setmenu --string=i0=66=14=0xFFFF00="STRING1 ångström at 66,14"
setmenu --string=i1=66=15=0xFFFF00="\X212Bngstr\X00F6m"
setmenu --string=i2=66=16=0xFFFF00="Hello!"  
setmenu --string=i3=66=17=0xFFFF00="How are you"
When any menu folder is loaded, a .g4b file of the same name as the menu folder will be executed if present (e.g. \_ISO\MAINMENU.g4b or \_ISO\MYNEWFOLDER.g4b).
Grub4dos batch files must start with !BAT on the first line.

Add an updating Date and Time string

With E2B v1.B5+ you can add a transparent string anywhere on the screen which includes the current date and time. This will automatically update every second.
Add to end of \_ISO\MyE2B.cfg:
# Display Date and Time on every menu (max. 16 --string commands, use 'setmenu --string=' to clear all strings)
# Can add own string with special replacement code strings of dd MM MMM yyyy hh HH mm ss AP
setmenu --string=i5=71=0=0xffffff="date&time=[dd-MMM-yyyy  hh:mm:ss AP]"
71 is the X co-ordinate, 0 is Y co-ordinate, 0xffffff is 0xRRGGBB colour.
MM will print 08 or MMM will print Aug, AP will print either AM or PM, hh will print 13 (24-hour clock) or HH will print 01 (12-hour clock).
Note: 00:xx does not exist with 12-hour clock...
12:00 AM (midnight)
12:43 AM
01:43 AM
07:00 AM (time to wake up)
11:59 AM
12:00 PM (noon)
12:43 PM
01:43 PM
05:01 PM (Gin&Tonic time)
11:00 PM (zzzzzz)
Example using mixed text:
setmenu --string=i10=40=0=0xffffff="date&time=Year=yyyy Month=MM Day=dd  The current hour is HH"
You could set up a hotkey in the MyE2B.cfg to permanently disable the date&time string:
()/%grub%/hotkey [ctrl+F2] "@setmenu --string=i10" > nul
The \_ISO\docs\Sample mnu Files\E2B Menus folder contains a Display_DateAndTime.mnu example menu file.

Date and Time in Main Menu only

If you do not want the Date and Time displayed on any of the sub-menus, you can create a .mnu file for each of the sub-menu folders to disable the date&time string. We do not need to modify the MyE2B.cfg file. 
Example: The three files below will cause the date and time to be displayed whenever the Main Menu is loaded and the string will be removed whenever the WINDOWS or DOS menu is loaded.
Note that we must delete all strings first because we can only add a maximum of 16 strings and we may change the menu more than 16 times. If you also want other strings displayed on the menu, then you must add extra lines for each string into the MAINMENU.g4b file.
# clear all strings
setmenu --string=
setmenu --string=i5=71=0=0xffffff="date&time=[dd-MMM-yyyy  hh:mm:ss AP]"
# add other strings here, etc.
setmenu --string=i5
setmenu --string=i5
If you do not want the date&time string in the UTILITIES menu you must create a \_ISO\UTILITIES.g4b file, etc., etc.
The grub4dos internal string list holds up to 16 strings.
Use iINDEX syntax with E2B v1.B8+.
You can only run a maximum of 16 setmenu --string commands to add strings or use i0-i15. 
Once 16 strings have been added to the internal list, any further added strings are ignored.
You can use setmenu --string=iINDEX  to disable string INDEX, where INDEX=0-15.
You can use setmenu --string= to clear all strings.
You cannot re-enable a disabled string. You can add another string (up to 16 in total) or clear the list and add up to 16 new strings.
There is no grub4dos command to list all strings in the list.