mIRC Home    About    Download    Register    News    Help

Print Thread
#141842 13/02/06 02:11 PM
Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
I'm just learning dialog boxes and am trying to experiment with the different features. I just came across "list" and it looks helpful for a feature I'd like to use, but I don't know how to use it. How do you add things to that list? I got a listbox to appear but can't figure out how to put stuff in it. Can you specify an event for when someone clicks a particular item in that list? Thanks.

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
/did -a <dialog> <id of list> <data> to add things to the list.

on *:dialog:<dialog>:sclick:<id of list>: for sclick events on the list.

Joined: Jan 2003
Posts: 249
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Jan 2003
Posts: 249
/help /did -a

/help on dialog

[/code]

alias test dialog -m blah blah

dialog blah {

title "my test"
size 1 1 200 500
list, 12, 0 0 200 500
}

on *:dialog:blah :*:*: {

if ( $devent == init ) {

did -a $dname 12 item1
did -a $dname 12 item2
}
else if ( $devent == sclick ) {

if ( $did == 12 ) {

echo -s I clicked on list item $did($dname,$did).sel
}
}
}
[code]

Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
Thanks. ClickHere, your code isn't working for me though. It starts the dialog, but there's nothing in it. Not sure why.

Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
I fixed it. It was a spacing error. Is there any way to get it to echo the value of the item I click on? Right now, it only says if I clicked on 1 or 2, but I'd like it to return the name of item1 or item2. Thanks.

Joined: Jan 2003
Posts: 249
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Jan 2003
Posts: 249
$did($dname,$did).seltext

I would really recommend that you read the help file, all this stuff is written literally in it in the Dialog section.

Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
I just figured it out on my own, thanks. I have been reading the help file. I am trying to learn this on my own, not just ask for help without trying.

Joined: May 2005
Posts: 449
Fjord artisan
OP Offline
Fjord artisan
Joined: May 2005
Posts: 449
I have this dialog table
Code:
dialog test {
  title "Blake's Email Program"
  size -1 -1 250 200
  option dbu

  text "To:", 1, 5 10 10 10 
  edit "", 2, 5 18 240 10, %ToAddress
  text "Subject:", 3, 5 33 240 10
  edit "", 4, 5 41 240 10, %Subject
  icon 8, 5 55 240 50, Image018.jpg
  text "Body:", 5, 5 105 20 50
  button "Send", 6, 170 103 20 10, cancel
  edit "", 7, 5 115 240 80,multi,return,autovs %Body
}


I don't understand some of the options. Is there any way to save everything that is typed in an edit box, even if they hit return? I'm referring to the last line of the table, ID 7. I am using a binary variable there and trying to deal with the body of an email. For now, I'm writing it to a file and then calling it back to send. I'd like to be able to save everything, even returns, and possibly loadbuf it to a window, if I can, instead of writing to a file. Is there a way to read from a window into a binary variable. Sorry for so many questions. Thanks.

Joined: Jan 2003
Posts: 249
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Jan 2003
Posts: 249
you can use /savebuf with the close event of the dialog to save all the contents of the edit, and reload it in the init with /loadbuf

using a variable for that part will rapidely exceed mIRC's variable length limit which is only 955 chars


Link Copied to Clipboard