mIRC Home    About    Download    Register    News    Help

Print Thread
when is the on dialog: edit event triggered? #197736 13/04/08 06:30 AM
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?

Re: when is the on dialog: edit event triggered? [Re: ZippyD] #197737 13/04/08 06:33 AM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
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"
Re: when is the on dialog: edit event triggered? [Re: argv0] #197846 15/04/08 02:48 AM
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.
Re: when is the on dialog: edit event triggered? [Re: ZippyD] #197847 15/04/08 03:05 AM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
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

Re: when is the on dialog: edit event triggered? [Re: ZippyD] #197851 15/04/08 10:50 AM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
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
Re: when is the on dialog: edit event triggered? [Re: Riamus2] #197855 15/04/08 01:53 PM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
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

Re: when is the on dialog: edit event triggered? [Re: genius_at_work] #197866 15/04/08 09:19 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
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
Re: when is the on dialog: edit event triggered? [Re: genius_at_work] #197981 18/04/08 03:22 AM
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