TheAutomator Posted January 31, 2015 Posted January 31, 2015 (edited) Hi everyone, Does anyone know why the ESC button doesn't close my form in the second loop? #include <GUIConstantsEx.au3> GUICreate('test', 600, 400, -1, -1) $BTN = GUICtrlCreateButton("Press", 10, 10, 80, 30) GUISetState(@SW_SHOW) While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $BTN ExitLoop EndSwitch WEnd ConsoleWrite("Second Loop" & @CRLF) GUICtrlDelete($BTN) While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ;just hear the 'ding' sound if i press ESC... Exit EndSwitch WEnd Regards TheAutomator. Edited January 31, 2015 by TheAutomator Retro Console, NestedArrayDisplay UDF foldermaker-pro-clone MiniMark Editor
Moderators Melba23 Posted January 31, 2015 Moderators Posted January 31, 2015 TheAutomator,If I add a button and show the GUI it works for me: #include <GUIConstantsEx.au3> GUICreate('test', 600, 400, -1, -1) $BTN = GUICtrlCreateButton("Press", 10, 10, 80, 30) GUISetState() While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $BTN ExitLoop EndSwitch WEnd ConsoleWrite("Second Loop" & @CRLF) While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ;just hear the 'ding' sound if i press ESC... Exit EndSwitch WEndM23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
TheAutomator Posted January 31, 2015 Author Posted January 31, 2015 TheAutomator, If I add a button and show the GUI it works for me: #include <GUIConstantsEx.au3> GUICreate('test', 600, 400, -1, -1) $BTN = GUICtrlCreateButton("Press", 10, 10, 80, 30) GUISetState() While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $BTN ExitLoop EndSwitch WEnd ConsoleWrite("Second Loop" & @CRLF) While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ;just hear the 'ding' sound if i press ESC... Exit EndSwitch WEnd M23 sorry, forgot a part of the code, I've edited my question. now try it again, it won't work now.. Regards Retro Console, NestedArrayDisplay UDF foldermaker-pro-clone MiniMark Editor
Moderators Melba23 Posted January 31, 2015 Moderators Posted January 31, 2015 TheAutomator,Interesting - it appears that you need to have an actionable control in the GUI for ESC to close it. I will investigate further. M23 TheAutomator 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
TheAutomator Posted January 31, 2015 Author Posted January 31, 2015 TheAutomator, Interesting - it appears that you need to have an actionable control in the GUI for ESC to close it. I will investigate further. M23 Ok, thanks Melba23, I hope its not a bug Retro Console, NestedArrayDisplay UDF foldermaker-pro-clone MiniMark Editor
Moderators Melba23 Posted January 31, 2015 Moderators Posted January 31, 2015 (edited) TheAutomator,Well, if it is then it is one that has not been found for a very long time. Anyway, I doubt it is very common to delete the only actionable control in a GUI and then expect to close it using [ESC}, so I do not see it as a terrible serious one. M23 Edited January 31, 2015 by Melba23 Typo Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Moderators Melba23 Posted February 2, 2015 Moderators Posted February 2, 2015 TheAutomator,After a lot of experimentation, it has been noticed that if the GUI loses focus and then regains it the "close on {ESCAPE} key" option starts working again. So if you want to open a Trac ticket be my guest - but personally I regard the likelihood of a GUI losing all its actionable controls and then expecting to close on {ESCAPE) such a rare occurrence that fixing it would not get a very high priority. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
TheAutomator Posted February 2, 2015 Author Posted February 2, 2015 Melba23, Ok so it's nothing serious, that's a good thing So if you want to open a Trac ticket be my guest - but personally I regard the likelihood of a GUI losing all its actionable controls.... So no Trac ticket then? Regards TheAutomator Retro Console, NestedArrayDisplay UDF foldermaker-pro-clone MiniMark Editor
Moderators Melba23 Posted February 2, 2015 Moderators Posted February 2, 2015 TheAutomator,So no Trac ticket then?As I said, only if you want to open one yourself. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
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