drapdv Posted August 22, 2011 Share Posted August 22, 2011 Hi, I'm working on a GUI with many edit input boxes. This is for a company's information. So one box will have the company's address, the next the city, the next the state, and so on. My issue is, I don't want to have to individually check 20 different inputs to see if one has been modified so the program prompts to save changes. Is there a flag that gets set if ANY input within a GUI has been modified? Something like the $EM_GETMODIFY value but for a whole pack of inputs... Thanks for any input you can provide! David Link to comment Share on other sites More sharing options...
czardas Posted August 22, 2011 Share Posted August 22, 2011 Look for _GUICtrlEdit_GetModify in the help file. Perhaps that's what you are looking for. operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
drapdv Posted August 22, 2011 Author Share Posted August 22, 2011 Look for _GUICtrlEdit_GetModify in the help file. Perhaps that's what you are looking for.Hi czardas,Thank you for the quick reply! That is very close, but that's the function that will check a single edit input for modification. I'm wondering if there is a universal flag that gets set if any input within a GUI (or even entire script for that matter) is changed. Like, when you fire up the GUI to begin with, $GUI_INPUTMODIFY = 0 and then as soon as you modify any of the inputs, $GUI_INPUTMODIFY = 1.Really, even a method of running _GUICtrlEdit_GetModify when moving focus off of an input would do the trick, as I have a Sleep(10) loop that checks for events. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 22, 2011 Moderators Share Posted August 22, 2011 drapdv, if there is a universal flag that gets set if any input within a GUI (or even entire script for that matter) is changedYou need to look for $EN_CHANGE like this: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $aInput[10] $hGUI = GUICreate("Test", 500, 500) For $i = 0 To 9 GUICtrlCreateLabel($i, 10, 10 + (30 * $i), 20, 20) $aInput[$i] = GUICtrlCreateInput("", 30, 10 + (30 * $i), 200, 20) Next GUISetState() GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _WM_COMMAND($hWnd, $Msg, $wParam, $lParam) #forceref $hWnd, $Msg, $lParam Local $cId $cId = BitAND($wParam, 0xFFFF) ;ControlId Switch BitShift($wParam, 16) ;Notification code Case 0x300 ; $EN_CHANGE For $i = 0 To 9 If $cID = $aInput[$i] Then ConsoleWrite("Input " & $i & " changed" & @CRLF) Return EndIf Next EndSwitch EndFunc All clear? 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 Link to comment Share on other sites More sharing options...
czardas Posted August 22, 2011 Share Posted August 22, 2011 (edited) I'm not sure if there is a universal flag, but you could write that part yourself. However there are probably ways to do it that I'm not aware of.EditM23 knows all about this. Edited August 22, 2011 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
drapdv Posted August 22, 2011 Author Share Posted August 22, 2011 Thank you gents, that should do the trick! Appreciate the fast responses! Link to comment Share on other sites More sharing options...
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