home *** CD-ROM | disk | FTP | other *** search
- /*
- ** SaveToPREFPRINTER.fred.pre
- **
- ** $VER: SaveToPREFPRINTER.fred.pre 1.3.0 (31.10.93)
- **
- ** If the SaveToPREFPRINTER.fred script appears in the InvokeADPro list,
- ** this program will ask the user to enter the print parameters.
- ** These parameters will be stuffed into REXX clips.
- **
- ** If they fail to answer, the InvokeADPro list will be aborted.
- **
- ** Clips Exported:
- ** FREDPREFPRINTERUseDefaults - ~0 to use current settings
- ** 0 to specify new settings
- ** FREDPREFPRINTEROrientation - Orientation of print
- ** FREDPREFPRINTERDither - Dither method to use
- ** FREDPREFPRINTERMaskSize - Dither mask size
- ** FREDPREFPRINTERDensity - Density
- ** FREDPREFPRINTERPrintWidth - Print Width
- ** FREDPREFPRINTERPrintHeight - Print Height
- ** FREDPREFPRINTERPrintLeft - Print Left Offset
- ** FREDPREFPRINTERPrintTop - Print Top Offset
- ** FREDPREFPRINTERPageWidth - Page Width
- ** FREDPREFPRINTERPageHeight - Page Height
- ** FREDPREFPRINTERPageLeft - Page Left Margin
- ** FREDPREFPRINTERPageTop - Page Top Margin
- ** FREDPREFPRINTERPaperHeight - Paper Height
- **
- ** NOTE: Clip names are case sensitive.
- **
- ** This script requires FRED v1.4.0 (or higher) to run. Also required is
- ** ADPro v2.5.0 (or higher).
- **
- ** Copyright © 1992-1993 ASDG, Incorporated
- ** All Rights Reserved
- */
-
-
- ADDRESS "ADPro"
- OPTIONS RESULTS
-
- PARSE ARG NumberOfCells NumberOfFrames
-
- NL = '0A'X
- SQ = '27'X
- DQ = '22'X
- TRUE = 1
- FALSE = 0
-
-
- /*
- ** Ask the user if the current settings are adequate.
- */
-
- ADPRO_TO_FRONT
-
- OKAYN '"SaveToPREFPRINTER.fred"' '"Select Settings?"' '"Redefine|Use Current|Cancel"'
- IF (RC = 0) THEN DO
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
- ELSE IF (RC = 2) THEN DO
- SETCLIP( "FREDPREFPRINTERUseDefaults", 1 )
- EXIT 0
- END
- ELSE IF (RC = 1) THEN DO
- ADPRO_TO_FRONT
-
- OKAYN '"SaveToPREFPRINTER.fred"' '"Choose orientation."' '"Horizontal|Vertical|Cancel"'
- IF (RC = 0) THEN DO
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
- ELSE IF (RC = 1) THEN
- Orientation = "HORIZONTAL"
- ELSE IF (RC = 2) THEN
- Orientation = "VERTICAL"
- END
-
- SETCLIP( "FREDPREFPRINTEROrientation", Orientation )
-
-
- /*
- ** Set the Dither type and Mask Size (if necessary).
- */
-
- MaskSize = 2 /* If 2, we'll ask for new one */
- /* Set to 0 if no mask size is required */
-
- DitherType.1 = "Floyd"
- DitherType.2 = "Ordered"
- DitherType.3 = "Horizontal"
- DitherType.4 = "Vertical"
- DitherType.5 = "Forward Brick"
- DitherType.6 = "Backward Brick"
- DitherType.7 = "Forward Diagonal"
- DitherType.8 = "Backward Diagonal"
- DitherType.9 = "Halftone A"
- DitherType.10 = "Halftone B"
- DitherType.11 = "ASCII"
- MinDitherType = 1
- MaxDitherType = 11
- DefDitherType = 1
-
- String = '"' || DitherType.DefDitherType || '"'
- DO LoopCounter = MinDitherType TO MaxDitherType
- String = String '"' || DitherType.LoopCounter || '"'
- END
-
- MaskSizeID.1 = 2
- MaskSizeID.2 = 4
- MaskSizeID.3 = 8
- MaskSizeID.4 = 16
-
- continue = 0
- DO UNTIL (continue = 1)
- ADPRO_TO_FRONT
-
- LISTVIEW '"Dither Modes:"' (MaxDitherType-MinDitherType+1) ITEMS String
- LISTVIEW_RC = RC
- PARSE VAR ADPRO_RESULT '"'DitherTypeStr'"' scratch
-
- DitherMode = MinDitherType
- DO WHILE (DitherMode <= MaxDitherType) & (COMPARE( DitherTypeStr, DitherType.DitherMode ) ~= 0)
- DitherMode = DitherMode + 1
- END
-
- IF (LISTVIEW_RC ~= 0) & (LISTVIEW_RC ~= 1) THEN DO
- ADPRO_TO_FRONT
-
- OKAYN '"SaveToPREFPRINTER.fred"' '"This value is required."' '"Retry|Cancel"'
- IF (RC = 0) THEN
- EXIT 10
- END
- ELSE DO
- IF (DitherMode ~= 1) & (DitherMode ~= 11) THEN DO
- ADPRO_TO_FRONT
-
- OKAYN '"SaveToPREFPRINTER.fred"' '"Select Mask Size"' '"2|4|8|16|Cancel"'
- IF (RC = 0) THEN DO
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
- ELSE
- MaskSize = MaskSizeID.RC
- END
- ELSE
- MaskSize = 0
-
- continue = 1
- END
- END
-
- SETCLIP( "FREDPREFPRINTERDither", DitherMode )
- SETCLIP( "FREDPREFPRINTERMaskSize", MaskSize )
-
-
- /*
- ** Set the Print Density.
- */
-
- CALL "FREDSCRIPTS:FREDFunctions/GetANumber" '"Enter Print Density"' 1 1 7 TRUE
- IF (RESULT = (1-1)) THEN
- EXIT 10
- Density = RESULT
-
- SETCLIP( "FREDPREFPRINTERDensity", Density )
-
-
- /*
- ** Set the Print Dimension.
- */
-
- CALL "FREDSCRIPTS:FREDFunctions/GetAFloat" '"Enter Print Width?"' 1.0 0.1 999.0 TRUE
- IF (RESULT = "CANCEL") THEN
- EXIT 10
- PrintWidth = RESULT
-
- SETCLIP( "FREDPREFPRINTERPrintWidth", PrintWidth )
-
- CALL "FREDSCRIPTS:FREDFunctions/GetAFloat" '"Enter Print Height"' 1.0 0.1 999.0 TRUE
- IF (RESULT = "CANCEL") THEN
- EXIT 10
- PrintHeight = RESULT
-
- SETCLIP( "FREDPREFPRINTERPrintHeight", PrintHeight )
-
- CALL "FREDSCRIPTS:FREDFunctions/GetAFloat" '"Enter Print Left Offset"' 1.0 0.1 PrintWidth TRUE
- IF (RESULT = "CANCEL") THEN
- EXIT 10
- PrintLeft = RESULT
-
- SETCLIP( "FREDPREFPRINTERPrintLeft", PrintLeft )
-
- CALL "FREDSCRIPTS:FREDFunctions/GetAFloat" '"Enter Print Top Offset"' 1.0 0.1 PrintHeight TRUE
- IF (RESULT = "CANCEL") THEN
- EXIT 10
- PrintTop = RESULT
-
- SETCLIP( "FREDPREFPRINTERPrintTop", PrintTop )
-
-
- /*
- ** Set the Page Definition.
- */
-
- CALL "FREDSCRIPTS:FREDFunctions/GetAFloat" '"Enter Page Width"' 1.0 0.1 999.0 TRUE
- IF (RESULT = "CANCEL") THEN
- EXIT 10
- PageWidth = RESULT
-
- SETCLIP( "FREDPREFPRINTERPageWidth", PageWidth )
-
- CALL "FREDSCRIPTS:FREDFunctions/GetAFloat" '"Enter Page Height"' 1.0 0.1 999.0 TRUE
- IF (RESULT = "CANCEL") THEN
- EXIT 10
- PageHeight = RESULT
-
- SETCLIP( "FREDPREFPRINTERPageHeight", PageHeight )
-
- CALL "FREDSCRIPTS:FREDFunctions/GetAFloat" '"Enter Page Left Offset"' 1.0 0.1 PageWidth TRUE
- IF (RESULT = "CANCEL") THEN
- EXIT 10
- PageLeft = RESULT
-
- SETCLIP( "FREDPREFPRINTERPageLeft", PageLeft )
-
- CALL "FREDSCRIPTS:FREDFunctions/GetAFloat" '"Enter Page Top Offset"' 1.0 0.1 PageHeight TRUE
- IF (RESULT = "CANCEL") THEN
- EXIT 10
- PageTop = RESULT
-
- SETCLIP( "FREDPREFPRINTERPageTop", PageTop )
-
-
- /*
- ** Set the Paper Dimension.
- */
-
- CALL "FREDSCRIPTS:FREDFunctions/GetAFloat" '"Enter Paper Height"' 1.0 0.1 999.0 TRUE
- IF (RESULT = "CANCEL") THEN
- EXIT 10
- PaperHeight = RESULT
-
- SETCLIP( "FREDPREFPRINTERPaperHeight", PaperHeight )
-
- SCREEN_TO_FRONT "FRED"
-
- EXIT 0
-