mIRC Home    About    Download    Register    News    Help

Print Thread
How to $didtok ? #93992 13/08/04 10:35 AM
Joined: Aug 2004
Posts: 42
T
The_Only Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Aug 2004
Posts: 42
I've got a dialog window, and I put a combo box in it with a dropdown style, but I don't know how to make the "$deven = init" for a combo box and I do not know how to insert the contents of it in it. I also read the help file of mIRC for $didtok but I didn't understand how to use it... This is my first combo box. I usually use other things instead... Help pls.

Re: How to $didtok ? #93993 13/08/04 11:17 AM
Joined: Dec 2002
Posts: 788
C
Coolkill Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
To Insert values into a combo box, you use /did -a [color:red]dialogname idnumber content[/color].

For Example, This is our dialog (it all goes in the remotes).

dialog test {
title "mIRC"
size -1 -1 110 100
option dbu
combo 1,1 1 100 50, drop
}

And this makes the combo box fill when the dialog opens.

On *:Dialog:test:init:*:{
did -a test 1 This is A
did -a test 1 This is B
did -a test 1 This is C
did -a test 1 This is D
did -a test 1 This is E
}


Syntax to run the dialog, /dialog -m test test

Also note if you dont want a 'drop' down type of combo box, remove the , drop from above.

And to get the values OUT of the dialog combo box.

//echo -> $did(test,1,2)

Where, 'test' is the dialog name '1' is the combo box id, and '2' is the line you want to return.

Edit; However, if you want to use /didtok, You are very welcome to do so..

The sytax: /didtok dialogname idnumber delimiter text

In the above, its straight forward except maybe delimiter which is the ascii number of the COMMON character that you want to seperate the items in your dialog for example: A,B,C are seperated by a comma, which is ascii number, 44.

An Example:

dialog test {
title "mIRC"
size -1 -1 110 100
option dbu
combo 1,1 1 100 50, drop
}

And this makes the combo box fill when the dialog opens.

On *:Dialog:test:init:*:{
didtok test 1 44 This is A
didtok test 1 44 This is B
didtok test 1 44 This is C
didtok test 1 44 This is D
didtok test 1 44 This is E
}


Then type, //echo -> $didtok(test,1,44) it will output all your data seperated by the commas, note 'test' is the dialog name '1' is the id of the combo and 44 the delimiter.

Hope this helps.

Eamonn.

Re: How to $didtok ? #93994 13/08/04 11:59 AM
Joined: Aug 2004
Posts: 42
T
The_Only Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Aug 2004
Posts: 42
I'll test it. Thanks again smile

Only one question about that. I did this:

on *:dialog:dropdown:*:*: {
if $devent = init {
didtok dropdown 1 44 This is A
didtok dropdown 1 44 This is B
didtok dropdown 1 44 This is C
didtok dropdown 1 44 This is D
didtok dropdown 1 44 This is E
}
if $devent = sclick {
if $did == 1 {
set %dropChoice $did(1)
}
}
}

Now how to make the combo box to display the choice stored into the variable the next time I open the dialog window?

Last edited by The_Only; 13/08/04 12:21 PM.
Re: How to $didtok ? #93995 13/08/04 12:23 PM
Joined: Dec 2002
Posts: 788
C
Coolkill Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
You store $did(1).sel in a seperate variable as that tells you the LINE that was selected, not the text on the line, and then use /did -c on init..

on *:dialog:dropdown:*:*: {
if ($devent = init) {
didtok dropdown 1 44 This is A
didtok dropdown 1 44 This is B
didtok dropdown 1 44 This is C
didtok dropdown 1 44 This is D
didtok dropdown 1 44 This is E
if (%dropChoice.n) { did -c dropdown 1 $ifmatch }
}
if ($devent = sclick) {
if ($did == 1) {
set %dropChoice $did(1)
set %dropChoice.n $did(1).sel
}
}
}

Eamonn.

Re: How to $didtok ? #93996 13/08/04 12:28 PM
Joined: Aug 2004
Posts: 42
T
The_Only Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Aug 2004
Posts: 42
10x. I'll test it.
It works smile 10x. I'm about to use /did instead of /didtok... it's easier and shorter cool

Last edited by The_Only; 13/08/04 12:35 PM.
Re: How to $didtok ? #93997 13/08/04 04:13 PM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
The above usage of /didtok isn't right...:)
Code:
on *:dialog:dropdown:*:*: {
  if $devent = init {
[color:blue]    didtok dropdown 1 44 This is A,This is B,This is C,This is D,This is E[/color]
    if %dropChoice.n { did -c dropdown 1 $v1 }
  }
  if $devent = sclick {
    if $did == 1 { set %dropChoice $did(1) | set %dropChoice.n $did(1).sel }
  }
}


Re: How to $didtok ? #93998 13/08/04 05:17 PM
Joined: Dec 2002
Posts: 788
C
Coolkill Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
The above^ usage is perfectly valid and to the point that he required it, using /didtok dialog id 44 text,text,text would only further confuse if he was to use a , in his text.

Hence why i specifically did it the above way, furthermore, it cannot be deemed "wrong" if it works.

Eamonn.

Re: How to $didtok ? #93999 14/08/04 09:51 PM
Joined: Aug 2004
Posts: 42
T
The_Only Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Aug 2004
Posts: 42
Both these two usages of /didtok work perfectly. I tested them on mIRC v6.15.

Re: How to $didtok ? #94000 15/08/04 06:40 PM
Joined: Aug 2003
Posts: 1,831
I
Iori Offline
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Quote:
using /didtok dialog id 44 text,text,text would only further confuse if he was to use a , in his text.
Quote:
didtok dropdown 1 44 This is A
That was your own example. grin