Sign in to follow this  
Followers 0
c.haslam

MenuCreateItem: third level not working

2 posts in this topic

Consider the following script:

#include 
#include 
GUICreate("Annotate pictures", 887, 685, -1, -1, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_BORDER,$WS_CLIPSIBLINGS))
Global $mnuDir = GUICtrlCreateMenu("&Directory")
$mnuDirOpen = GUICtrlCreateMenuItem("Open", $mnuDir)
Global $mnuDirOpenMyComputer = GUICtrlCreateMenuItem("On this computer", $mnuDirOpen)
Global $mnuDirOpenNetwork = GUICtrlCreateMenuItem("On the network", $mnuDirOpen)
Global $mnuDirSave = GUICtrlCreateMenuItem("Save", $mnuDir)
Global $mnuDirExit = GUICtrlCreateMenuItem("Exit", $mnuDir)
Global $mnuTools = GUICtrlCreateMenu("Tools")
Global $mnuToolsLoadAllInDir = GUICtrlCreateMenuItem("Load all .jpgs in directory", $mnuTools)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
        Exit
    EndSwitch
WEnd

I expect to see:

Directory
      Open
         On the computer
         On the network
      Save
      Exit
   Tools
      Load all .jpgs in directory

but what I see is:

Directory
      Open
      On the computer
      On the network
      Save
      Exit
   Tools
    Load all .jpgs in directory

Do I not understand how to call MenuCreateItem(), or is there a bug in AutoIt?

...chris


...chris

Share this post


Link to post
Share on other sites



#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>

GUICreate("Annotate pictures", 887, 685, -1, -1, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUP,$WS_POPUPWINDOW,$WS_BORDER,$WS_CLIPSIBLINGS))
Global $mnuDir = GUICtrlCreateMenu("&Directory")
$mnuDirOpen = GUICtrlCreateMenu("Open", $mnuDir) ;******************** changed this line
Global $mnuDirOpenMyComputer = GUICtrlCreateMenuItem("On this computer", $mnuDirOpen)
Global $mnuDirOpenNetwork = GUICtrlCreateMenuItem("On the network", $mnuDirOpen)
Global $mnuDirSave = GUICtrlCreateMenuItem("Save", $mnuDir)
Global $mnuDirExit = GUICtrlCreateMenuItem("Exit", $mnuDir)
Global $mnuTools = GUICtrlCreateMenu("Tools")
Global $mnuToolsLoadAllInDir = GUICtrlCreateMenuItem("Load all .jpgs in directory", $mnuTools)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
        Exit
    EndSwitch
WEnd


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

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