home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-04-11 | 1.5 KB | 36 lines | [TEXT/ToyS] |
- property calcDialog : {size:[250, 176], name:"Calculate Total", style:movable modal, contents:[¬
- {class:push button, name:"Done", bounds:[180, 115, 240, 135]}, ¬
- {class:push button, name:"Calc.", bounds:[180, 146, 240, 166]}, ¬
- {class:static text, contents:"", bounds:[60, 150, 155, 166]}, ¬
- {class:text field, name:"1995", bounds:[60, 25, 155, 41], value:100, name bounds:[10, 24, 50, 40]}, ¬
- {class:text field, name:"1996", bounds:[60, 50, 155, 66], value:200, name bounds:[10, 50, 50, 66]}, ¬
- {class:text field, name:"1997", bounds:[60, 75, 155, 91], value:300, name bounds:[10, 76, 50, 92]}, ¬
- {class:text field, name:"1998", bounds:[60, 100, 155, 116], value:400, name bounds:[10, 102, 50, 118]}, ¬
- {class:text field, name:"1999", bounds:[60, 125, 155, 141], value:500, name bounds:[10, 128, 50, 144]}, ¬
- {class:static text, contents:"Year", bounds:[10, 4, 50, 20]}, ¬
- {class:static text, contents:"Amount", bounds:[60, 4, 200, 20]}, ¬
- {class:static text, contents:"Total", bounds:[10, 150, 50, 166]}, ¬
- {class:group box, bounds:[60, 148, 155, 149]}, ¬
- {class:group box, bounds:[60, 166, 155, 166]} ¬
- ], default:2}
-
- dd install with greyscale
- set d to dd make dialog calcDialog
- DoCalc(d)
- repeat
- set i to dd interact with user
- if i = 1 then exit repeat
- if i = 2 then DoCalc(d)
- end repeat
- dd uninstall
-
- on DoCalc(d)
- set tot to 0
- repeat with i from 4 to 8
- try
- set tot to tot + (dd get value of item i of d) as number
- on error
- end try
- end repeat
- dd set contents of item 3 of d to tot
- end DoCalc