Simple Windows Stream Printing Support
authorfm
Thu, 12 Oct 2006 16:33:17 +0200
changeset 2247 b0a3ddb53d25
parent 2246 06d8e72ce51f
child 2248 bb624c6d4709
Simple Windows Stream Printing Support
PrinterContext.st
--- a/PrinterContext.st	Tue Oct 10 22:32:40 2006 +0200
+++ b/PrinterContext.st	Thu Oct 12 16:33:17 2006 +0200
@@ -554,7 +554,7 @@
      Left, top, right & bottom margins are specified in inches in
      aMarginsRect."
     
-    |lines linesPerPage totalPage marginsRect firstPage charHeight abortDialog|
+    |lines linesPerPage totalPage marginsRect firstPage abortDialog|
 
     jobid isNil ifTrue:[
         self startPrintJob:aTitle
@@ -566,8 +566,7 @@
                 asArrayOfStringLines:aString
                 in:marginsRect
                 wordWrap:wordWrapBoolean.
-    charHeight := self getCharHeight.
-    linesPerPage := (marginsRect bottom - marginsRect top) // charHeight.
+    linesPerPage := self linesPerPageFor: marginsRect.
     totalPage := (lines size + linesPerPage - 1) // linesPerPage.
     firstPage := true.
     
@@ -620,6 +619,7 @@
     "Created: / 03-08-2006 / 16:13:33 / fm"
     "Modified: / 04-08-2006 / 13:40:02 / fm"
     "Modified: / 10-10-2006 / 18:16:54 / cg"
+    "Modified: / 12-10-2006 / 11:50:37 / User"
 !
 
 print:aString pageHeader:aString2 font:aFont title:aTitle wordWrap:wordWrapBoolean marginsRect:aMarginsRect 
@@ -945,6 +945,20 @@
     "Modified: / 10-10-2006 / 18:14:40 / cg"
 !
 
+linesPerPageFor: aRectangle
+
+|marginsRect charHeight|
+
+    marginsRect := aRectangle isNil 
+        ifTrue:[self marginsRectangleFor: nil]
+        ifFalse:[aRectangle].
+
+    charHeight := self getCharHeight.                   
+    ^(marginsRect bottom - marginsRect top) // charHeight
+
+    "Created: / 12-10-2006 / 11:52:57 / User"
+!
+
 marginsRectangleFor:aRectangle 
     "Private - Answer a Rectangle defining margins based on aRectangle.
      Units for aRectangle are in inches, returned margins rectangle is
@@ -1073,5 +1087,5 @@
 !PrinterContext class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/PrinterContext.st,v 1.7 2006-10-10 18:25:51 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/PrinterContext.st,v 1.8 2006-10-12 14:33:17 fm Exp $'
 ! !