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

  1. property fontSizes : [9, 10, 12, 14, 18, 24, 36, 48]
  2. property fontDlog : {size:[260, 230], contents:[¬
  3.     {class:push button, bounds:[190, 200, 250, 220], name:"OK"}, ¬
  4.     {class:push button, bounds:[110, 200, 170, 220], name:"Cancel"}, ¬
  5.     {class:pop up, name:"Font:", bounds:[7, 10, 250, 30], contents:"FONT"}, ¬
  6.     {class:pop up, name:"Size: ", bounds:[7, 35, 150, 55], contents:fontSizes}, ¬
  7.     {class:static text, bounds:[10, 60, 50, 76], contents:"Style:"}, ¬
  8.     {class:check box, name:"Plain", bounds:[60, 60, 150, 76], value:true}, ¬
  9.     {class:check box, name:"Bold", bounds:[60, 76, 150, 92], enabled:-6}, ¬
  10.     {class:check box, name:"Italic", bounds:[60, 92, 150, 108], enabled:-6}, ¬
  11.     {class:check box, name:"Underline", bounds:[60, 108, 150, 124], enabled:-6}, ¬
  12.     {class:check box, name:"Outline", bounds:[60, 124, 150, 140], enabled:-6}, ¬
  13.     {class:check box, name:"Shadow", bounds:[60, 140, 150, 156], enabled:-6}, ¬
  14.     {class:check box, name:"Condensed", bounds:[60, 156, 150, 172], enabled:-6}, ¬
  15.     {class:check box, name:"Extended", bounds:[60, 172, 150, 188], enabled:-6} ¬
  16.         ], style:movable modal, name:"Font"} --, font:{name:"Truth"}}
  17.  
  18. on GetFontSpec()
  19.     set f to dd auto dialog fontDlog --with greyscale
  20.     tell f
  21.         set styl to []
  22.         if not item 6 then
  23.             if item 7 then set styl to styl & bold
  24.             if item 8 then set styl to styl & italic
  25.             if item 9 then set styl to styl & underline
  26.             if item 10 then set styl to styl & outline
  27.             if item 11 then set styl to styl & shadow
  28.             if item 12 then set styl to styl & condensed
  29.             if item 13 then set styl to styl & expanded
  30.         end if
  31.         if styl = [] then
  32.             set styl to plain
  33.         else if length of styl = 1 then
  34.             set styl to item 1 of styl
  35.         end if
  36.         return {name:item 3, size:fontSizes's item (item 4), style:styl}
  37.     end tell
  38. end GetFontSpec
  39.  
  40. GetFontSpec()