HVScrollableView.st
changeset 818 e922d238966c
parent 814 5b80bc44f52b
child 845 ab868eb2c7cd
--- a/HVScrollableView.st	Fri Aug 02 21:03:07 1996 +0200
+++ b/HVScrollableView.st	Mon Aug 05 13:48:39 1996 +0200
@@ -112,16 +112,34 @@
 !HVScrollableView methodsFor:'event processing'!
 
 sizeChanged:how
+    |orgY orgX scroll|
+
     super sizeChanged:how.
     scrolledView notNil ifTrue:[
-	hScrollBar setThumbFor:scrolledView
-    ].
-    hScrollBar thumbOrigin + hScrollBar thumbHeight >= 100 ifTrue:[
-	hScrollBar thumbOrigin:(100 - hScrollBar thumbHeight).
-	scrolledView scrollHorizontalToPercent:hScrollBar thumbOrigin.
+        scrollBar setThumbFor:scrolledView.
+        hScrollBar setThumbFor:scrolledView.
+
+        orgY := scrollBar thumbOrigin.
+        orgX := hScrollBar thumbOrigin.
+        scroll := false.
+
+        orgY + scrollBar thumbHeight >= 100 ifTrue:[
+            scrollBar thumbOrigin:(100 - scrollBar thumbHeight).
+            orgY := scrollBar thumbOrigin.
+            scroll := true.
+        ].
+        orgX + hScrollBar thumbHeight >= 100 ifTrue:[
+            hScrollBar thumbOrigin:(100 - hScrollBar thumbHeight).
+            orgX := hScrollBar thumbOrigin.
+            scroll := true.
+        ].
+        scroll ifTrue:[
+            scrolledView scrollToPercent:(orgX@orgY).
+        ].
     ].
 
     "Modified: 8.9.1995 / 12:46:36 / claus"
+    "Modified: 5.8.1996 / 12:18:52 / stefan"
 ! !
 
 !HVScrollableView methodsFor:'initialization'!
@@ -280,6 +298,14 @@
 
 !HVScrollableView methodsFor:'queries'!
 
+isHorizontalScrollable
+    "return true, because I am horizontal scrollable"
+
+    ^ true
+
+    "Modified: 5.8.1996 / 12:29:10 / stefan"
+!
+
 preferredExtent
     "return the components preferredExtent."
 
@@ -324,5 +350,5 @@
 !HVScrollableView  class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/HVScrollableView.st,v 1.20 1996-08-01 16:25:08 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/HVScrollableView.st,v 1.21 1996-08-05 11:48:39 stefan Exp $'
 ! !