Jump to content

Recommended Posts

Posted (edited)

Hello,

I have this example from the help of AutoIT.

CODE
#include <GUIConstants.au3>

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()

Exit

The menu in above example is sunken and the rest of the GUi is not, is it possible both sunken or both not sunken?

Edited by Xink
Posted

Sorry, no idea what you mean.Tried your example. It works fine- What do you mean with sunken menues?

Johannes LorenzBensheim, Germanyjlorenz1@web.de[post="12602"]Highlightning AutoIt Syntax in Notepad++ - Just copy in your Profile/application data/notepad++[/post]

Posted

Sorry, no idea what you mean.Tried your example. It works fine- What do you mean with sunken menues?

Hi jlorenz1,

I mean, the menubar GUI is (sunken) lower then the GUI below with the 2 button.

Is it possible to set the menubar the same thickness as the GUI below?

Xink

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
×
×
  • Create New...