mIRC Home    About    Download    Register    News    Help

Print Thread
Dialog #130345 16/09/05 01:27 PM
Joined: Sep 2003
Posts: 84
T
Turbo_boy Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Sep 2003
Posts: 84
How do I trigger the enter button on a dialog?

Could someone help me with this (the dialog does not need to quit)

Just do an command.

Re: Dialog #130346 16/09/05 01:37 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
One method would be to put a hidden button in the dialog and mark the button as default, then when you hit enter, that button is actually clicked. So, you'd use the button's ID in the sclick event.


Invision Support
#Invision on irc.irchighway.net
Re: Dialog #130347 16/09/05 02:12 PM
Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Quote:
How do I trigger the enter button on a dialog?

Could someone help me with this (the dialog does not need to quit)

Just do an command.


in a dialog if a button ends with a ok style like ex:.

button TEXTHERE , ID, x y w h, Ok

when pressing enter in a dialog automatically that button does the event so...

on *:Dialog:Dialogname:sclick:ID: { command here }

when dialog is executed then enter is pressed it will quit the dialog also perform the command im not sure how to use enter without closing the dialog


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Re: Dialog #130348 16/09/05 02:56 PM
Joined: Jan 2003
Posts: 249
C
ClickHeRe Offline
Fjord artisan
Offline
Fjord artisan
C
Joined: Jan 2003
Posts: 249
you could probably use MDX's positioner control with the noclose option to prevent it from closing.

Re: Dialog #130349 16/09/05 03:30 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Or, do like I mentioned laugh

In dialog setup:

button "I'm hidden",100,5 5 5 5,default

In init:

did -h $dname 100

In sclick:

if ($did == 100) {
commands
}


What happens is that any time you hit ENTER, button 100 will be "clicked". Since it is hidden, no one will know it's there except you and anyone looking at the script. By not using "ok" when setting up the button, it will not close the dialog.

Just as a note, if you need to have multiple places to use "enter" and do different things, you can set up more buttons like this and then have your script change the default button based on where you are typing (for example, when using multiple edit boxes).

If anyone needs an example of how to do that, just holler. laugh


Invision Support
#Invision on irc.irchighway.net
Re: Dialog #130350 17/09/05 12:31 PM
Joined: Sep 2003
Posts: 84
T
Turbo_boy Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Sep 2003
Posts: 84
I was just using the MDX so.

But thanks for the information. It's working fine now.