checkin from browser
authorClaus Gittinger <cg@exept.de>
Tue, 17 Aug 1999 12:59:01 +0200
changeset 1986 7083145a236b
parent 1985 3abfcfd15cbf
child 1987 599825bed176
checkin from browser
ScrView.st
ScrollableView.st
--- a/ScrView.st	Thu Aug 12 16:08:21 1999 +0200
+++ b/ScrView.st	Tue Aug 17 12:59:01 1999 +0200
@@ -1333,7 +1333,7 @@
 sizeChanged:how
     "handle size changes - this may change any scrollBars visibility"
 
-    |orgX orgY scroll|
+    |orgX orgY thV thH scrollH scrollV|
 
     "/ resize components manually, in an order which is optimal
 
@@ -1368,47 +1368,56 @@
 
     vScrollBar notNil ifTrue:[
         vScrollBar setThumbFor:scrolledView.
+        orgY := vScrollBar thumbOrigin.
+        thV := vScrollBar thumbHeight.
     ].
     hScrollBar notNil ifTrue:[
         hScrollBar setThumbFor:scrolledView.
+        orgX := hScrollBar thumbOrigin.
+        thH := hScrollBar thumbHeight.
     ].
 
     "/ splitted, since there are optimized scrollProcedures for each case ...
 
     hScrollBar isNil ifTrue:[
         "/ only care for vertical ...
-        vScrollBar thumbOrigin + vScrollBar thumbHeight >= 100 ifTrue:[
-            vScrollBar thumbOrigin:(100 - vScrollBar thumbHeight).
+        orgY + thV >= 100 ifTrue:[
+            vScrollBar thumbOrigin:(100 - thV).
             scrolledView scrollVerticalToPercent:vScrollBar thumbOrigin.
         ].
     ] ifFalse:[
         vScrollBar isNil ifTrue:[
             "/ only care for horizontal ...
-            hScrollBar thumbOrigin + hScrollBar thumbHeight >= 100 ifTrue:[
-                hScrollBar thumbOrigin:(100 - hScrollBar thumbHeight).
-                scrolledView scrollVerticalToPercent:hScrollBar thumbOrigin.
+            orgX + thH >= 100 ifTrue:[
+                hScrollBar thumbOrigin:(100 - thH).
+                scrolledView scrollHorizontalToPercent:hScrollBar thumbOrigin.
             ].
         ] ifFalse:[
             "/ care for both ...
 
-            orgY := vScrollBar thumbOrigin.
-            orgX := hScrollBar thumbOrigin.
+            scrollH := scrollV := false.
 
-            scroll := false.
-
-            orgY + vScrollBar thumbHeight >= 100 ifTrue:[
-                vScrollBar thumbOrigin:(100 - vScrollBar thumbHeight).
+            orgY + thV >= 100 ifTrue:[
+                vScrollBar thumbOrigin:(100 - thV).
                 orgY := vScrollBar thumbOrigin.
-                scroll := true.
+                scrollV := true.
             ].
-            orgX + hScrollBar thumbHeight >= 100 ifTrue:[
-                hScrollBar thumbOrigin:(100 - hScrollBar thumbHeight).
+            orgX + thH >= 100 ifTrue:[
+                hScrollBar thumbOrigin:(100 - thH).
                 orgX := hScrollBar thumbOrigin.
-                scroll := true.
+                scrollH := true.
             ].
-            scroll ifTrue:[
-                scrolledView scrollToPercent:(orgX@orgY).
-            ].
+            scrollV ifTrue:[
+                scrollH ifTrue:[
+                    scrolledView scrollToPercent:(orgX@orgY).
+                ] ifFalse:[
+                    scrolledView scrollVerticalToPercent:orgY.
+                ]
+            ] ifFalse:[
+                scrollH ifTrue:[
+                    scrolledView scrollHorizontalToPercent:orgX.
+                ]
+            ]
         ]
     ].
     self updateScrollBarVisibility.
@@ -2096,5 +2105,5 @@
 !ScrollableView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Attic/ScrView.st,v 1.99 1999-07-12 14:23:55 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Attic/ScrView.st,v 1.100 1999-08-17 10:59:01 cg Exp $'
 ! !
--- a/ScrollableView.st	Thu Aug 12 16:08:21 1999 +0200
+++ b/ScrollableView.st	Tue Aug 17 12:59:01 1999 +0200
@@ -1333,7 +1333,7 @@
 sizeChanged:how
     "handle size changes - this may change any scrollBars visibility"
 
-    |orgX orgY scroll|
+    |orgX orgY thV thH scrollH scrollV|
 
     "/ resize components manually, in an order which is optimal
 
@@ -1368,47 +1368,56 @@
 
     vScrollBar notNil ifTrue:[
         vScrollBar setThumbFor:scrolledView.
+        orgY := vScrollBar thumbOrigin.
+        thV := vScrollBar thumbHeight.
     ].
     hScrollBar notNil ifTrue:[
         hScrollBar setThumbFor:scrolledView.
+        orgX := hScrollBar thumbOrigin.
+        thH := hScrollBar thumbHeight.
     ].
 
     "/ splitted, since there are optimized scrollProcedures for each case ...
 
     hScrollBar isNil ifTrue:[
         "/ only care for vertical ...
-        vScrollBar thumbOrigin + vScrollBar thumbHeight >= 100 ifTrue:[
-            vScrollBar thumbOrigin:(100 - vScrollBar thumbHeight).
+        orgY + thV >= 100 ifTrue:[
+            vScrollBar thumbOrigin:(100 - thV).
             scrolledView scrollVerticalToPercent:vScrollBar thumbOrigin.
         ].
     ] ifFalse:[
         vScrollBar isNil ifTrue:[
             "/ only care for horizontal ...
-            hScrollBar thumbOrigin + hScrollBar thumbHeight >= 100 ifTrue:[
-                hScrollBar thumbOrigin:(100 - hScrollBar thumbHeight).
-                scrolledView scrollVerticalToPercent:hScrollBar thumbOrigin.
+            orgX + thH >= 100 ifTrue:[
+                hScrollBar thumbOrigin:(100 - thH).
+                scrolledView scrollHorizontalToPercent:hScrollBar thumbOrigin.
             ].
         ] ifFalse:[
             "/ care for both ...
 
-            orgY := vScrollBar thumbOrigin.
-            orgX := hScrollBar thumbOrigin.
+            scrollH := scrollV := false.
 
-            scroll := false.
-
-            orgY + vScrollBar thumbHeight >= 100 ifTrue:[
-                vScrollBar thumbOrigin:(100 - vScrollBar thumbHeight).
+            orgY + thV >= 100 ifTrue:[
+                vScrollBar thumbOrigin:(100 - thV).
                 orgY := vScrollBar thumbOrigin.
-                scroll := true.
+                scrollV := true.
             ].
-            orgX + hScrollBar thumbHeight >= 100 ifTrue:[
-                hScrollBar thumbOrigin:(100 - hScrollBar thumbHeight).
+            orgX + thH >= 100 ifTrue:[
+                hScrollBar thumbOrigin:(100 - thH).
                 orgX := hScrollBar thumbOrigin.
-                scroll := true.
+                scrollH := true.
             ].
-            scroll ifTrue:[
-                scrolledView scrollToPercent:(orgX@orgY).
-            ].
+            scrollV ifTrue:[
+                scrollH ifTrue:[
+                    scrolledView scrollToPercent:(orgX@orgY).
+                ] ifFalse:[
+                    scrolledView scrollVerticalToPercent:orgY.
+                ]
+            ] ifFalse:[
+                scrollH ifTrue:[
+                    scrolledView scrollHorizontalToPercent:orgX.
+                ]
+            ]
         ]
     ].
     self updateScrollBarVisibility.
@@ -2096,5 +2105,5 @@
 !ScrollableView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/ScrollableView.st,v 1.99 1999-07-12 14:23:55 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/ScrollableView.st,v 1.100 1999-08-17 10:59:01 cg Exp $'
 ! !