Code:

dialog server_x {
  title "Add Server"
  size -1 -1 139 109
  option dbu
  button "O&K", 1, 4 92 37 12, ok
  box "Server", 2, 1 2 137 105
  button "Add Server", 3, 30 10 37 12
  button "Del Server", 4, 30 24 37 12
  button "Connect to server", 5, 72 61 59 12
  combo 6, 72 10 60 50, sort
}
on *:DIALOG:server_x:init:0: {
  update.server_x
}
alias -l update.server_x {
  did -r server_x 6
  var %temp.count = 0
  :start
  inc %temp.count 
  if ( $gettok(%setup.list,%temp.count,44) != $null ) {
    did -a server_x 6 $gettok(%setup.list,%temp.count,44)
    goto start
  }
}
on *:dialog:server_x:edit:*: {
  if ($did == 6) {
    set %setup.temp.channel $did(6).text
  }
}
on *:dialog:server_x:sclick:*: {
  if ($did == 3) {
    set %setup.list %setup.list $+ %setup.temp.channel $+ ,
    update.server_x
  }
  if ($did == 6) {
    set %setup.channel.selected $did($dname,6,$did(6).sel)
  }
  if ($did == 4) {
    set -u1 %setup.tc %setup.channel.selected $+ ,
    set %setup.list $remove(%setup.list,%setup.tc)
    update.server_x
  }
}


[[Edit added code tags to preserve Collective's indentation. -Hammer]]

Last edited by Hammer; 28/12/02 04:17 PM.