Scroller.st
changeset 3019 6cfaf60fd8ea
parent 3017 8acd72001dd6
child 3025 7ee781e02854
--- a/Scroller.st	Mon Sep 13 17:10:47 2004 +0200
+++ b/Scroller.st	Mon Sep 13 18:03:43 2004 +0200
@@ -474,22 +474,23 @@
     rangeEnd := stop.
 
     rangeStart = rangeEnd ifTrue:[
-	self halt:'invalud slider range (start = stop)'.
-	rangeStep isNil ifTrue:[
-	    rangeEnd := rangeStart + 1
-	] ifFalse:[
-	    rangeEnd := rangeStart + rangeStep.
-	]
+        self halt:'invalud slider range (start = stop)'.
+        rangeStep isNil ifTrue:[
+            rangeEnd := rangeStart + 1
+        ] ifFalse:[
+            rangeEnd := rangeStart + rangeStep.
+        ]
     ].
 
     org < rangeStart ifTrue:[
-	org := rangeStart
+        org := rangeStart
     ] ifFalse:[
-	org > rangeEnd ifTrue:[
-	    org := rangeEnd
-	]
+        org > rangeEnd ifTrue:[
+            org := rangeEnd
+        ]
     ].
     self thumbOrigin:org.
+    self tellOthers.
 
     "Modified: / 21.1.1998 / 19:22:07 / cg"
 !
@@ -591,7 +592,7 @@
         ] ifFalse:[
             thumbFrame := nil.
             self invalidate.
-        ]
+        ].
     ]
 
     "Modified: / 21.10.1998 / 22:35:31 / cg"
@@ -1845,8 +1846,9 @@
 
     (changedObject == model 
     "and:[something == aspectMsg]") ifTrue:[
-	self thumbOrigin:(model value).
-	^ self
+        self thumbOrigin:(model value).
+        "/ self tellOthers.
+        ^ self
     ].
     super update:something with:aParameter from:changedObject
 
@@ -2408,53 +2410,54 @@
      get the content's size
     "
     aView isNil ifTrue:[
-	contentsSize := 0
+        contentsSize := 0
     ] ifFalse:[
-	orientation == #vertical ifTrue:[
-	    contentsSize := aView heightOfContents.
-	    (t := aView transformation) notNil ifTrue:[
-		contentsSize := t applyScaleY:contentsSize.
-	    ].
-	] ifFalse:[
-	    contentsSize := aView widthOfContents.
-	    (t := aView transformation) notNil ifTrue:[
-		contentsSize := t applyScaleX:contentsSize.
-	    ].
-	]
+        orientation == #vertical ifTrue:[
+            contentsSize := aView heightOfContents.
+            (t := aView transformation) notNil ifTrue:[
+                contentsSize := t applyScaleY:contentsSize.
+            ].
+        ] ifFalse:[
+            contentsSize := aView widthOfContents.
+            (t := aView transformation) notNil ifTrue:[
+                contentsSize := t applyScaleX:contentsSize.
+            ].
+        ]
     ].
 
     (contentsSize = 0) ifTrue:[
-	percentSize := 100.
-	percentOrigin := 100
+        percentSize := 100.
+        percentOrigin := 100
     ] ifFalse:[
-	(orientation == #vertical) ifTrue:[
-	    viewsSize := aView innerHeight.
-	    contentsPosition := aView yOriginOfContents.
-	] ifFalse:[
-	    viewsSize := aView innerWidth.
-	    contentsPosition := aView xOriginOfContents
-	].
-
-	percentSize := viewsSize * 100.0 / contentsSize.
-	percentOrigin := contentsPosition * 100.0 / contentsSize.
-	percentOrigin + percentSize > 100.0 ifTrue:[
-	    "actually showing stuff below contents of view"
+        (orientation == #vertical) ifTrue:[
+            viewsSize := aView innerHeight.
+            contentsPosition := aView yOriginOfContents.
+        ] ifFalse:[
+            viewsSize := aView innerWidth.
+            contentsPosition := aView xOriginOfContents
+        ].
+
+        percentSize := viewsSize * 100.0 / contentsSize.
+        percentOrigin := contentsPosition * 100.0 / contentsSize.
+        percentOrigin + percentSize > 100.0 ifTrue:[
+            "actually showing stuff below contents of view"
 "
-	    contentsSize := contentsPosition + aView innerHeight.
-	    percentSize := viewsSize * 100.0 / contentsSize.
-	    percentOrigin := contentsPosition * 100.0 / contentsSize
+            contentsSize := contentsPosition + aView innerHeight.
+            percentSize := viewsSize * 100.0 / contentsSize.
+            percentOrigin := contentsPosition * 100.0 / contentsSize
 "
-	]
+        ]
     ].
     (percentSize = thumbHeight) ifTrue:[
-	self thumbOrigin:percentOrigin
+        self thumbOrigin:percentOrigin
     ] ifFalse:[
-	(percentOrigin = thumbOrigin) ifTrue:[
-	    self thumbHeight:percentSize
-	] ifFalse:[
-	    self thumbOrigin:percentOrigin thumbHeight:percentSize
-	]
-    ]
+        (percentOrigin = thumbOrigin) ifTrue:[
+            self thumbHeight:percentSize
+        ] ifFalse:[
+            self thumbOrigin:percentOrigin thumbHeight:percentSize
+        ]
+    ].
+    self tellOthers.
 !
 
 setThumbHeightFor:aView
@@ -2493,24 +2496,25 @@
     scrolling ifTrue:[self invalidate].
 
     (orientation == #vertical) ifTrue:[
-	total := aView heightOfContents.
-	aView transformation notNil ifTrue:[
-	    total := aView transformation applyScaleY:total.
-	].
+        total := aView heightOfContents.
+        aView transformation notNil ifTrue:[
+            total := aView transformation applyScaleY:total.
+        ].
     ] ifFalse:[
-	total := aView widthOfContents.
-	aView transformation notNil ifTrue:[
-	    total := aView transformation applyScaleX:total.
-	].
+        total := aView widthOfContents.
+        aView transformation notNil ifTrue:[
+            total := aView transformation applyScaleX:total.
+        ].
     ].
     (total = 0) ifTrue:[
-	percent := 100
+        percent := 100
     ] ifFalse:[
-	contentsPosition := (orientation == #vertical) ifTrue:[aView yOriginOfContents]
-						  ifFalse:[aView xOriginOfContents].
-	percent := contentsPosition * 100.0 / total
+        contentsPosition := (orientation == #vertical) ifTrue:[aView yOriginOfContents]
+                                                  ifFalse:[aView xOriginOfContents].
+        percent := contentsPosition * 100.0 / total
     ].
-    self thumbOrigin:percent
+    self thumbOrigin:percent.
+    self tellOthers.
 ! !
 
 !Scroller methodsFor:'queries'!
@@ -2584,5 +2588,5 @@
 !Scroller class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Scroller.st,v 1.167 2004-09-13 15:04:12 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Scroller.st,v 1.168 2004-09-13 16:03:43 ca Exp $'
 ! !