home *** CD-ROM | disk | FTP | other *** search
- on mouseUp
- global myXobj
- puppetSound(2, 0)
- set the blend of sprite the clickOn to 60
- updateStage()
- if objectp(myXobj) then
- myXobj(mdispose)
- end if
- if the machineType < 256 then
- openXLib("misc_x Xobj")
- else
- openXLib("misc_x")
- end if
- set myXobj to MISC_X(mnew)
- set text1 to "If you want to print the text or the picture click on PRINT"
- set text2 to "If you want to save the heading and main text to a file then click on SAVE TEXT"
- set CR to numToChar(13)
- set text to text1 & CR & text2
- set answer to myXobj(mAnswer, text, "Print", "Save Text", "Cancel")
- myXobj(mdispose)
- if the machineType < 256 then
- closeXLib("misc_X Xobj")
- else
- closeXLib("misc_x")
- end if
- if answer = "Cancel" then
- exit
- end if
- if answer = "Print" then
- myPrint()
- end if
- if answer = "Save Text" then
- myCopy()
- end if
- set the blend of sprite the clickOn to 100
- updateStage()
- end
-
- on myPrint
- global myXobj, printer
- if objectp(myXobj) then
- myXobj(mdispose)
- end if
- if the machineType < 256 then
- openXLib("misc_x Xobj")
- else
- openXLib("misc_x")
- end if
- set myXobj to MISC_X(mnew)
- set text1 to "You can now print the full screen or only the text."
- set text2 to "Click on the button of your choice."
- set CR to numToChar(13)
- set text to CR & text1 & CR & CR & text2
- set answer to myXobj(mAnswer, text, "Print Screen", "Print Text", "Cancel")
- myXobj(mdispose)
- if the machineType < 256 then
- closeXLib("misc_X Xobj")
- else
- closeXLib("misc_x")
- end if
- if answer = "Cancel" then
- exit
- end if
- if the machineType = 256 then
- openXLib("pmatic.dll")
- set printer to pmatic(mnew)
- if not objectp(printer) then
- alert("There is no currently selected printer. Printing features are disabled.")
- else
- if answer = "Print Screen" then
- printer(mRegister, "10031909-181")
- printer(mReset)
- printer(mNewPage)
- printer(mTextBox, 0, 0, printer(mGetPageWidth), 30, 0)
- printer(mStagePicture)
- printer(mTextBox, 0, 400, printer(mGetPageWidth), printer(mGetPageHeight), 0)
- printer(mSetTextSize, 10)
- printer(mSetTextStyle, "normal")
- if printer(mDoJobSetup) = 1 then
- printer(mPrint)
- end if
- else
- printTextPC()
- end if
- end if
- else
- openXLib("PrintShop XObj")
- set printer to PrintShop(mnew)
- if not objectp(printer) then
- alert("There is no currently selected printer. Printing features are disabled.")
- set the blend of sprite the clickOn to 100
- updateStage()
- exit
- end if
- if answer = "Print Screen" then
- set ok to printer(mDoPageSetup)
- if printer(mDoJobSetup) = 1 then
- updateStage()
- printer(mSetProgressMsg, "Printing Violent Earth in progress. Press 'Command + .' to cancel.")
- printer(mPrint, the picture of cast the castNum of sprite 1)
- end if
- printer(mdispose)
- else
- printText()
- end if
- end if
- end
-
- on printText
- global printer
- set page to the name of cast the castNum of sprite 1
- if (page contains "t0") or (page contains "t1") or (page contains "t2") or (page contains "t3") then
- set num to 8
- else
- set num to 6
- end if
- set pag to char 1 to num of page
- put ".txt" after pag
- set txt to the text of cast pag
- printer(mSetTextFont, "palatino")
- printer(mSetTextSize, 12)
- printer(mSetTextStyle, "normal")
- printer(mSetText, txt)
- printer(mSetProgressMsg, "Printing Violent Earth in progress. Press 'Command + .' to cancel.")
- if printer(mDoJobSetup) = 1 then
- updateStage()
- printer(mPrint)
- end if
- printer(mdispose)
- end
-
- on printTextPC
- global printer
- printer(mRegister, "10031909-181")
- printer(mReset)
- printer(mNewPage)
- printer(mTextBox, 0, 0, printer(mGetPageWidth), 30, 0)
- set page to the name of cast the castNum of sprite 1
- if (page contains "t0") or (page contains "t1") or (page contains "t2") or (page contains "t3") then
- set num to 8
- else
- set num to 6
- end if
- set pag to char 1 to num of page
- put ".txt" after pag
- set txt to the text of cast pag
- printer(mSetTextFont, "arial")
- printer(mSetTextStyle, "normal")
- printer(mSetTextSize, 12)
- printer(mSetMargins, 60, 60, 60, 60)
- set w to printer(mGetPageWidth)
- set h to printer(mGetPageHeight)
- set charsPrinted to 0
- repeat while charsPrinted < the number of chars in txt
- printer(mNewPage)
- printer(mTextBox, 0, 0, w, h, 0)
- set charsPrinted to charsPrinted + printer(mSetText, char charsPrinted + 1 to the number of chars in txt of txt)
- end repeat
- if printer(mDoJobSetup) = 1 then
- updateStage()
- printer(mPrint)
- end if
- printer(mdispose)
- end
-
- on myCopy
- if the machineType = 256 then
- openXLib("fileio.dll")
- end if
- set writeObject to FileIO(mnew, "?write", "Wayland.txt")
- if not objectp(writeObject) then
- set theProblem to string(writeObject)
- if theProblem = -43 then
- exit
- else
- alert("Wayland Error. FileIO object was not made." & RETURN & RETURN & "Error: " & string(theProblem))
- end if
- exit
- end if
- set page to the name of cast the castNum of sprite 1
- if (page contains "t0") or (page contains "t1") or (page contains "t2") or (page contains "t3") then
- set num to 8
- else
- set num to 6
- end if
- set pag to char 1 to num of page
- put ".txt" after pag
- set myText to the text of cast pag
- writeObject(mWriteString, string(myText))
- writeObject(mdispose)
- end
-