mIRC Home    About    Download    Register    News    Help

Print Thread
#273816 21/02/26 10:36 PM
Joined: Jul 2014
Posts: 317
TECO Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Jul 2014
Posts: 317
Hi guys

I've tried several ways but haven't been able to get it to work, but I want the text to be in focus when I open the dialog box

Code
alias focus { dialog -m focus focus }

dialog focus {
  title "Dialog focus the text"
  icon $mircexe,0
  option pixels
  size -1 -1 306 76
  edit "", 1, 8 12 290 21, autohs
  button "&OK", 2, 142 43 76 23, ok default
  button "&Cancel", 3, 223 43 76 23, cancel
}
on *:dialog:focus:*:*:{
  if ($devent == init) { did -a $dname 1 Focus the text }
}

When you open the dialog, it shows this:

[Linked Image from i.ibb.co]

And I intend that when it opens, it appear like this:

[Linked Image from i.ibb.co]

I already tried using did -f but it still didn't work.

I would appreciate it if someone could find the solution wink


TECO
irc.PTirc.org (Co-Admin)
Joined: Jan 2012
Posts: 382
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Jan 2012
Posts: 382
To select text can use the command: /did -c dname id [n] [start end]

Try this solution:
Code
alias focus { dialog -m focus focus }

dialog focus {
  title "Dialog focus the text"
  icon $mircexe,0
  option pixels
  size -1 -1 306 76
  edit "", 1, 8 12 290 21, autohs
  button "&OK", 2, 142 43 76 23, ok default
  button "&Cancel", 3, 223 43 76 23, cancel
}
on *:dialog:focus:*:*:{
  if ($devent == init) {
    did -a $dname 1 Focus the text
    did -c $dname 1 1 1 $did($dname,1).len
  }
}

Screenshot:

     [Linked Image from i.ibb.co]


🌐 https://forum.epicnet.ru 📜 irc.epicnet.ru 6667 #Code | mIRC scripts, help, discuss, examples
Joined: Jul 2014
Posts: 317
TECO Offline OP
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Jul 2014
Posts: 317
Thank you for your help.

Here is the result of what I wanted:

[Linked Image from i.ibb.co]

Hug wink


TECO
irc.PTirc.org (Co-Admin)

Link Copied to Clipboard