Sign in to follow this  
Followers 0
drapdv

Easy question, regarding $EM_GETMODIFY

6 posts in this topic

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

Share this post


Link to post
Share on other sites



Look for _GUICtrlEdit_GetModify in the help file. Perhaps that's what you are looking for.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

drapdv,

if there is a universal flag that gets set if any input within a GUI (or even entire script for that matter) is changed

You need to look for $EN_CHANGE like this: :)

#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? :mellow:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (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.

Edit

M23 knows all about this. :mellow:

Edited by czardas

Share this post


Link to post
Share on other sites

Thank you gents, that should do the trick!

Appreciate the fast responses!

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