All pastes #767782 Raw Edit

Stuff

public text v1 · immutable
·published 2007-11-10 01:04 UTC
rendered paste body


on *:load: { 
  echo 12 -a You Have Just Loaded Abiotic Soul's Calculator 
}
menu * { 
  .Calc { c } 
} 
alias c { 
  dialog $iif($dialog(c),-v,-md) c c  
} 
Dialog c { 
  title "Calculator" 
  size -1 -1 105 100 
  option dbu 
  text "Made by Abiotic Soul" 1, 58 45 60 10 
  box "Calculator", 2, 1 1 103 97 
  edit "", 3, 20 11 76 10 
  text "Calc:", 5, 4 12 15 90, center 
  button "Exit", 7, 64 87 35 10, Cancel
  button "Clear", 8, 20 35 21 10, 
  button "7", 9, 9 45 10 10
  button "8", 10, 20 45 10 10
  button "9", 11, 31 45 10 10
  button "/", 12, 42 45 10 10
  button "4", 13, 9 55 10 10
  button "5", 14, 20 55 10 10
  button "6", 15, 31 55 10 10
  button "*", 16, 42 55 10 10
  button "1", 17, 9 65 10 10
  button "2", 18, 20 65 10 10
  button "3", 19, 31 65 10 10
  button "-", 20, 42 65 10 10
  button "0", 21, 9 75 10 10
  button "+", 22, 42 75 10 10
  box "", 23, 5 28 50 60
  button ".", 25, 20 75 10 10
  button "=", 26, 31 75 10 10
  button "^", 27, 42 35 10 10
  button "sq", 28, 9 35 10 10
} 
on *:DIALOG:c:sclick:*: {
  if ($did == 26) { set %sum $calc( $did(3) ) | did -r c 3 |  did -a c 3 %sum }
  if ($did == 8) { did -r c 3 | unset %sum }
  if ($did == 9) { did -a c 3 7 }
  if ($did == 10) { did -a c 3 8 }
  if ($did == 11) { did -a c 3 9 }
  if ($did == 12) { did -a c 3 / }
  if ($did == 13) { did -a c 3 4 }
  if ($did == 14) { did -a c 3 5 }
  if ($did == 15) { did -a c 3 6 }
  if ($did == 16) { did -a c 3 * }
  if ($did == 17) { did -a c 3 1 }
  if ($did == 18) { did -a c 3 2 }
  if ($did == 19) { did -a c 3 3 }
  if ($did == 20) { did -a c 3 - }
  if ($did == 21) { did -a c 3 0 }
  if ($did == 22) { did -a c 3 + }
  if ($did == 25) { did -a c 3 . }
  if ($did == 27) { did -a c 3 ^ }
  if ($did == 28) { set %sum $sqrt( $did(3) ) | did -r c 3 | did -a c 3 %sum 
}