|
|
Joined: Jul 2014
Posts: 304
Pan-dimensional mouse
|
OP
Pan-dimensional mouse
Joined: Jul 2014
Posts: 304 |
Hi Khaled, Thank you for adding my suggestion. However, I'd like to see if this is a bug or the intended behavior. When I have the "optional" condition for the edit box, and if I don't type anything and click OK, it's normal for the identifier $did(name,id) to return the text (optional). Example: ![[Linked Image from i.ibb.co]](https://i.ibb.co/v6LHpNHC/Version.png)
dialog version {
title "Version"
size -1 -1 306 155
edit "Enter the server or nickname:", 1, 10 12 290 60
edit "NOTE: If empty it will query the current server.", 2, 10 71 270 16, disable
edit "", 3, 8 92 290 22, autohs optional
button "&OK", 4, 142 124 76 23, ok
button "&Cancel", 5, 223 124 76 23, cancel
}
on *:dialog:version:{
if ($devent == sclick) && ($did == 4) { .raw version $did(3) }
}
Return: ".raw version (optional)" The only solution I see is to put $remove($did(name,id),(optional)) in the command. Example:
.raw version $remove($did(3),(optional))
TECO irc.PTirc.org (Co-Admin)
|
|
|
|
|
Joined: Dec 2002
Posts: 3,866
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,866 |
Thanks for your bug report. This is a bit more complicated than I anticipated. The (Optional) text has always depended on whether the editbox has focus or not. But in the case of custom dialogs, scripts can modify the content whether the editbox has focus or not. The only way around this that I can think of is that if a script tries to modify the editbox in any way, the (Optional) indicator will be automatically unset. And if a script tries to get the contents, it will return an empty value. This change will be in the next beta.
|
|
|
|
|
Joined: Jul 2014
Posts: 304
Pan-dimensional mouse
|
OP
Pan-dimensional mouse
Joined: Jul 2014
Posts: 304 |
Thanks for your bug report. This is a bit more complicated than I anticipated. The (Optional) text has always depended on whether the editbox has focus or not. But in the case of custom dialogs, scripts can modify the content whether the editbox has focus or not. The only way around this that I can think of is that if a script tries to modify the editbox in any way, the (Optional) indicator will be automatically unset. And if a script tries to get the contents, it will return an empty value. This change will be in the next beta. Hi, In my opinion, when I requested the addition of this condition, it was so that when the edit box is empty, the text (Optional) would appear, and when it is focused and the cursor is present, the text would disappear so that something could be typed. However, if you want to keep the edit box empty, the text (Optional) would still be displayed, but when you click OK, $did(name,id) would not return anything.
TECO irc.PTirc.org (Co-Admin)
|
|
|
|
|
Joined: Dec 2002
Posts: 3,866
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,866 |
Yes, that sounds about right. Let's see how the next beta works out.
|
|
|
|
|