mIRC Home    About    Download    Register    News    Help

Print Thread
#4106 30/12/02 06:40 PM
Joined: Dec 2002
Posts: 174
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Dec 2002
Posts: 174
alias phmawaypref { dialog -m phmawaypref phmawaypref }
dialog phmawaypref {
title "PHM Multi Server Away Preferences"
size -1 -1 500 600
icon graphics/icon.ico, index
text "PHM Multi Server Away Preferences", 1, 70 13 200 20,center
button "OK", 2, 230 340 30 20,ok
combo 19, 198 64 63 100, drop tab 400
}

how do i put selections in the combo box ?

i cant find anything in the help about it,
and all im trying to do is put minutes in the away box,

can anyone help?

#4107 30/12/02 06:41 PM
Joined: Dec 2002
Posts: 3,138
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 3,138
/help /did

#4108 30/12/02 06:57 PM
Joined: Dec 2002
Posts: 174
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Dec 2002
Posts: 174
/did -a name <menuid> <newid> <text>.


was the reply i got,
but i honestly cant figure out how to put those numbers into the script so that when you open the dialog
you pull it down it shows the selections.

#4109 31/12/02 12:38 AM
Joined: Dec 2002
Posts: 21
L
Ameglian cow
Offline
Ameglian cow
L
Joined: Dec 2002
Posts: 21
See if this helps any:

on *:dialog:PHMawaypref:init:0: {
.did -a PHMawaypref 19 15
.did -a PHMawaypref 19 30
.did -a PHMawaypref 19 45
.did -a PHMawaypref 19 60
}

Listner


Morals: When the p0rn shop gives you too much change, and you don't keep it.
#4110 31/12/02 01:01 AM
Joined: Dec 2002
Posts: 174
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Dec 2002
Posts: 174
works perfectly
thanks alot,
i couldnt get what i needed off the help files for that and that works the way that it needs to be

thanks alot for your help.

the only question now is

when you pull the menu down it shows the number but the one it starts with is blank,

and another question

when i do the did command for when someone selects say done and selects 15 how would i script that?


like say they click the done button wich is 2
the combo box is 6

how would i script it to add it to a variable if i selected 45?
how would i put a number in there?

Last edited by PHMinistries; 31/12/02 01:04 AM.
#4111 31/12/02 05:27 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
In your init event, you add the data into the combo with did -a $dname 6 data as listner told you. After you have added all the data, you use did -c $dname 6 1 to select the first line as the initial choice. If you have this set into a variable already (such as %did6) and are going to reselect that same value, then you can either check after adding each line to see if that is the line to be selected (as you're adding the lines) or loop through each line after you're done until you find it. Here are both methods; use only one (of course):
Code:
  
;  Method 1 (selecting while adding - useful for a few items)
  
on *:DIALOG:PHMawaypref:init:0:{
  did $+(-,$iif(%did6 == 15,ca,a)) $dname 6 15
  did $+(-,$iif(%did6 == 30,ca,a)) $dname 6 30
  did $+(-,$iif(%did6 == 45,ca,a)) $dname 6 45
  did $+(-,$iif(%did6 == 60,ca,a)) $dname 6 60
  ;  Default to line 1 if no valid value is found
  if (!$did($dname,6,1).sel) did -c $dname 6 1
}
  
;  Method 2 (while loop - more useful when you have a lot of lines to search through to find
;    a matching value.)
  
on *:DIALOG:PHMawaypref:init:0:{
  .did -a  $dname 6 15
  .did -a  $dname 6 30
  .did -a  $dname 6 45
  .did -a  $dname 6 60
  var %i = 1
  while ($did($dname,6,%i).text) {
    if ($ifmatch == %did6) {
      did -c $dname 6 %i
      break
    }
    inc %i
  }
  ;  Default to line 1 if no valid value is found
  if (!$did($dname,6,1).sel) did -c $dname 6 1
}

As for your other question about saving the values when someone selects the Done button, you use the :sclick: dialog event and do whatever saving you need to do.
Code:

on *:DIALOG:PHMawaypref:sclick:2:{
  set %did6 $did($dname,6,1).seltext
}


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Link Copied to Clipboard