mIRC Homepage
Posted By: DJ_Sol Custom window to mimic $input - 21/10/09 08:54 PM
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?
Posted By: Wims Re: Custom window to mimic $input - 21/10/09 09:17 PM
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

Posted By: DJ_Sol Re: Custom window to mimic $input - 21/10/09 11:09 PM
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?
© mIRC Discussion Forums