home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Utilities / Programming / Dialog Director 0.6 / Examples / Guage.as < prev    next >
Encoding:
Text File  |  1997-04-14  |  1.3 KB  |  32 lines  |  [TEXT/ToyS]

  1. property theIters : [20, 40, 60, 80, 100, 120, 140, 160]
  2. property theDialog : {style:movable modal, name:"Gauge", size:[300, 125], contents:[¬
  3.     {class:push button, bounds:[10, 95, 90, 115], name:"Forward"}, ¬
  4.     {class:push button, bounds:[110, 95, 190, 115], name:"Backward"}, ¬
  5.     {class:push button, bounds:[210, 95, 290, 115], name:"Done"}, ¬
  6.     {class:pop up, bounds:[10 - 4, 50, 150, 50 + 20], name:"Iterations:", value:1, contents:theIters}, ¬
  7.     {class:gauge, bounds:[10, 10, 290, 10 + 12], value:0, max value:100}, ¬
  8.     {class:gauge, bounds:[10, 30, 290, 30 + 12], value:0, max value:-1} ¬
  9.         ], default:3}
  10.  
  11. dd install font {name:"Geneva", size:10} with greyscale
  12. set dlog to dd make dialog theDialog
  13.  
  14. repeat
  15.     set dClicked to dd interact with user --for max ticks 60
  16.     if dClicked = 3 then exit repeat
  17.     if dClicked = 1 then
  18.         set maxVal to item (dd get value of item 4 of dlog) of theIters
  19.         repeat with i from 1 to maxVal
  20.             dd set value of item 5 of dlog to i
  21.             dd set value of item 6 of dlog to i
  22.         end repeat
  23.     else if dClicked = 2 then
  24.         set maxVal to item (dd get value of item 4 of dlog) of theIters
  25.         repeat with i from maxVal to 0 by -1
  26.             dd set value of item 5 of dlog to i
  27.             dd set value of item 6 of dlog to i
  28.         end repeat
  29.     end if
  30. end repeat
  31. dd delete dlog
  32. dd uninstall