Jump to content

Search the Community

Showing results for tags 'menus'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. I know that I'm doing something basic, and doing it wrong. I just can't seem to figure it out...I am trying to create a dynamic menu that changes when the user switches "modes." This is my code: Func _SetActions($var) $Menu_handle = _GUICtrlMenu_GetMenu($GUI_MF_BIS) _GUICtrlMenu_DeleteMenu($Menu_handle, 3) $New_Acts = _GUICtrlMenu_CreateMenu() Switch $var Case 0 _GUICtrlMenu_InsertMenuItem($New_Acts, 0, "Add", $Menu_Act_Add_Tray) _GUICtrlMenu_InsertMenuItem($New_Acts, 1, "Delete", $Menu_Act_Delete_Tray) _GUICtrlMenu_InsertMenuItem($New_Acts, 2, "Edit", $Menu_Act_Edit_Tray) _GUICtrlMenu_InsertMenuItem($New_Acts, 3, "Move", $Menu_Act_Move_Tray) Case 1 _GUICtrlMenu_InsertMenuItem($New_Acts, 0, "Add", $Menu_Act_Add_Strain) _GUICtrlMenu_InsertMenuItem($New_Acts, 1, "Delete", $Menu_Act_Delete_Strain) _GUICtrlMenu_InsertMenuItem($New_Acts, 2, "Edit", $Menu_Act_Edit_Strain) EndSwitch _GUICtrlMenu_InsertMenuItem($Menu_handle, 3, "Actions", 0, $New_Acts) _GUICtrlMenu_DrawMenuBar($GUI_MF_BIS) EndFunc I call this function with an argument of either 0 or 1. I delete the existing menu and build a new one. This part of the code works just fine, the menu looks the way it's supposed to. However, in the main loop of my program: While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $Menu_File_Exit Exit Case $Menu_Cat_Trays _SetActions(0) Case $Menu_Cat_Strains _SetActions(1) Case $Menu_Act_Add_Strain MsgBox(0,"","Got Menu_Act_Add_Strain") EndSwitch WEnd The "Case $Menu_Act_Add_Strain" fires on every iteration of the loop. What am I doing wrong here? I'm sure it's something simple, but I'm stuck. If there's a better way to do this, I'm all ears. Thanks in advance.
×
×
  • Create New...