Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Ampersand (&) for underlining a shortcut


  • Please log in to reply
5 replies to this topic

#1 jennico

jennico

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 862 posts

Posted 24 December 2010 - 11:24 PM

hi there and merry christmas !

from helpfile:
AutoIt         
#include <GUIConstantsEx.au3> #include <StaticConstants.au3> Opt('MustDeclareVars', 1) Example() Func Example()     Local $defaultstatus, $status, $filemenu, $fileitem, $helpmenu, $saveitem     Local $infoitem, $exititem, $recentfilesmenu, $separator1, $viewmenu     Local $viewstatusitem, $okbutton, $cancelbutton, $statuslabel, $msg, $file         GUICreate("My GUI menu", 300, 200)     Global $defaultstatus = "Ready"     Global $status     $filemenu = GUICtrlCreateMenu("&File")     $fileitem = GUICtrlCreateMenuItem("Open", $filemenu)     GUICtrlSetState(-1, $GUI_DEFBUTTON)     $helpmenu = GUICtrlCreateMenu("?")     $saveitem = GUICtrlCreateMenuItem("Save", $filemenu)     GUICtrlSetState(-1, $GUI_DISABLE)     $infoitem = GUICtrlCreateMenuItem("Info", $helpmenu)     $exititem = GUICtrlCreateMenuItem("Exit", $filemenu)     $recentfilesmenu = GUICtrlCreateMenu("Recent Files", $filemenu, 1)     $separator1 = GUICtrlCreateMenuItem("", $filemenu, 2)   ; create a separator line     $viewmenu = GUICtrlCreateMenu("View", -1, 1)    ; is created before "?" menu     $viewstatusitem = GUICtrlCreateMenuItem("Statusbar", $viewmenu)     GUICtrlSetState(-1, $GUI_CHECKED)     $okbutton = GUICtrlCreateButton("OK", 50, 130, 70, 20)     GUICtrlSetState(-1, $GUI_FOCUS)     $cancelbutton = GUICtrlCreateButton("Cancel", 180, 130, 70, 20)     $statuslabel = GUICtrlCreateLabel($defaultstatus, 0, 165, 300, 16, BitOR($SS_SIMPLE, $SS_SUNKEN))     GUISetState()     While 1         $msg = GUIGetMsg()                 If $msg = $fileitem Then             $file = FileOpenDialog("Choose file...", @TempDir, "All (*.*)")             If @error <> 1 Then GUICtrlCreateMenuItem($file, $recentfilesmenu)         EndIf         If $msg = $viewstatusitem Then             If BitAND(GUICtrlRead($viewstatusitem), $GUI_CHECKED) = $GUI_CHECKED Then                 GUICtrlSetState($viewstatusitem, $GUI_UNCHECKED)                 GUICtrlSetState($statuslabel, $GUI_HIDE)             Else                 GUICtrlSetState($viewstatusitem, $GUI_CHECKED)                 GUICtrlSetState($statuslabel, $GUI_SHOW)             EndIf         EndIf         If $msg = $GUI_EVENT_CLOSE Or $msg = $cancelbutton Or $msg = $exititem Then ExitLoop         If $msg = $infoitem Then MsgBox(0, "Info", "Only a test...")     WEnd     GUIDelete() EndFunc   ;==>Example

the ampersand should show "File" on the menu, but it doesn't on my computer, neither in my scripts. can anyone make a suggestion, while the underline does not show ? the ampersand itself doesn't show either, the menu text is just "File". what can i do, please ?

thx j.
I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Posted ImageDon't forget this IP: 213.251.145.96







#2 jennico

jennico

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 862 posts

Posted 25 December 2010 - 12:07 AM

oops you're right.... i didn't know that. i was definitely thinking the underline should always be showing. maybe it can be set by windows somewhere....

thx a lot
j.

Edited by jennico, 25 December 2010 - 12:08 AM.

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Posted ImageDon't forget this IP: 213.251.145.96

#3 rover

rover

    unmutual

  • Active Members
  • PipPipPipPipPipPip
  • 825 posts

Posted 25 December 2010 - 01:09 AM

removed

Edited by rover, 25 December 2010 - 01:16 AM.

I see fascists...

#4 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,758 posts

Posted 26 December 2010 - 11:21 PM

There is option in Windows system for defining that.
In TweakUI it's called "Switch off underline of chars in menu of programs"

#5 Mat

Mat

    43 38 48 31 30 4E 34 4F 32

  • MVPs
  • 5,066 posts

Posted 26 December 2010 - 11:24 PM

As far as forcing a window to show them: WM_CHANGEUISTATE would be my initial item of research (it looks promising)

As far as the OS setting goes, its tucked away nicely (vista):

Control Panel >> Ease of Access >> Ease of Access Center >> Make the keyboard easier to use >> Underline keyboard shortcuts and access keys

Edit: Better still:

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer] "NoChangeKeyboardNavigationIndicators"=dword:00000001


dword:00000001 shows the underlines,
dword:00000000 hides the underlines.

source

Edited by Mat, 26 December 2010 - 11:27 PM.


#6 Mat

Mat

    43 38 48 31 30 4E 34 4F 32

  • MVPs
  • 5,066 posts

Posted 27 December 2010 - 12:36 AM

That's definitely the topic you want... I should have known Melba had already done it :x




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users