mIRC Homepage
Posted By: Turbo_boy Dialog - 16/09/05 01:27 PM
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.
Posted By: Riamus2 Re: Dialog - 16/09/05 01:37 PM
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.
Posted By: Lpfix5 Re: Dialog - 16/09/05 02:12 PM
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
Posted By: ClickHeRe Re: Dialog - 16/09/05 02:56 PM
you could probably use MDX's positioner control with the noclose option to prevent it from closing.
Posted By: Riamus2 Re: Dialog - 16/09/05 03:30 PM
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
Posted By: Turbo_boy Re: Dialog - 17/09/05 12:31 PM
I was just using the MDX so.

But thanks for the information. It's working fine now.
© mIRC Discussion Forums