accessing pageCounter and titleFont used for pageNumbers...
authorca
Fri, 23 Nov 2007 14:06:49 +0100
changeset 2357 918859a27b27
parent 2356 a4128a41b721
child 2358 7eca18445279
accessing pageCounter and titleFont used for pageNumbers...
WinPrinterContext.st
--- a/WinPrinterContext.st	Wed Nov 21 17:40:19 2007 +0100
+++ b/WinPrinterContext.st	Fri Nov 23 14:06:49 2007 +0100
@@ -5575,6 +5575,13 @@
 
 !WinPrinterContext::WinPrinterGraphicContext methodsFor:'accessing-hooks'!
 
+pageCounter
+    "answer the current page number"
+
+    pageCounter ~~ 0 ifTrue:[^ pageCounter].
+    ^ 1
+!
+
 pageNumberFormat:aFormatString
     "set the pageNumber format - the default is 'page %1'"
 
@@ -5788,6 +5795,8 @@
 !
 
 titleFont
+    "answer the font used for displaying page numbers..."
+
     titleFont isNil ifTrue:[
         titleFont := Font family:'helvetica' face:'medium' style:'roman' size:10.
         titleFont := titleFont onDevice:(self device).
@@ -5795,6 +5804,14 @@
     ^ titleFont
 !
 
+titleFont:aFont
+    "set the font used for displaying page numbers..."
+
+    (aFont notNil and:[aFont ~= titleFont]) ifTrue:[
+        titleFont := aFont onDevice:(self device).
+    ].
+!
+
 widthOf:aString from:index1 to:index2 inFont:aFontId
     "after retrieving the width, we have to scale the width"
 
@@ -5855,19 +5872,20 @@
     
     |oldClip oldTrans oldFont|
 
-    oldClip  := clipRect.
+    oldClip := clipRect.
+    oldClip notNil ifTrue:[ self deviceClippingRectangle:nil ].
+
     oldTrans := self translation.
     oldFont  := font.
 
     self  font:(self titleFont).
     self  translation:0.
-    super clippingRectangle:nil.
 
     aNoneArgAction value.
 
     self translation:oldTrans.
-    super clippingRectangle:oldClip.
     oldFont notNil ifTrue:[ self font:oldFont ].
+    oldClip notNil ifTrue:[ self deviceClippingRectangle:oldClip ].
 !
 
 endPage
@@ -5919,5 +5937,5 @@
 !WinPrinterContext class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview2/WinPrinterContext.st,v 1.29 2007-11-21 16:40:19 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libview2/WinPrinterContext.st,v 1.30 2007-11-23 13:06:49 ca Exp $'
 ! !