allow handleImage to be specified in styleSheet
authorClaus Gittinger <cg@exept.de>
Tue, 19 May 1998 16:28:27 +0200
changeset 1531 c5f2cfee9998
parent 1530 9d1da6aabffc
child 1532 b885176e75cc
allow handleImage to be specified in styleSheet
Scroller.st
--- a/Scroller.st	Tue May 19 16:21:59 1998 +0200
+++ b/Scroller.st	Tue May 19 16:28:27 1998 +0200
@@ -29,7 +29,7 @@
 		DefaultGhostColor DefaultGhostFrameColor DefaultGhostLevel
 		DefaultFixThumbHeight DefaultEdgeStyle DefaultFullViewBackground
 		DefaultThumbEnteredColor DefaultThumbActiveLevel SnapBackDistance
-		DefaultMiddleButtonJump NewCursors DefaultThumbImage'
+		DefaultMiddleButtonJump NewCursors DefaultThumbImage HandleImage'
 	poolDictionaries:''
 	category:'Views-Interactors'
 !
@@ -384,6 +384,7 @@
     DefaultMiddleButtonJump := StyleSheet at:'scroller.middleButtonJump' default:false.
     NewCursors := StyleSheet at:'scroller.newCursors' default:true.
     DefaultThumbImage := StyleSheet at:'scroller.thumbImage'.
+    HandleImage := StyleSheet at:'scroller.handleImage'.
 
     StyleSheet fileReadFailed ifTrue:[
         DefaultViewBackground := Grey.
@@ -398,7 +399,7 @@
      self updateStyleCache
     "
 
-    "Modified: / 12.5.1998 / 20:24:54 / cg"
+    "Modified: / 19.5.1998 / 16:24:02 / cg"
 ! !
 
 !Scroller methodsFor:'accessing'!
@@ -939,12 +940,16 @@
 
 drawHandleFormAtX:x y:y
     thumbShadowColor := thumbShadowColor on:device.
-    thumbLightColor := thumbLightColor on:device.
 
     self paint:thumbShadowColor.
     self displayForm:shadowForm x:x y:y.
-    self paint:thumbLightColor.
-    self displayForm:lightForm x:x y:y.
+    lightForm notNil ifTrue:[
+        thumbLightColor := thumbLightColor on:device.
+        self paint:thumbLightColor.
+        self displayForm:lightForm x:x y:y.
+    ].
+
+    "Modified: / 19.5.1998 / 16:26:49 / cg"
 !
 
 drawThumb
@@ -1751,18 +1756,21 @@
         fixThumbHeight := true.
     ].
 
-    nm = #next ifTrue:[
-        shadowForm := self class handleShadowFormOn:device.
-        lightForm := self class handleLightFormOn:device
+    HandleImage notNil ifTrue:[
+        shadowForm := HandleImage onDevice:device.
     ] ifFalse:[
-        shadowForm := lightForm := nil
+        nm = #next ifTrue:[
+            shadowForm := self class handleShadowFormOn:device.
+            lightForm := self class handleLightFormOn:device
+        ] ifFalse:[
+            shadowForm := lightForm := nil
+        ].
     ].
-
     drawableId notNil ifTrue:[
         self computeThumbFrame
     ]
 
-    "Modified: / 12.5.1998 / 20:26:21 / cg"
+    "Modified: / 19.5.1998 / 16:25:38 / cg"
 !
 
 initialize
@@ -2126,5 +2134,5 @@
 !Scroller class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Scroller.st,v 1.104 1998-05-12 18:59:41 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Scroller.st,v 1.105 1998-05-19 14:28:27 cg Exp $'
 ! !