*** empty log message ***
authorca
Mon, 13 Sep 2004 18:03:43 +0200
changeset 3019 6cfaf60fd8ea
parent 3018 6c642cab7019
child 3020 68a2dfad4e5e
*** empty log message ***
ScrollBar.st
Scroller.st
--- a/ScrollBar.st	Mon Sep 13 17:10:47 2004 +0200
+++ b/ScrollBar.st	Mon Sep 13 18:03:43 2004 +0200
@@ -382,7 +382,7 @@
 
 update:something with:aParameter from:changedObject
     changedObject == thumb ifTrue:[
-	self enableDisableButtons
+        self enableDisableButtons
     ]
 ! !
 
@@ -766,6 +766,7 @@
         button2 name:'downButton'.
         thumb := Scroller in:self.
     ].
+    thumb addDependent:self.
 
     "Modified: 28.5.1997 / 15:49:05 / cg"
 !
@@ -972,10 +973,9 @@
 
     <resource: #style (#'scrollBar.disableButtons')>
 
-    |e1 e2 th to|
+    |e1 e2 th to ena|
 
     (styleSheet at:#'scrollBar.disableButtons' default:false) ifFalse:[^ self].
-
     e1 := e2 := true.
     (th := thumb thumbHeight) notNil ifTrue:[
         (th >= (thumb stop)) ifTrue:[
@@ -994,6 +994,27 @@
     e1 ifTrue:[button1 enable] ifFalse:[button1 disable].
     e2 ifTrue:[button2 enable] ifFalse:[button2 disable].
 
+    self isNativeWidget ifTrue:[
+        drawableId notNil ifTrue:[
+            e1 ifTrue:[
+                e2 ifTrue:[
+                    "/ both enabled
+                    ena := #ENABLE_BOTH.
+                ] ifFalse:[
+                    ena := #DISABLE_RTDN.
+                ]
+            ] ifFalse:[
+                e2 ifTrue:[
+                    ena := #DISABLE_LTUP.
+                ] ifFalse:[
+                    ena := #DISABLE_BOTH.
+                ]
+            ].
+ena infoPrintCR.
+            device enableScrollBar:ena in:drawableId.
+        ].
+    ].
+
     "Modified: / 29.4.1999 / 08:44:03 / cg"
 !
 
@@ -1144,5 +1165,5 @@
 !ScrollBar class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/ScrollBar.st,v 1.74 2004-09-13 15:10:47 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/ScrollBar.st,v 1.75 2004-09-13 16:03:40 ca Exp $'
 ! !
--- 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 $'
 ! !