home *** CD-ROM | disk | FTP | other *** search
- /*
- * DrawPRTSetup.fw
- *
- * USAGE: DrawPRTSetup.fw
- *
- * A usefull tool making and checking setup of printers.
- *
- * HISTORY:
- * v1.01 Added the support for the progress indicator
- *
- * v1.02 aligned with the new server design v1.10
- *
- * v1.03 minor bug fixed
- *
- * $(C): (1994, Rocco Coluccelli, Bologna)
- * $VER: DrawPRTSetup.fw 1.03 (03.Feb.1995)
- */
-
- OPTIONS RESULTS
- NUMERIC DIGITS 6
-
- PARSE ARG oleclip
- PARSE VALUE GETCLIP(oleclip) WITH jobID modID . . . . . oleport . . userport olepipe locale .
- PARSE VALUE GETCLIP(olepipe) WITH density colors .
-
-
- ADDRESS VALUE userport
-
- micro2mm = 2.54 / 720
- micro2inch = 1 / 720
-
- pfontsize = 80
- plinecolor = 'BLACK'
- plineweight = 'Hairline'
- pboxfill = 'Transparent'
- pcolorfile = 'OLE:misc/ColorPalette.iff'
-
- SetMeasure 'MICROPOINTS'
- GraphicTool
- View 50
-
-
- /*
- * Get current setup of page, store boxprefs and lineprefs
- */
- Status 'Page'
- page = result
-
- GetBoxPrefs 'LineWt' 'LineColor' 'Fill'
- PARSE VAR result bwidth bcolor bfill .
- BoxPrefs 'LineWt' plineweight 'LineColor' plinecolor 'Fill' pboxfill
-
- GetLinePrefs 'LineWt' 'LineColor'
- PARSE VAR result lwidth lcolor .
- LinePrefs 'LineWt' plineweight 'LineColor' plinecolor
-
- TextBlockTypePrefs "Size" pfontsize % 10
-
-
- /*
- * Draw boxes around print and editable area
- */
- GetPageSetup 'Width' 'Height' 'Top' 'Bottom' 'Left' 'Right'
- PARSE VAR result pwidth pheight pup pdown pleft pright .
- DrawBox page pleft pup (pwidth - pleft - pright) (pheight - pup - pdown)
-
- GetSectionSetUp 'Top' 'Bottom' 'Inside' 'Outside'
- PARSE VAR result sup sdown sleft sright .
- DrawBox page sleft sup (pwidth - sleft - sright) (pheight - sup - sdown)
-
-
- CALL Complete(10)
- CALL CheckOffset()
- CALL Complete(20)
- CALL BorderScale()
- CALL Complete(40)
-
- IF density THEN
- CALL CheckDensity()
-
- IF colors THEN
- CALL CheckColors()
-
- CALL Complete(100)
-
-
- ReDraw
- BoxPrefs 'LineWt' bwidth 'LineColor' bcolor 'Fill' bfill
- LinePrefs 'LineWt' lwidth 'LineColor' lcolor
-
- ADDRESS VALUE oleport
- SETJOB jobID 'end'
-
- EXIT 0
-
-
- CheckOffset:
-
- x0 = pwidth % 2 + 360; x1 = x0 + 100; y0 = pup + 360
-
- DrawTextBlock page x0 y0 GetLocale(1)
- y0 = y0 + pfontsize + 20
- in = pwidth * micro2inch
- mm = pwidth * micro2mm
- DrawTextBlock page x1 y0 in GetLocale(5) ' ' mm GetLocale(6)
- y0 = y0 + pfontsize + 40
-
- DrawTextBlock page x0 y0 GetLocale(2)
- y0 = y0 + pfontsize + 20
- in = pheight * micro2inch
- mm = pheight * micro2mm
- DrawTextBlock page x1 y0 in GetLocale(5) ' ' mm GetLocale(6)
- y0 = y0 + pfontsize + 40
-
- DrawTextBlock page x0 y0 GetLocale(3)
- y0 = y0 + pfontsize + 20
- in = (pwidth - sleft - sright) * micro2inch
- mm = (pwidth - sleft - sright) * micro2mm
- DrawTextBlock page x1 y0 in GetLocale(5) ' ' mm GetLocale(6)
- y0 = y0 + pfontsize + 40
-
- DrawTextBlock page x0 y0 GetLocale(4)
- y0 = y0 + pfontsize + 20
- in = (pheight - sup - sdown) * micro2inch
- mm = (pheight - sup - sdown) * micro2mm
- DrawTextBlock page x1 y0 in GetLocale(5) ' ' mm GetLocale(6)
- y0 = y0 + pfontsize + 40
-
- DrawTextBlock page x0 y0 GetLocale(7)
- y0 = y0 + pfontsize + 20
- in = sleft * micro2inch
- mm = sleft * micro2mm
- DrawTextBlock page x1 y0 in GetLocale(5) ' ' mm GetLocale(6)
- y0 = y0 + pfontsize + 40
-
- DrawTextBlock page x0 y0 GetLocale(8)
- y0 = y0 + pfontsize + 20
- in = sup * micro2inch
- mm = sup * micro2mm
- DrawTextBlock page x1 y0 in GetLocale(5) ' ' mm GetLocale(6)
- y0 = y0 + pfontsize + 40
-
- RETURN
-
-
- BorderScale:
-
- CALL DrawScale(1,sleft,1,sup)
- CALL DrawScale(pwidth - sright,pwidth,pheight - sdown,pheight)
-
- DrawLine page 1 1 sleft sup
- DrawLine page (pwidth - sright) sup pwidth 1
- DrawLine page (pwidth - sright) (pheight - sdown) pwidth pheight
- DrawLine page 1 pheight sleft (pheight - sdown)
-
- RETURN
-
-
- DrawScale:
-
- y0 = pheight % 2 - 70; y1 = y0 + 140
- DO i = ARG(1) TO ARG(2) BY 72
- DrawLine page i y0 i y1
- END
-
- y0 = pheight % 2 - 50; y1 = y0 + 100
- DO i = 36 + ARG(1) TO ARG(2) BY 72
- DrawLine page i y0 i y1
- END
-
- x0 = pwidth % 2 - 70; x1 = x0 + 140
- DO i = ARG(3) TO ARG(4) BY 72
- DrawLine page x0 i x1 i
- END
-
- x0 = pwidth % 2 - 50; x1 = x0 + 100
- DO i = 36 + ARG(3) TO ARG(4) BY 72
- DrawLine page x0 i x1 i
- END
-
- RETURN
-
-
- CheckColors:
-
- x0 = pwidth % 2 + 360
- y0 = 3 * pheight % 4 - pdown - 360
- InsertImage pcolorfile 'POSITION' page x0 y0 (pwidth % 4) (pheight % 4)
-
- RETURN
-
-
- CheckDensity:
-
- y1 = pup + 360; y2 = y1 + pheight % 20
- DO i = 9 TO 0 BY - 1
-
- x0 = pleft + 360
- DO FOR 72
- DrawLine page x0 y1 x0 y2
- x0 = x0 + i
- END
- DrawTextBlock page (x0 + 50) y1 (720 % (i + 1)) 'lpi'
-
- IF i = 5 THEN y2 = pheight % 2 + 360
- y1 = y2 + 100; y2 = y1 + pheight % 20
-
- CALL Complete(90 - 4 * (i + 1))
- END
-
- RETURN
-
-
- GetLocale: PROCEDURE EXPOSE locale
- ARG strID
-
- strID = 'þ'strID'þ'; PARSE VALUE GETCLIP(locale) WITH (strID)text'Þ'
-
- RETURN text
-
-
- Complete:
-
- ADDRESS VALUE oleport
- COMPLETE jobID modID ARG(1)
- ADDRESS
-
- RETURN
-