mIRC Homepage
Posted By: DaICeMaN Dialog listbox - 25/04/05 01:39 PM
ok this time i looked through the help file pretty good
is there a way to select a line in a dialog listbox like the /sline command for custom windows?
Posted By: SladeKraven Re: Dialog listbox - 25/04/05 01:46 PM
/did -c <Dialog> <Listbox ID> <Line Number>

Example:

/did -c my_dialog 1 3

Would select the 3rd line in the listbox control within the dialog (my_dialog).
Posted By: DaICeMaN Re: Dialog listbox - 25/04/05 01:59 PM
thanks again
i missed the list/ part in the hep file line
-c check checkbox/radiobutton list/combo line
ill look closer next time :P
Posted By: SladeKraven Re: Dialog listbox - 25/04/05 02:16 PM
Hehe. You're welcome. smile
Posted By: DaICeMaN Re: Dialog listbox - 25/04/05 04:58 PM
one more question about listboxes in dialogs
i seem to be having trouble with the
$didwm(name,id,wildtext,N)
and
$didreg(name,id,regex,N)
identifiers could you give me a example of the right way to use them because i seem to be retarded :P

or r those for use with comboboxes ?
if so is there a way to search a listbox
Posted By: SladeKraven Re: Dialog listbox - 25/04/05 05:34 PM
They do work with listbox control yes. I'm afraid I won't be able to help you with $didreg() because I know nothing on Regular Expressions. Sorry!

$didwm()

Supposing you have a dialog, with a combo/listbox with ID 6.
And in our combo/listbox we have 5 entries.

[*]did -a my_dialog 6 This
[*]did -a my_dialog 6 is
[*]did -a my_dialog 6 a
[*]did -a my_dialog 6 test
[*]did -a my_dialog 6 dialog

$didwm(my_dialog,6,*test*,0)

Would return 4. Since it matches line 4 of your control.

$did(my_dialog,6,$didwm(my_dialog,6,*test*,1)).text

Would return the text of the line which was selected, in this case it'd just return test.

Which is equivalent in returning $did(my_dialog,6,<line numbe>). In our case $did(my_dialog,6,4).

$didreg()

I'd imagine this would work the same with Regular Expressions and not Wildcard Match.

If you know Regex fairly well then using these examples above you should know whatto do from there.

-Andy
Posted By: DaICeMaN Re: Dialog listbox - 25/04/05 05:45 PM
well i guess it would help to use the wildcard symbol * when doing a wildcard expresion search aye that would explain why it wasnt workin :P thanks
Posted By: SladeKraven Re: Dialog listbox - 25/04/05 05:45 PM
You're welcome. smile
Posted By: Pariah Re: Dialog listbox - 26/04/05 09:37 AM
Is there a way to use use the $mouse.key identifier with a dialog listbox? Say like ($mouse.key & 2) for ctrl + click. If so how could I go about storing each selected lines numbers in seperate vars (I'm really unsure about that) and in turn delete all the selected lines?
Posted By: tidy_trax Re: Dialog listbox - 26/04/05 03:35 PM
Just specify the extsel style and let mIRC do the selecting for you.
As for the deleting:

Code:
while ($did(&lt;dname&gt;, &lt;id&gt;).selstart) { did -d &lt;name&gt; &lt;id&gt; $v1 }
Posted By: Pariah Re: Dialog listbox - 27/04/05 12:56 AM
thanks tidy_trax, that works like a charm, i do have a couple other questions. first, whats the difference between the multsel and extsel options for the listbox? and second, how can i go about removing the items from an ini?
Code:
on *:dialog:blah:sclick:3:{ 
  while ($did(blah,1).sel) { did -d blah 1 $v1 | remini my.ini sect $v1 }
}  
Posted By: SladeKraven Re: Dialog listbox - 27/04/05 01:05 AM
The difference is that in multsel you can click as many items as you want where as extsel you can't you need to click an item and drag it down to another. If you get what I mean hehe.

-Andy
Posted By: Pariah Re: Dialog listbox - 27/04/05 01:10 AM
ahhh so i guess i need to be using multsel, thanks slade smile
Posted By: tidy_trax Re: Dialog listbox - 27/04/05 07:01 AM
The easiest way to explain multsel is that each line acts like a checkbox (if a line isn't selected then it will be selected, otherwise it will be unselected)
Posted By: billythekid Re: Dialog listbox - 29/04/05 11:12 AM
with extsel you can stil hold ctrl and select multiple lines i.e lines 1 3 6 7 9 can be selected and

while ( $did(name,id).sel ) {
did -d name id $v1
}

will still work great.

I dont know how long i was making loops checking lines were selected and decrementing the loop etc until i stumbled across similar code to this, talk about doing things the long way...


btk
© mIRC Discussion Forums