Sign in to follow this  
Followers 0
alawoona

Menu & Shortcut Keys

5 posts in this topic

#1 ·  Posted (edited)

What am i doing wrong -

When I enter <ALT>f the file menu does not open? Tried the example in the help file and it seems to work.

#include "GUIConstants.au3"

GUICreate("My GUI menu",300,200)

$oFileMenu = GUICtrlCreateMenu ("&File")

$oFileNew = GUICtrlCreateMenuItem ( "&New", $oFileMenu )

$oFileOpen = GUICtrlCreateMenuItem ("&Open",$oFileMenu)

$oRecentFilesMenu = GUICtrlCreateMenu ("Recent Files",$oFileMenu,2)

$oSeparator1 = GUICtrlCreateMenuitem ("",$oFileMenu,3)

$oSaveFile = GUICtrlCreateMenuitem ("&Save", $oFileMenu)

GUICtrlSetState($oSaveFile,$GUI_DISABLE)

$oSaveFileAs = GUICtrlCreateMenuitem ("Save &As...", $oFileMenu)

GUICtrlSetState($oSaveFileAs,$GUI_DISABLE)

$oSeparator2 = GUICtrlCreateMenuitem ("",$oFileMenu,6)

$oClose = GUICtrlCreateMenuitem ("&Close", $oFileMenu)

$oEditMenu = GUICtrlCreateMenu ( "&Edit" )

GUISetState ()

While 1

$msg = GUIGetMsg()

If $msg = $oFileOpen Then

$file = FileOpenDialog("Choose file...",@TempDir,"All (*.*)")

EndIf

If $msg = $oClose Then

GUIDelete()

Exit

EndIf

WEnd

GUIDelete()

Exit

Edited by alawoona

Share this post


Link to post
Share on other sites



If you add the following two lines to the start of your script, the problem goes away:

$okbutton = GUICtrlCreateButton ("OK",50,130,70,20)
GUICtrlSetState(-1,$GUI_FOCUS)

So why does the $GUI_FOCUS affect the Alt keys?


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Update

Seems to be a general problem with a menu- and 'controlfree'-window.

I used some other sample menu applications and removed the controls from the windows -> and now they have the same problem.

So I see no chance to correct a default-will-ever-happens-bug :(

P.S.: I never saw an application with only menus in it but however, you could use the small workaround with creating a small label.

I somebody knows a solution let us know :ph34r:

So long and regards

Holger

Edited by Holger

Share this post


Link to post
Share on other sites

Thanx Holger - there will be other controls in my GUI so that will overcome the "problem"

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0