Scroller.st
changeset 4038 bb2c21273645
parent 4036 02c9d070f9ec
child 4039 51eb8083cffb
--- a/Scroller.st	Sun Oct 25 00:59:02 2009 +0200
+++ b/Scroller.st	Sun Oct 25 01:09:53 2009 +0200
@@ -1070,17 +1070,17 @@
 
 !Scroller methodsFor:'drawing'!
 
-drawEdgedLineFrom:x1 y:y1 toX:x2 y:y2 level:lvl
+drawEdgedLineFrom:x1 y:y1 toX:x2 y:y2 level:lvl lightColor:lightColor shadowColor:shadowColor
     |color1 color2 x y dl|
 
     "iris style - draw tallys"
 
     lvl > 0 ifTrue:[
-        color1 := thumbLightColor.
-        color2 := thumbShadowColor.
+        color1 := lightColor.
+        color2 := shadowColor.
     ] ifFalse:[
-        color1 := thumbShadowColor.
-        color2 := thumbLightColor.
+        color1 := shadowColor.
+        color2 := lightColor.
     ].
 
     dl := 1.
@@ -1102,14 +1102,16 @@
 !
 
 drawHandleFormAtX:x y:y
+    "styles with a handle in the middle (NeXT) use this"
+
     thumbShadowColor := thumbShadowColor onDevice:device.
 
     self paint:thumbShadowColor.
     self displayForm:shadowForm x:x y:y.
     lightForm notNil ifTrue:[
-	thumbLightColor := thumbLightColor onDevice:device.
-	self paint:thumbLightColor.
-	self displayForm:lightForm x:x y:y.
+        thumbLightColor := thumbLightColor onDevice:device.
+        self paint:thumbLightColor.
+        self displayForm:lightForm x:x y:y.
     ].
 
     "Modified: / 19.5.1998 / 16:26:49 / cg"
@@ -1127,7 +1129,7 @@
      x "{ Class: SmallInteger }"
      y "{ Class: SmallInteger }"
      xL xR yT yB dist yTop yBot xLeft xRight
-    |
+     light shadow|
 
     "iris style - draw tallys"
 
@@ -1141,12 +1143,19 @@
     l := thumbFrame left.
     t := thumbFrame top.
 
+    light := thumbLightColor.
+    shadow := thumbShadowColor.
+    styleSheet name == #winVista ifTrue:[
+        light := (entered ifTrue:[Color green. thumbEnteredColor] ifFalse:[thumbColor]) lightened.
+        shadow := (entered ifTrue:[thumbEnteredColor] ifFalse:[thumbColor]) darkened.
+    ].
+
     tallyLevel > 0 ifTrue:[
-        color1 := thumbLightColor.
-        color2 := thumbShadowColor.
+        color1 := light.
+        color2 := shadow.
     ] ifFalse:[
-        color1 := thumbShadowColor.
-        color2 := thumbLightColor.
+        color1 := shadow.
+        color2 := light.
     ].
 
     "draw tally marks"
@@ -1161,10 +1170,10 @@
         tallyMarks even ifTrue:[
             yTop := y - (dist // 2).   
             yBot := y + (dist - (dist // 2)).
-            self drawEdgedLineFrom:xL y:yTop toX:xR y:yTop level:tallyLevel.
-            self drawEdgedLineFrom:xL y:yBot toX:xR y:yBot level:tallyLevel.
+            self drawEdgedLineFrom:xL y:yTop toX:xR y:yTop level:tallyLevel lightColor:light shadowColor:shadow.
+            self drawEdgedLineFrom:xL y:yBot toX:xR y:yBot level:tallyLevel lightColor:light shadowColor:shadow.
         ] ifFalse:[
-            self drawEdgedLineFrom:xL y:y toX:xR y:y level:tallyLevel.
+            self drawEdgedLineFrom:xL y:y toX:xR y:y level:tallyLevel lightColor:light shadowColor:shadow.
             yTop := yBot := y.   
         ].
 
@@ -1172,8 +1181,8 @@
             "dont draw other marks if there is not enough space"
 
             h > (dist * (tallyMarks * 2)) ifTrue:[
-                self drawEdgedLineFrom:xL y:(yTop - dist) toX:xR y:(yTop - dist) level:tallyLevel.
-                self drawEdgedLineFrom:xL y:(yBot + dist) toX:xR y:(yBot + dist) level:tallyLevel.
+                self drawEdgedLineFrom:xL y:(yTop - dist) toX:xR y:(yTop - dist) level:tallyLevel lightColor:light shadowColor:shadow.
+                self drawEdgedLineFrom:xL y:(yBot + dist) toX:xR y:(yBot + dist) level:tallyLevel lightColor:light shadowColor:shadow.
             ]
         ]
     ] ifFalse:[
@@ -1187,18 +1196,18 @@
         tallyMarks even ifTrue:[
             xLeft := x - (dist // 2).   
             xRight := x + (dist - (dist // 2)).
-            self drawEdgedLineFrom:xLeft y:yT toX:xLeft y:yB level:tallyLevel.
-            self drawEdgedLineFrom:xRight y:yT toX:xRight y:yB level:tallyLevel.
+            self drawEdgedLineFrom:xLeft y:yT toX:xLeft y:yB level:tallyLevel lightColor:light shadowColor:shadow.
+            self drawEdgedLineFrom:xRight y:yT toX:xRight y:yB level:tallyLevel lightColor:light shadowColor:shadow.
         ] ifFalse:[
-            self drawEdgedLineFrom:x y:yT toX:x y:yB level:tallyLevel.
+            self drawEdgedLineFrom:x y:yT toX:x y:yB level:tallyLevel lightColor:light shadowColor:shadow.
             xLeft := xRight := x.   
         ].
         tallyMarks > 1 ifTrue:[
             "dont draw other marks if there is not enough space"
 
             w > (dist * (tallyMarks * 2)) ifTrue:[
-                self drawEdgedLineFrom:(xLeft - dist) y:yT toX:(xLeft - dist) y:yB level:tallyLevel.
-                self drawEdgedLineFrom:(xRight + dist) y:yT toX:(xRight + dist) y:yB level:tallyLevel.
+                self drawEdgedLineFrom:(xLeft - dist) y:yT toX:(xLeft - dist) y:yB level:tallyLevel lightColor:light shadowColor:shadow.
+                self drawEdgedLineFrom:(xRight + dist) y:yT toX:(xRight + dist) y:yB level:tallyLevel lightColor:light shadowColor:shadow.
             ]
         ]
     ]
@@ -2742,9 +2751,9 @@
 !Scroller class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Scroller.st,v 1.195 2009-10-24 22:58:51 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Scroller.st,v 1.196 2009-10-24 23:09:53 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg/Scroller.st,v 1.195 2009-10-24 22:58:51 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Scroller.st,v 1.196 2009-10-24 23:09:53 cg Exp $'
 ! !