mIRC Homepage
Posted By: The_Only How to $didtok ? - 13/08/04 10:35 AM
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.
Posted By: Coolkill Re: How to $didtok ? - 13/08/04 11:17 AM
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.
Posted By: The_Only Re: How to $didtok ? - 13/08/04 11:59 AM
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?
Posted By: Coolkill Re: How to $didtok ? - 13/08/04 12:23 PM
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.
Posted By: The_Only Re: How to $didtok ? - 13/08/04 12:28 PM
10x. I'll test it.
It works smile 10x. I'm about to use /did instead of /didtok... it's easier and shorter cool
Posted By: Iori Re: How to $didtok ? - 13/08/04 04:13 PM
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 }
  }
}

Posted By: Coolkill Re: How to $didtok ? - 13/08/04 05:17 PM
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.
Posted By: The_Only Re: How to $didtok ? - 14/08/04 09:51 PM
Both these two usages of /didtok work perfectly. I tested them on mIRC v6.15.
Posted By: Iori Re: How to $didtok ? - 15/08/04 06:40 PM
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
© mIRC Discussion Forums