mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2014
Posts: 304
TECO Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Jul 2014
Posts: 304
Hi Khaled,

It would be useful to have a condition to define that filling in the edit box is optional.

Code
dialog name {
  title "ChanServ"
  size -1 -1 306 155
  text "Enter the reason for the kick:", 2, 10 12 290 14
  edit "", 3, 8 92 290 22, autohs
  button "&OK", 4, 142 124 76 23, ok
  button "&Cancel", 5, 223 124 76 23, cancel
}

Code
edit        "text", id, x y w h, style  (left, right, center, multi, pass, read, return, hsbar, vsbar, autohs, autovs, limit N, rich)


For example add optional:
(left, right, center, multi, pass, read, return, optional, hsbar, vsbar, autohs, autovs, limit N, rich)

This information appears in the edit box and disappears when text is added.

Example:

edit "", 3, 8 92 290 22, autohs optional

[Linked Image from i.ibb.co]


TECO
irc.PTirc.org (Co-Admin)
Joined: Jan 2012
Posts: 372
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 372
Great idea! But there's one nuance. What if the user wants some other ghost text to be displayed as an input example?

I propose extending the syntax by adding an additional colon-separated parameter (highlighted in red) to fill with ghost text to be displayed when the dialog edit field is empty. Besides, it would be more correct to call the style "ghost" or in this case it is possible to do without it altogether:

     edit "text":"(ghost text)", 3, 8 92 290 22, autohs ghost


Also, it would be possible to add a new switch for the command "did":

     /did -x <name> <id> [ghost text]


🌐 https://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Joined: Jul 2006
Posts: 4,035
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,035
Couple notes.

Your suggestion is great and is an obvious improvement upon the original, too simple, suggestion.
But what you proposed syntactically speaking doesn't work: if you want an optional text for the editbox then you wouldn't be filling AND a ghost text AND the original field for the editbox's text.

The new beta only implements a default (optional) text, which, practically speaking, is quickly limiting, a better implementation which doesn't break the current syntax would be

Quote
edit "", id, x y w h, ... optional
With the optional option and empty value for the text, it would then show the default (optional) as an optional/ghost text.

Quote
edit "custom", id, x y w h, ... optional
Whereas this would then show the custom optional/ghost text "custom"

And we do need a /did switch to get that behavior.




It would also be nice to have an option to get a default value, so basically a text that is selected, which, when in focus, would automatically overwrite itself.
This can't be scripted.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard