now uses TabulatorSpecification
authorclaus
Wed, 24 Aug 1994 01:44:32 +0200
changeset 20 bf516dd2433b
parent 19 79ab6bc98651
child 21 3cb093b273a1
now uses TabulatorSpecification
TextRuler.st
--- a/TextRuler.st	Wed Aug 24 01:44:22 1994 +0200
+++ b/TextRuler.st	Wed Aug 24 01:44:32 1994 +0200
@@ -11,7 +11,7 @@
 "
 
 Ruler subclass:#TextRuler
-         instanceVariableNames:'leftMargin rightMargin tabStops tabTypes moving'
+         instanceVariableNames:'leftMargin rightMargin tabSpec moving'
             classVariableNames:'LeftAlignForm RightAlignForm
                                 AlignForm CenterForm LeftMarginForm
                                 RightMarginForm LeftTabForm RightTabForm
@@ -26,7 +26,7 @@
 
 a Ruler for page layout showing tabs., margins etc.
 
-$Header: /cvs/stx/stx/libwidg2/TextRuler.st,v 1.6 1994-08-05 01:24:10 claus Exp $
+$Header: /cvs/stx/stx/libwidg2/TextRuler.st,v 1.7 1994-08-23 23:44:32 claus Exp $
 written oct 91 by claus
 '!
 
@@ -338,7 +338,7 @@
 redraw
     "redraw margin & tab marks"
 
-    |x top form tab type|
+    |x top form tab type tabStops tabAlign|
 
     super redraw.
 
@@ -353,14 +353,17 @@
                              y:(top - form height).
     x := (self inchToPixel:rightMargin) rounded.
     form := self class rightMarginForm.
-    self displayOpaqueForm:form x:(x - (form width // 2))
-                             y:(top - form height).
+    self displayOpaqueForm:form 
+                         x:(x - (form width // 2))
+                         y:(top - form height).
 
+    tabStops := tabSpec positions.
+    tabAlign := tabSpec align.
     tabStops notNil ifTrue:[
         1 to:tabStops size do:[:tabNr |
             tab := tabStops at:tabNr.
-            type := tabTypes at:tabNr.
-            x := (self inchToPixel:tab) rounded.
+            type := tabAlign at:tabNr.
+            x := (tabSpec positionOfTab:tabNr on:self) rounded.
             (type == #left) ifTrue:[
                 form := self class leftTabForm
             ] ifFalse:[
@@ -376,8 +379,9 @@
                     ]
                 ]
             ].
-            self displayOpaqueForm:form x:(x - (form width // 2))
-                                        y:(top - form height)
+            self displayOpaqueForm:form 
+				 x:(x - (form width // 2))
+                                 y:(top - form height)
         ]
     ]
 ! !