The Underline is not appearing in the compiled application where the '&' is inserted in the text definition of a Menu.
/*
EBASIC example program
Creating a window and adding a basic menu
Compile as a WINDOWS target
*/
REM define a window variable
DEF w1 as WINDOW
REM a variable to keep track of a checked menu
DEF bChecked as INT
REM open the window
OPENWINDOW w1,0,0,350,350,@MINBOX|@MAXBOX|@SIZE,0,"Simple Window",&main
REM define the menus
BEGINMENU w1
MENUTITLE "&Option"
MENUITEM "&Print", 0, 1
MENUITEM "&Quit", 0, 2
SEPARATOR
MENUITEM "Check &me", 0, 3
ENDMENU
REM print a message
PRINT w1,"Hello World "
REM when w1 = 0 the window has been closed
WAITUNTIL w1 = 0
END
'---
SUB main
SELECT @MESSAGE
CASE @IDCREATE
CENTERWINDOW w1
CASE @IDCLOSEWINDOW
REM closes the window and sets w1 = 0
CLOSEWINDOW w1
CASE @IDMENUPICK
SELECT @MENUNUM
CASE 1: ' user selected Print
PRINTWINDOW w1
CASE 2: ' user selected Quit
CLOSEWINDOW w1
CASE 3: ' toggle a checkmark
bChecked = (bChecked = FALSE)
CHECKMENUITEM w1, 3, bChecked
ENDSELECT
ENDSELECT
RETURN
ENDSUB
Help File:
QuoteThe "&" in the item definitions specify the letter to be underlined in the item text.
Run your program and press ALT-O ;)
Larry
Thanks Larry. Yes that makes them show up after ALT-O is pressed.
I always thought they should be displayed to show that the ALT key could be used???
The IDE for EBasic works exactly as I suggested also.
Larry
Hit ALT by itself to make the top line in the IDE toggle between being underlined and not. Same for your program.
Larry
All the time I have been using software and that simple little bit of info has NOT been in my list!!
Have been using Borland C for long time and used to it more.
Have done testing as you suggest, Larry, and found the Outlook Express is the same as you are saying for the IDE and EBasic progs.
Though if you start Mozilla Firefox it DOES HAVE the underlines showing without the ALT being pressed.
Appears that some Tools work different to others.
Thanks again for clearing that up for me.
The gecko engine, Mozilla/firefox,et al, has been around long before XP. They use there own custom menu class which emulates the old "Microsoft Style Guide" to always show underlines.
In XP and above it is controllable. Right click on your desktop, click "Properties" and select the "Appearance tab". Click the "Effects" button.
The last checkbox reads:
"Hide underlined letters for keyboard navigation until I press the ALT key"
Uncheck it and everything will match FireFox ;)
Paul.
Thank you Paul.
Those settings do the job.
Allan
Hi...i dont know for firefox but i use K-Meleon wich is also based on mozila and i have underline.