mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Mar 2006
Posts: 9
Z
ZippyD Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Z
Joined: Mar 2006
Posts: 9
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?

Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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?


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Joined: Mar 2006
Posts: 9
Z
ZippyD Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Z
Joined: Mar 2006
Posts: 9
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

Last edited by ZippyD; 15/04/08 02:48 AM.
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
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

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
It means what it says... whenever data in the edit box is changed. If it meant after changing focus, it would state that.


Invision Support
#Invision on irc.irchighway.net
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
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

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net
Joined: Mar 2006
Posts: 9
Z
ZippyD Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Z
Joined: Mar 2006
Posts: 9
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


Link Copied to Clipboard