mIRC Home    About    Download    Register    News    Help

Print Thread
Custom window to mimic $input #216034 21/10/09 08:54 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline OP
Hoopy frood
OP Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Hi, because $input doesn;t handle unicode I decided to make a custom window to act as the input.

I quickly realized that I wouldn't be able to make it act like the input identifier. For instance.

/set %var $input(Enter Text,e,Input)

I can't think of a way I could return the value in the input event of the Input window to this set command, but more importantly to be able to handle any command dynamically.


Anyone have any ideas?

Re: Custom window to mimic $input [Re: DJ_Sol] #216035 21/10/09 09:17 PM
Joined: Jul 2006
Posts: 3,773
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,773
The way to reproduce $input is to use $dialog() to call a dialog table that represent what your $input would looks like.
I don't know if unicode are displayed fine on dialog so this might not solve your problem but that the only way to get the $input behavior.

edit : tried quickly, unicode doesn't show properly


Last edited by Wims; 21/10/09 09:25 PM.

Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Custom window to mimic $input [Re: Wims] #216036 21/10/09 11:09 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline OP
Hoopy frood
OP Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
My question is to reproduce what $input or $?="" does when you use it in a command.

ex:

/set %var $?="Enter Unicode Value"
/set %var $input(Enter Unicode Value,e,Input)

You would need to use the input event for the custom window, but by that time it's too late to return.

I guess you could make switches.

$input(text,-s,variable name)

Code:
alias input_ {
set %sw_ = $2
set %com_ = $3
}
on *:input:@input:{
if (%sw = -s) set $+(%,%com_) $1-
}


But this would require writing a switch for every possible command you would use an input window for.

So any ideas how I could replace the $input dialog with this @input window?