mIRC Home    About    Download    Register    News    Help

Print Thread
#118408 25/04/05 01:39 PM
D
DaICeMaN
DaICeMaN
D
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?

#118409 25/04/05 01:46 PM
Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
/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).

#118410 25/04/05 01:59 PM
D
DaICeMaN
DaICeMaN
D
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

#118411 25/04/05 02:16 PM
Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
Hehe. You're welcome. smile

#118412 25/04/05 04:58 PM
D
DaICeMaN
DaICeMaN
D
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

#118413 25/04/05 05:34 PM
Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
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

#118414 25/04/05 05:45 PM
D
DaICeMaN
DaICeMaN
D
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

#118415 25/04/05 05:45 PM
Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
You're welcome. smile

#118416 26/04/05 09:37 AM
P
Pariah
Pariah
P
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.
#118417 26/04/05 03:35 PM
Joined: Nov 2003
Posts: 2,321
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,321
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 }

#118418 27/04/05 12:56 AM
P
Pariah
Pariah
P
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 }
}  

#118419 27/04/05 01:05 AM
Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
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

#118420 27/04/05 01:10 AM
P
Pariah
Pariah
P
ahhh so i guess i need to be using multsel, thanks slade smile

#118421 27/04/05 07:01 AM
Joined: Nov 2003
Posts: 2,321
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,321
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)

#118422 29/04/05 11:12 AM
Joined: Mar 2003
Posts: 612
B
Pan-dimensional mouse
Offline
Pan-dimensional mouse
B
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

Link Copied to Clipboard