rendered paste bodymenu * {
Calculator
..Version V.12: dialog -m Calc Calc
}
dialog Calc {
title "Calculator Dialog"
size -1 -1 171 94
option dbu
box "Calculator", 3, 100 2 65 87
edit "", 4, 103 10 59 10, read autohs
button "+", 5, 103 74 14 12
button "-", 6, 118 74 14 12
button "/", 7, 133 74 14 12
button "x", 8, 148 74 14 12
button "6", 9, 103 48 14 12
button "7", 10, 118 48 14 12
button "8", 11, 133 48 14 12
button "9", 12, 148 48 14 12
button "2", 13, 103 35 14 12
button "3", 14, 118 35 14 12
button "4", 15, 133 35 14 12
button "5", 16, 148 35 14 12
button "0", 17, 103 22 14 12
button "1", 18, 118 22 14 12
button "=", 19, 103 61 14 12
button "CE", 20, 118 61 14 12
edit "", 21, 132 61 15 12
edit "calculator", 22, 132 22 30 12, read
box "Last Calculations", 23, 2 1 96 87
list 24, 4 7 91 77, size
button "ADD", 30, 148 61 14 12
}
on *:DIALOG:Calc:sclick:*: {
if ($regex($did,/^(5|6|7|8|9|10|11|12|13|14|15|16|17|18|20)/Si)) { did -a Calc 4 $did($did) }
if ($regex($did,/^30/Si)) { did -a Calc 4 $did(21) }
if ($regex($did,/^20/Si)) { did -r Calc 4 }
if ($regex($did,/^19/Si)) { did -a Calc 24 $did(4) = $calc($did(4)) | did -ra Calc 4 $calc($did(4)) }
}