center CkeckToggle in row
authorca
Wed, 14 Jan 1998 07:37:38 +0100
changeset 655 ea7fbb7166d7
parent 654 957008fbd9c5
child 656 96a9b94e5472
center CkeckToggle in row
DataSetColumn.st
--- a/DataSetColumn.st	Mon Jan 12 23:54:39 1998 +0100
+++ b/DataSetColumn.st	Wed Jan 14 07:37:38 1998 +0100
@@ -178,7 +178,7 @@
 drawFrom:start times:nTimes x0:x0 yTop:yTop yBot:yBot with:fgColor and:bgColor
     "redraw rows between start and stop
     "
-    |lgCol dkCol fg bg lblFg lblBg lbl row colSp fH fW fE
+    |lgCol dkCol fg bg lblFg lblBg lbl row colSp fH fW fE sepSz
      h  "{ Class:SmallInteger }"
      n  "{ Class:SmallInteger }"
      y  "{ Class:SmallInteger }"
@@ -196,6 +196,7 @@
     fg    := foregroundColor ? fgColor.
     lgCol := dataSet hgLgFgColor.
     dkCol := dataSet hgLgBgColor.
+    sepSz := dataSet separatorSize.
     y     := yTop + textInset.
     x     := x0   + dataSet horizontalSpacing.
     n     := start.
@@ -242,10 +243,12 @@
         fH := buttonExtent y.
         fW := buttonExtent x.
 
-        x  := width - fW - 4.
-
-        rendererType ~~ #CheckToggle ifTrue:[x := x0 + x]
-                                    ifFalse:[x := x0 + (x // 2)].
+        rendererType ~~ #CheckToggle ifTrue:[
+            x := x0 + width - fW - 4
+        ] ifFalse:[
+            x  := x0 + (width - fW - sepSz + 1 // 2).
+        
+        ].
 
         y := yTop + buttonInset + 1.
         dataSet paint:(dataSet separatorLightColor).
@@ -287,7 +290,7 @@
 
     x  := x0 + width - 1.
 
-    dataSet separatorSize == 1 ifTrue:[
+    sepSz == 1 ifTrue:[
         y := yTop.
 
         dataSet paint:fgColor.
@@ -614,5 +617,5 @@
 !DataSetColumn class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/DataSetColumn.st,v 1.14 1998-01-04 15:36:58 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/DataSetColumn.st,v 1.15 1998-01-14 06:37:38 ca Exp $'
 ! !