--- a/VerticalRuler.st Mon Nov 28 22:09:01 1994 +0100
+++ b/VerticalRuler.st Wed Dec 21 20:25:09 1994 +0100
@@ -20,13 +20,36 @@
VerticalRuler comment:'
COPYRIGHT (c) 1991 by Claus Gittinger
All Rights Reserved
+'!
-a VerticalRuler for page layout.
+!VerticalRuler class methodsFor:'documentation'!
+
+copyright
+"
+ COPYRIGHT (c) 1994 by Claus Gittinger
+ All Rights Reserved
-$Header: /cvs/stx/stx/libwidg2/VerticalRuler.st,v 1.2 1994-11-21 16:48:22 claus Exp $
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice. This software may not
+ be provided or otherwise made available to, or used by, any
+ other person. No title to or ownership of the software is
+ hereby transferred.
+"
+!
-written oct 91 by claus
-'!
+version
+"
+$Header: /cvs/stx/stx/libwidg2/VerticalRuler.st,v 1.3 1994-12-21 19:25:09 claus Exp $
+"
+!
+
+documentation
+"
+ like a Ruler, but vertical.
+ see documentation in Ruler
+"
+! !
!VerticalRuler methodsFor:'accessing'!
@@ -90,8 +113,11 @@
paperHeightMM := self inchToMillimeter:paperHeight.
pixelPerMM := (self millimeterToPixel:1) * scale.
pos := 5.
- labelBot := marg + font height + font ascent.
-
+ showUnit ifTrue:[
+ labelBot := marg + font height + font ascent.
+ ] ifFalse:[
+ labelBot := 0
+ ].
y := (pixelPerMM * pos - yOrigin) rounded.
[(y < height) and:[pos <= paperHeightMM]] whileTrue:[
|l|
@@ -113,7 +139,9 @@
pos := pos + 5.
y := (pixelPerMM * pos - yOrigin) rounded
].
- self displayString:'cm ' x:charX y:marg + fontHeight.
+ showUnit ifTrue:[
+ self displayString:'cm ' x:charX y:marg + fontHeight.
+ ]
].
(metric == #inch) ifTrue:[
"inches - long blibs every inch; short ones every half; very
@@ -121,7 +149,11 @@
pixelPerInch := (self inchToPixel:1) * scale.
pos := 0.25.
- labelBot := marg + (font height + font ascent).
+ showUnit ifTrue:[
+ labelBot := marg + (font height + font ascent).
+ ] ifFalse:[
+ labelBot := 0
+ ].
y := (pixelPerInch * pos - yOrigin) rounded.
veryShortLen := longLen // 4.
@@ -151,7 +183,9 @@
pos := pos + 0.25.
y := (pixelPerInch * pos - yOrigin) rounded
].
- self displayString:'inch ' x:charX y:marg + fontHeight.
+ showUnit ifTrue:[
+ self displayString:'inch ' x:charX y:marg + fontHeight.
+ ]
].
self redrawEdges
! !