DobraGolonka Posted August 5, 2008 Posted August 5, 2008 I have two GUIs (Main Menu & Import Menu). I can switch from the Main Menu to the Import Menu, and then return back to the Main Menu, but all button functionality seems to be 'lost' upon this return. I can't Exit or Close the window. I have stuck in a few lines of debug here and there, but, the hex codes didn't really mean much to me Can anyone give me any pointers on where I'm going wrong??? And, am I choosing the right approach in using individual functions for each GUI? expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt('MustDeclareVars', 1) Global Const $ScriptName = "TV Episode Import and Update" MainMenu() ; #FUNCTION# ================================================================== ; Name ..........: MainMenu() ;============================================================================== ; Func MainMenu() Local $frmMainMenu, $btnImport, $btnUpdate, $btnExit Local $msg $frmMainMenu = GUICreate($ScriptName & ": Main Menu", 400, 200) $btnImport = GUICtrlCreateButton("Import", 50, 55, 120, 30) $btnUpdate = GUICtrlCreateButton("Update", 230, 55, 120, 30) $btnExit = GUICtrlCreateButton("Exit", 140, 100, 115, 30) GUICtrlSetState ($btnUpdate, $GUI_DISABLE) GUISetState(@SW_SHOW, $frmMainMenu) While 1 $msg = GUIGetMsg(1) Select Case $msg[0] = $btnImport GUISetState(@SW_HIDE, $frmMainMenu) ImportMenu() ; Case $msg[0] = $btnUpdate Case $msg[0] = $btnExit dbg("The value of Variable 1 at this time is " & $msg[0] & " " & $msg[1] & " " & $msg[2]) ExitLoop Case $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $frmMainMenu ExitLoop EndSelect WEnd EndFunc ; #FUNCTION# ================================================================== ; Name ..........: ImportMenu() ;============================================================================== ; Func ImportMenu() Local $frmImportMenu, $radioIMDb, $radioTVRage, $radioTVcom, $radio4, _ $radio5, $cmbSeriesName, $btnSubmit, $btnMainMenu Local $msg $frmImportMenu = GUICreate($ScriptName & ": Import Menu", 400, 200) GUICtrlCreateGroup("Source:", 10, 10, 140, 170) $radioIMDb = GUICtrlCreateRadio("IMDb", 20, 30, 120, 20) $radioTVRage = GUICtrlCreateRadio("TVRage", 20, 60, 120, 20) $radioTVcom = GUICtrlCreateRadio("TV.com", 20, 90, 120, 20) $radio4 = GUICtrlCreateRadio("<TBA>", 20, 120, 130, 20) $radio5 = GUICtrlCreateRadio("<TBA>", 20, 150, 120, 20) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlSetState($radioIMDb, $GUI_CHECKED) GUICtrlSetState ($radio4, $GUI_DISABLE) GUICtrlSetState ($radio5, $GUI_DISABLE) GUICtrlCreateGroup("Series Name:", 160, 10, 230, 90) GUICtrlCreateLabel("Enter a Series Name:", 170, 30) $cmbSeriesName = GUICtrlCreateCombo ("", 170, 60, 210) GUICtrlCreateGroup("", -99, -99, 1, 1) $btnSubmit = GUICtrlCreateButton("Submit", 175, 145, 90, 30) $btnMainMenu = GUICtrlCreateButton("Main Menu", 285, 145, 90, 30) GUISetState(@SW_SHOW, $frmImportMenu) While 1 $msg = GUIGetMsg(1) Select Case $msg[0] = $btnMainMenu GUISetState(@SW_HIDE, $frmImportMenu) MainMenu() Case $msg[0] = $GUI_EVENT_CLOSE And $msg[1] = $frmImportMenu GUISetState(@SW_HIDE, $frmImportMenu) MainMenu() EndSelect WEnd Return EndFunc Func dbg($msg) DllCall("kernel32.dll", "none", "OutputDebugString", "str", $msg) EndFunc Regards DG
BrettF Posted August 5, 2008 Posted August 5, 2008 Hi, Try looking up GUISwitch () in the helpfile. Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
DobraGolonka Posted August 5, 2008 Author Posted August 5, 2008 Hi,Try looking up GUISwitch () in the helpfile.Cheers,Brett - the answers to the hardest problems are always the simplest!Thanks for that speedy response :-)DG
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now