All pastes #677341 Raw Edit

Miscellany

public text v1 · immutable
#677341 ·published 2007-08-31 22:44 UTC
rendered paste body
dialog qc { 
  title "Query Controler" 
  size -1 -1 140 51 
  option dbu 
  edit "", 3, 4 10 132 10, read 
  text "From:", 5, 4 24 14 8 
  edit "", 7, 20 22 116 10, read 
  button "Accept", 1, 5 34 37 12, flat 
  button "Decline", 2, 44 34 37 12, flat 
  box "Query Control", 4, 1 1 138 49 
} 
on *:dialog:qc:sclick:1:{ 
  window -w %qnick 
  msg %qnick 12( $me has accepted your query ) 12
  dialog -x qc 
  window -a %qnick 
  unset %qnick 
} 
on *:dialog:qc:sclick:2:{ 
  close -m %qnick 
  msg %qnick 4(sorry $me has declined your query )4 
  dialog -x qc 
  unset %qnick 
} 
on *:OPEN:?: { 
  if (%query.blocker) { 
    if ($dialog(qc)) { halt } 
    else { 
      %qnick = $nick 
      window -h %qnick 
      msg %qnick $ewrap 14(Please Wait a moment For14 7 $me 7 14to14 7Accept/Decline7 14your query14) 
      dialog -m qc qc 
      did -a qc 7 %qnick 
      did -a qc 3 $1- 
    } 
  } 
} 
alias ewrap { 
  var %msg 
  var %tok = 1 
  var %word 
  while ($gettok($1-,%tok,32) != $null) { 
    %word = $gettok($1-,%tok,32) 
    %msg = %msg $+ $upper($left(%word,1)) $+ $+ $right(%word,-1) 
    inc %tok 
  } 
  return ( $+ %msg $+ ) 
} 
menu * { 
  Query Controler 
  . $+ $iif(%query.blocker on) $+ : $iif(%query.blocker,unset %query.blocker,set %query.blocker on)) 
}