home *** CD-ROM | disk | FTP | other *** search
/ Galleria D'arte: Manet / Manet.iso / Dati / Gadgets.dxr / Internal_30_stampacarta.ls < prev    next >
Encoding:
Text File  |  2000-12-21  |  2.8 KB  |  91 lines

  1. global gDoc, gPict
  2.  
  3. on mouseUp me
  4.   tmp = the member of sprite 30
  5.   gPict = member(tmp).name
  6.   if gPict = "dummyauguri" then
  7.     openMessageWindow("E' necessario selezionare un'immagine da stampare sulla carta da lettera", "Galleria d'arte", "Warning")
  8.     exit
  9.   end if
  10.   stampa()
  11. end
  12.  
  13. on stampa
  14.   if checkstampanti() = 1 then
  15.     exit
  16.   end if
  17.   member("stato di stampa").text = EMPTY
  18.   sprite(60).visible = 1
  19.   gDoc = new(xtra("printomatic"))
  20.   if objectp(gDoc) then
  21.     setDocumentName(gDoc, "Carta da lettera - De Agostini")
  22.     setLandscapeMode(gDoc, 0)
  23.     setMargins(gDoc, rect(10, 10, 10, 10))
  24.     setTextFont(gDoc, "arial")
  25.     setTextSize(gDoc, 8)
  26.     if objectp(gDoc) then
  27.       lanciastampa()
  28.     end if
  29.   end if
  30. end
  31.  
  32. on lanciastampa
  33.   cursor(4)
  34.   member("stato di stampa").text = "Formattazione intestazione"
  35.   nc = member("nome").text
  36.   co = member("cognome").text
  37.   via = member("via").text
  38.   cap = member("cap").text
  39.   citta = member("citta").text
  40.   tel = member("telefono").text
  41.   email = member("e-mail").text
  42.   member("intestazione").text = nc && co & RETURN & via & RETURN & cap && "-" && citta & RETURN & "Tel:" && tel & RETURN & "E-Mail:" && email
  43.   if member("intestazione").line[3] = " - " then
  44.     member("intestazione").line[3] = EMPTY
  45.   end if
  46.   if member("intestazione").line[4] = "Tel: " then
  47.     member("intestazione").line[4] = EMPTY
  48.   end if
  49.   if member("intestazione").line[5] = "E-Mail: " then
  50.     member("intestazione").line[5] = EMPTY
  51.   end if
  52.   set the textStyle of line 1 of field "INTESTAZIONE" to "bold"
  53.   tmp = the member of sprite 30
  54.   gPict = member(tmp).name
  55.   put "5" into char 7 of gPict
  56.   newPage(gDoc)
  57.   w = getPageWidth(gDoc)
  58.   h = getPageHeight(gDoc)
  59.   member("stato di stampa").text = "Inserimento immagine"
  60.   newFrame(gDoc, rect(30, 40, 414, 200), 0)
  61.   append(gDoc, member("intestazione"))
  62.   newFrame(gDoc, rect(434, 10, 564, 140), 0)
  63.   drawPicture(gDoc, member(gPict), rect(434, 10, 564, 140))
  64.   newFrame(gDoc, rect(0, 777, 575, 780), 0)
  65.   drawPicture(gDoc, member("linea", "calendario"), rect(0, 777, 575, 780))
  66.   put "4" into char 7 of gPict
  67.   the itemDelimiter = "#"
  68.   repeat with i = 1 to the number of lines in field "titolo#nomefile"
  69.     if item 2 of line i of field "titolo#nomefile" = gPict then
  70.       titquadro = item 1 of line i of field "titolo#nomefile"
  71.       exit repeat
  72.     end if
  73.   end repeat
  74.   nomepittore = the text of field "nomepittore" of castLib "common"
  75.   titquadro = nomepittore & "." && titquadro
  76.   setTextSize(gDoc, 8)
  77.   setTextJust(gDoc, "center")
  78.   drawText(gDoc, titquadro, point(287, 787))
  79.   newFrame(gDoc, rect(10, 400, 30, 600), 0)
  80.   drawPicture(gDoc, member("copyvert", "auguri"), rect(10, 400, 30, 600))
  81.   cursor(-1)
  82.   if doJobSetup(gDoc) = 1 then
  83.     member("stato di stampa").text = "Stampa in corso"
  84.     print(gDoc)
  85.   end if
  86.   member("stato di stampa").text = EMPTY
  87.   sprite(60).visible = 0
  88.   unLoad()
  89.   gDoc = 0
  90. end
  91.