ChibiCalc

By knoeki on Jul 07, 2009

Just a really really tiny calculator. Usage should (again) be obvious.

Image

Just made as a joke, for fun. ;_)

on *LOAD: {
   echo -a ChibiCalc v1.0, by Knoeki
   echo -a Type /chibicalc to run, or use the menus.
}

dialog chibicalc {
  title "ChibiCalc"
  size -1 -1 56 68
  option dbu
  edit "", 1, 0 1 56 10, right
  button "7", 3, 1 12 12 12
  button "8", 4, 15 12 12 12
  button "9", 5, 29 12 12 12
  button "4", 6, 1 26 12 12
  button "5", 7, 15 26 12 12
  button "6", 8, 29 26 12 12
  button "1", 9, 1 40 12 12
  button "2", 10, 15 40 12 12
  button "3", 11, 29 40 12 12
  button "/", 12, 43 12 12 12
  button "*", 13, 43 26 12 12
  button "-", 14, 43 40 12 12
  button "+", 15, 43 54 12 12
  button "0", 16, 1 54 12 12
  button "Enter", 17, 15 54 26 12
}

alias chibicalc {
   if ($dialog(chibicalc) == $null) {
      dialog -m chibicalc chibicalc
   }
}

on *:DIALOG:chibicalc:sclick:3-16: {
   if (%chibicalc.clear == 1) {
      unset %chibicalc.clear
      did -r $dname 1
   }
   did -a $dname 1 $did($did).text
}

on *:DIALOG:chibicalc:sclick:17: {
   did -o $dname 1 1 $calc($did(1))
   set %chibicalc.clear 1
}

menu status,menubar,channel {
   .-
   .zOWB
   ..ChibiCalc:/chibicalc
}

Comments

Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.