home *** CD-ROM | disk | FTP | other *** search
Wrap
global gDoc, gMese, gAnn, gPict on mouseUp me controllamesi() end on controllamesi elencostampa = [] repeat with i = 31 to 43 tmp = the member of sprite i nome = member(tmp).name if nome <> "dummymesi" then append(elencostampa, i) end if end repeat if count(elencostampa) > 0 then stampa(elencostampa) else openMessageWindow("Prima di stampare è necessario selezionare le immagini da assegnare ad ogni mese." & RETURN & RETURN & "E' possibile stampare anche solo un mese o solo la copertina lasciando vuote le altre caselle.", "Galleria d'arte", "Warning") end if end on stampa elencostampa if checkstampanti() = 1 then exit end if sprite(60).visible = 1 member("stato di stampa").text = "Preparazione per la stampa in corso" gDoc = new(xtra("printomatic")) if objectp(gDoc) then setDocumentName(gDoc, "Calendario" && gAnn && "- De Agostini") setLandscapeMode(gDoc, 0) setMargins(gDoc, rect(10, 10, 10, 10)) setTextFont(gDoc, "arial") setTextSize(gDoc, 8) if objectp(gDoc) then lanciastampa(elencostampa) end if end if end on lanciastampa elencostampa cursor(4) tmp = getOne(elencostampa, 43) if tmp <> 0 then deleteAt(elencostampa, tmp) member("stato di stampa").text = "Formattazione copertina" newPage(gDoc) tmp = the member of sprite 43 gPict = member(tmp, "pict").name put "1" into char 7 of gPict newFrame(gDoc, rect(0, 5, 575, 655), 0) x = getPageWidth(gDoc) y = getPageHeight(gDoc) w = member(gPict, "stampa").width h = member(gPict, "stampa").height if w < h then nuovaW = w * 650 / h puntoX = (x - nuovaW) / 2 puntoY = puntoX + nuovaW drawPicture(gDoc, member("cpyrght", "calendario"), rect(5, 5, 12, 575)) drawPicture(gDoc, member(gPict, "stampa"), rect(puntoX, 5, puntoY, 655)) newFrame(gDoc, rect(puntoX, 655, puntoY, 685), 0) put "4" into char 7 of gPict the itemDelimiter = "#" repeat with i = 1 to the number of lines in field "titolo#nomefile" if item 2 of line i of field "titolo#nomefile" = gPict then titquadro = item 1 of line i of field "titolo#nomefile" exit repeat end if end repeat nomepittore = the text of field "nomepittore" of castLib "common" titquadro = nomepittore & "." && titquadro append(gDoc, titquadro) else nuovaW = x nuovaH = nuovaW * h / w puntoX = (650 - nuovaH) / 2 puntoY = puntoX + nuovaH drawPicture(gDoc, member("cpyrght", "calendario"), rect(5, puntoX, 12, 575)) drawPicture(gDoc, member(gPict, "stampa"), rect(12, puntoX, 560, puntoY)) newFrame(gDoc, rect(12, puntoY, 560, puntoY + 30), 0) put "4" into char 7 of gPict the itemDelimiter = "#" repeat with i = 1 to the number of lines in field "titolo#nomefile" if item 2 of line i of field "titolo#nomefile" = gPict then titquadro = item 1 of line i of field "titolo#nomefile" exit repeat end if end repeat nomepittore = the text of field "nomepittore" of castLib "common" titquadro = nomepittore & "." && titquadro append(gDoc, titquadro) end if newFrame(gDoc, rect(18, 685, 557, 800), 0) anno = string(gAnn) drawPicture(gDoc, member(anno, "calendario"), rect(18, 685, 557, 800)) end if repeat with q = 1 to count(elencostampa) i = getAt(elencostampa, q) newPage(gDoc) tmp = the member of sprite i gPict = member(tmp, "pict").name put "1" into char 7 of gPict case i of 31: mese = "Gen" 32: mese = "Feb" 33: mese = "Mar" 34: mese = "Apr" 35: mese = "Mag" 36: mese = "Giu" 37: mese = "Lug" 38: mese = "Ago" 39: mese = "Set" 40: mese = "Ott" 41: mese = "Nov" 42: mese = "Dic" end case member("stato di stampa").text = "Formattazione mese: " && mese && gAnn newFrame(gDoc, rect(0, 0, 575, 565), 0) x = getPageWidth(gDoc) y = getPageHeight(gDoc) w = member(gPict, "stampa").width h = member(gPict, "stampa").height if w < h then nuovaW = w * 565 / h puntoX = (x - nuovaW) / 2 puntoY = puntoX + nuovaW drawPicture(gDoc, member("cpyrght", "calendario"), rect(5, 5, 12, 575)) drawPicture(gDoc, member(gPict, "stampa"), rect(puntoX, 5, puntoY, 565)) newFrame(gDoc, rect(puntoX, 565, puntoY, 595), 0) put "4" into char 7 of gPict the itemDelimiter = "#" repeat with i = 1 to the number of lines in field "titolo#nomefile" if item 2 of line i of field "titolo#nomefile" = gPict then titquadro = item 1 of line i of field "titolo#nomefile" exit repeat end if end repeat nomepittore = the text of field "nomepittore" of castLib "common" titquadro = nomepittore & "." && titquadro append(gDoc, titquadro) else nuovaW = x nuovaH = nuovaW * h / w puntoX = (565 - nuovaH) / 2 puntoY = puntoX + nuovaH drawPicture(gDoc, member("cpyrght", "calendario"), rect(5, puntoX, 12, 575)) drawPicture(gDoc, member(gPict, "stampa"), rect(12, puntoX, 560, puntoY)) newFrame(gDoc, rect(12, puntoY - 5, 560, puntoY + 25), 0) put "4" into char 7 of gPict the itemDelimiter = "#" repeat with i = 1 to the number of lines in field "titolo#nomefile" if item 2 of line i of field "titolo#nomefile" = gPict then titquadro = item 1 of line i of field "titolo#nomefile" exit repeat end if end repeat nomepittore = the text of field "nomepittore" of castLib "common" titquadro = nomepittore & "." && titquadro append(gDoc, titquadro) end if anno = string(gAnn) newFrame(gDoc, rect(18, 600, 557, 770), 0) cal = mese & anno drawPicture(gDoc, member(cal, "calendario"), rect(18, 600, 557, 770)) end repeat cursor(-1) member("stato di stampa").text = "Impostazioni stampante" if doJobSetup(gDoc) = 1 then member("stato di stampa").text = "Stampa in corso" print(gDoc) end if member("stato di stampa").text = EMPTY sprite(60).visible = 0 unLoad() gDoc = 0 end