mIRC Home    About    Download    Register    News    Help

Print Thread
Dialog listbox #118408
25/04/05 01:39 PM
25/04/05 01:39 PM
Joined: Apr 2005
Posts: 26
D
DaICeMaN Offline OP
Ameglian cow
DaICeMaN  Offline OP
Ameglian cow
D

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?

Re: Dialog listbox #118409
25/04/05 01:46 PM
25/04/05 01:46 PM
Joined: Dec 2002
Posts: 3,547
Kent, England
S
SladeKraven Offline
Hoopy frood
SladeKraven  Offline
Hoopy frood
S

Joined: Dec 2002
Posts: 3,547
Kent, England
/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).

Re: Dialog listbox #118410
25/04/05 01:59 PM
25/04/05 01:59 PM
Joined: Apr 2005
Posts: 26
D
DaICeMaN Offline OP
Ameglian cow
DaICeMaN  Offline OP
Ameglian cow
D

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

Re: Dialog listbox #118411
25/04/05 02:16 PM
25/04/05 02:16 PM
Joined: Dec 2002
Posts: 3,547
Kent, England
S
SladeKraven Offline
Hoopy frood
SladeKraven  Offline
Hoopy frood
S

Joined: Dec 2002
Posts: 3,547
Kent, England
Hehe. You're welcome. smile

Re: Dialog listbox #118412
25/04/05 04:58 PM
25/04/05 04:58 PM
Joined: Apr 2005
Posts: 26
D
DaICeMaN Offline OP
Ameglian cow
DaICeMaN  Offline OP
Ameglian cow
D

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

Re: Dialog listbox #118413
25/04/05 05:34 PM
25/04/05 05:34 PM
Joined: Dec 2002
Posts: 3,547
Kent, England
S
SladeKraven Offline
Hoopy frood
SladeKraven  Offline
Hoopy frood
S

Joined: Dec 2002
Posts: 3,547
Kent, England
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

Re: Dialog listbox #118414
25/04/05 05:45 PM
25/04/05 05:45 PM
Joined: Apr 2005
Posts: 26
D
DaICeMaN Offline OP
Ameglian cow
DaICeMaN  Offline OP
Ameglian cow
D

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

Re: Dialog listbox #118415
25/04/05 05:45 PM
25/04/05 05:45 PM
Joined: Dec 2002
Posts: 3,547
Kent, England
S
SladeKraven Offline
Hoopy frood
SladeKraven  Offline
Hoopy frood
S

Joined: Dec 2002
Posts: 3,547
Kent, England
You're welcome. smile

Re: Dialog listbox #118416
26/04/05 09:37 AM
26/04/05 09:37 AM
Joined: Mar 2005
Posts: 46
P
Pariah Offline
Ameglian cow
Pariah  Offline
Ameglian cow
P

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.
Re: Dialog listbox #118417
26/04/05 03:35 PM
26/04/05 03:35 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
tidy_trax  Offline
Hoopy frood
T

Joined: Nov 2003
Posts: 2,327
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 }


New username: hixxy
Re: Dialog listbox #118418
27/04/05 12:56 AM
27/04/05 12:56 AM
Joined: Mar 2005
Posts: 46
P
Pariah Offline
Ameglian cow
Pariah  Offline
Ameglian cow
P

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?
Code:
on *:dialog:blah:sclick:3:{ 
  while ($did(blah,1).sel) { did -d blah 1 $v1 | remini my.ini sect $v1 }
}  

Re: Dialog listbox #118419
27/04/05 01:05 AM
27/04/05 01:05 AM
Joined: Dec 2002
Posts: 3,547
Kent, England
S
SladeKraven Offline
Hoopy frood
SladeKraven  Offline
Hoopy frood
S

Joined: Dec 2002
Posts: 3,547
Kent, England
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

Re: Dialog listbox #118420
27/04/05 01:10 AM
27/04/05 01:10 AM
Joined: Mar 2005
Posts: 46
P
Pariah Offline
Ameglian cow
Pariah  Offline
Ameglian cow
P

Joined: Mar 2005
Posts: 46
ahhh so i guess i need to be using multsel, thanks slade smile

Re: Dialog listbox #118421
27/04/05 07:01 AM
27/04/05 07:01 AM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
tidy_trax  Offline
Hoopy frood
T

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
Re: Dialog listbox #118422
29/04/05 11:12 AM
29/04/05 11:12 AM
Joined: Mar 2003
Posts: 612
Aberdeen, Scotland
B
billythekid Offline
Fjord artisan
billythekid  Offline
Fjord artisan
B

Joined: Mar 2003
Posts: 612
Aberdeen, Scotland
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