|
Joined: Apr 2005
Posts: 26
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2005
Posts: 26 |
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?
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
/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).
|
|
|
|
Joined: Apr 2005
Posts: 26
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2005
Posts: 26 |
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
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
Hehe. You're welcome.
|
|
|
|
Joined: Apr 2005
Posts: 26
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2005
Posts: 26 |
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
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
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
|
|
|
|
Joined: Apr 2005
Posts: 26
Ameglian cow
|
OP
Ameglian cow
Joined: Apr 2005
Posts: 26 |
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
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
You're welcome.
|
|
|
|
Joined: Mar 2005
Posts: 46
Ameglian cow
|
Ameglian cow
Joined: Mar 2005
Posts: 46 |
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?
Last edited by Pariah; 26/04/05 09:44 AM.
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
Just specify the extsel style and let mIRC do the selecting for you. As for the deleting: while ($did(<dname>, <id>).selstart) { did -d <name> <id> $v1 }
New username: hixxy
|
|
|
|
Joined: Mar 2005
Posts: 46
Ameglian cow
|
Ameglian cow
Joined: Mar 2005
Posts: 46 |
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? on *:dialog:blah:sclick:3:{
while ($did(blah,1).sel) { did -d blah 1 $v1 | remini my.ini sect $v1 }
}
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
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
|
|
|
|
Joined: Mar 2005
Posts: 46
Ameglian cow
|
Ameglian cow
Joined: Mar 2005
Posts: 46 |
ahhh so i guess i need to be using multsel, thanks slade
|
|
|
|
Joined: Nov 2003
Posts: 2,327
Hoopy frood
|
Hoopy frood
Joined: Nov 2003
Posts: 2,327 |
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)
New username: hixxy
|
|
|
|
Joined: Mar 2003
Posts: 612
Fjord artisan
|
Fjord artisan
Joined: Mar 2003
Posts: 612 |
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
billythekid
|
|
|
|
|