mIRC Homepage
Posted By: ZippyD when is the on dialog: edit event triggered? - 13/04/08 06:30 AM
Does the on *:dialog:name:edit:*: {...} event get triggered when any changes are made to the editbox or just when the user leaves the edit box to some other control or does a button have to be pressed and in that case do both the sclick event for that button and the edit event for that editbox both trigger?
Did you look at the help file? It says:

Originally Posted By: mirc.hlp
edit text in editbox or combo box changed.


Does that answer your question?
Not really because that can mean as soon as a change is made to the edit box or once the changes are completed and another control recieves focus or a button ic clicked. That is my question. Is the event triggered as soon as a single change is made i.e. character deleted.
ZippyD
Code:
alias testdialog { dialog $iif($dialog(test),-x,-m) test test }

dialog -l test {
  title "test on your own :)"
  size -1 -1 80 32
  option dbu
  edit "", 1, 5 5 70 10, autohs
  button "button", 2, 6 18 40 10
  check "check", 3, 50 18 25 10, 3state
}

on *:dialog:test:*:*: {
  if ($devent != mouse) { echo -tsnc info event $qt($devent) in dialog $qt($dname) at ID $did }
}

start it with /testdialog
...and have an eye on your status window smile
It means what it says... whenever data in the edit box is changed. If it meant after changing focus, it would state that.
It's easy for this to be confusing, especially if the OP has ever done coding with Javascript and HTML forms. The onChange event only activates once focus moves away from the editbox. mIRC's dialog edit event works like the Javascript onKeyDown event.

-genius_at_work
Well, I'd say just to read mIRC's help the way it is written then. I did look up Javascript's definition of onChange and that definition is, imo, incorrect. It also states when the contents are changed. That's not really accurate. At least mIRC's description is accurate... this time, anyhow. Point taken, though.
Thank you Genius_at_work That is the answer I was looking for. I have done some work in Javascript in school but when I read the description in the mIRC help file it didn't seem clear to me when the event was triggered. The test dialog solved that problem but your explanation made it clear how it functions.
Thanks again.

ZippyD
© mIRC Discussion Forums