home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Utilities / Programming / Dialog Director 0.6 / Examples / SaveChanges.as < prev    next >
Encoding:
Text File  |  1997-04-08  |  763 b   |  22 lines  |  [TEXT/ToyS]

  1. on SaveChanges(theType, theName)
  2.     set dItems to [¬
  3.         {class:push button, bounds:[330, 80, 390, 100], name:"Save"}, ¬
  4.         {class:push button, bounds:[250, 80, 310, 100], name:"Cancel"}, ¬
  5.         {class:push button, bounds:[68, 80, 158, 100], name:"Don’t Save"}, ¬
  6.         {class:icon, bounds:[13, 10, 45, 42], contents:2}, ¬
  7.         {class:static text, bounds:[68, 10, 390, 58], contents:"Save changes to the " & ¬
  8.             theType & " “" & theName & "” before closing?"}]
  9.     
  10.     set dlog to dd auto dialog {size:[400, 110], contents:dItems} with greyscale
  11.     
  12.     if item 1 of dlog then
  13.         return "Save"
  14.     else if item 2 of dlog then
  15.         return "Cancel"
  16.     else if item 3 of dlog then
  17.         return "Don’t Save"
  18.     end if
  19.     error -128
  20. end SaveChanges
  21.  
  22. SaveChanges("test document", "Dialog Director (data file)")