mIRC Homepage
Posted By: Aenei Populating dropdown combo boxes. - 23/12/05 08:34 PM
I have 2 combo boxes, and on init of the dialog the first has the active server connections loaded into it. The second should then load the channel and message windows open on that server into it; and on selection of a different network reloads the window list.

Only problem is it is not resizing the drop of the dropdown. So either I have values cut off the bottom or else I have a large empty space. Any suggestions anyone? The code which is loading the window list is:
Code:
    var %i = 1 | var %i.max = $calc($chan(0) + $query(0))
    scid $did($dname,116).sel
    did -r $dname 117
    while ( %i <= %i.max ) {
      did -i $dname 117 %i $iif($chan(%i),$chan(%i),$query($calc( %i - $chan(0) )))
      inc %i
    }
Posted By: MikeChat Re: Populating dropdown combo boxes. - 23/12/05 11:05 PM
try this
Code:
alias combotest dialog -m combotest combotest
dialog ComboTest {
  title "Combo Box Test"
  size -1 -1 100 60
  option dbu
  combo 100, 5 5 90 50, drop sort
  combo 200, 5 20 90 50, drop sort
  button "Update", 900, 25 40 50 10
} 
on *:dialog:combotest:init:0:{
  var %i = 1
  var %tokens = *.mrc *.ini *.txt
  while (%i <= 3) {
    did -a combotest 100 $gettok(%tokens,%i,32)
    inc %i
  }
  did -c combotest 100 1
  var %item = $did(combotest,100,0).text
  var %null = $findfile($mircdir,%item,0,did -a combotest 200 $nopath($1-))
  did -c combotest 200 1
}
on *:dialog:combotest:sclick:900:{
  did -r combotest 200
  var %item = $did(combotest,100,0).text
  var %null = $findfile($mircdir,%item,0,did -a combotest 200 $nopath($1-))
  did -c combotest 200 1
}


this just shows combo boxes, and I think you used -i "insert" rather than -a "add"
I don't know if thats causing your size issue but try the -a and see
Posted By: Aenei Re: Populating dropdown combo boxes. - 23/12/05 11:34 PM
Outstanding, -a does what I want it to. Thanks a lot.
© mIRC Discussion Forums