HVScrollableView.st
changeset 216 d35b116e03a6
parent 174 d80a6cc3f9b2
child 572 121735c2aff6
--- a/HVScrollableView.st	Mon Nov 27 21:32:45 1995 +0100
+++ b/HVScrollableView.st	Mon Nov 27 23:28:58 1995 +0100
@@ -11,10 +11,10 @@
 "
 
 ScrollableView subclass:#HVScrollableView
-       instanceVariableNames:'hScrollBar'
-       classVariableNames:''
-       poolDictionaries:''
-       category:'Views-Basic'
+	 instanceVariableNames:'hScrollBar'
+	 classVariableNames:''
+	 poolDictionaries:''
+	 category:'Views-Basic'
 !
 
 !HVScrollableView class methodsFor:'documentation'!
@@ -33,10 +33,6 @@
 "
 !
 
-version
-    ^ '$Header: /cvs/stx/stx/libwidg/HVScrollableView.st,v 1.13 1995-11-11 16:20:43 cg Exp $'
-!
-
 documentation
 "
     a view containing both horizontal and vertical scrollbars
@@ -46,6 +42,83 @@
 "
 ! !
 
+!HVScrollableView methodsFor:'accessing'!
+
+horizontalScrollBar
+    "return the horizontal scrollbar"
+
+    ^ hScrollBar
+!
+
+scrolledView:aView
+    "set the scrolled view"
+
+    super scrolledView:aView.
+
+    "redefine subviews size"
+    styleSheet is3D ifTrue:[
+	scrolledView 
+	    extent:[(width 
+		     - scrollBar width 
+		     - (innerMargin * 2))
+		    @
+		    (height 
+		     - hScrollBar height 
+		     - (innerMargin * 2))
+		    ]
+    ] ifFalse:[
+	scrolledView
+	    extent:[(width
+		     - scrollBar width
+		     - scrollBar borderWidth
+		     "- scrolledView borderWidth") 
+		    @ 
+		    (height
+		     - hScrollBar height
+		     - hScrollBar borderWidth
+		     "- scrolledView borderWidth")
+		   ]
+    ].
+    self setScrollActions
+! !
+
+!HVScrollableView methodsFor:'changes '!
+
+update:something with:argument from:changedObject
+    "whenever the scrolledview changes its contents, we have to
+     update the scrollers too"
+
+    changedObject == scrolledView ifTrue:[
+	something == #sizeOfContents ifTrue:[
+	    scrollBar setThumbFor:scrolledView.
+	    hScrollBar setThumbFor:scrolledView.
+	    ^ self
+	].
+	something == #originOfContents ifTrue:[
+	    lockUpdates ifFalse:[
+		scrollBar setThumbOriginFor:scrolledView.
+		hScrollBar setThumbOriginFor:scrolledView.
+	    ].
+	    ^ self
+	].
+    ].
+! !
+
+!HVScrollableView methodsFor:'event processing'!
+
+sizeChanged:how
+    super sizeChanged:how.
+    scrolledView notNil ifTrue:[
+	hScrollBar setThumbFor:scrolledView
+    ].
+    hScrollBar thumbOrigin + hScrollBar thumbHeight >= 100 ifTrue:[
+	hScrollBar thumbOrigin:(100 - hScrollBar thumbHeight).
+	scrolledView scrollHorizontalToPercent:hScrollBar thumbOrigin.
+    ].
+
+    "Modified: 8.9.1995 / 12:46:36 / claus"
+! !
+
 !HVScrollableView methodsFor:'initialization'!
 
 initializeFor:aViewClass miniScrollerH:miniH miniScrollerV:miniV
@@ -188,46 +261,6 @@
     scrolledView addDependent:self.
 ! !
 
-!HVScrollableView methodsFor:'accessing'!
-
-horizontalScrollBar
-    "return the horizontal scrollbar"
-
-    ^ hScrollBar
-!
-
-scrolledView:aView
-    "set the scrolled view"
-
-    super scrolledView:aView.
-
-    "redefine subviews size"
-    styleSheet is3D ifTrue:[
-	scrolledView 
-	    extent:[(width 
-		     - scrollBar width 
-		     - (innerMargin * 2))
-		    @
-		    (height 
-		     - hScrollBar height 
-		     - (innerMargin * 2))
-		    ]
-    ] ifFalse:[
-	scrolledView
-	    extent:[(width
-		     - scrollBar width
-		     - scrollBar borderWidth
-		     "- scrolledView borderWidth") 
-		    @ 
-		    (height
-		     - hScrollBar height
-		     - hScrollBar borderWidth
-		     "- scrolledView borderWidth")
-		   ]
-    ].
-    self setScrollActions
-! !
-
 !HVScrollableView methodsFor:'queries'!
 
 preferredExtent
@@ -243,39 +276,8 @@
     ^ super preferredExtent.
 ! !
 
-!HVScrollableView methodsFor:'changes '!
-
-update:something with:argument from:changedObject
-    "whenever the scrolledview changes its contents, we have to
-     update the scrollers too"
+!HVScrollableView class methodsFor:'documentation'!
 
-    changedObject == scrolledView ifTrue:[
-	something == #sizeOfContents ifTrue:[
-	    scrollBar setThumbFor:scrolledView.
-	    hScrollBar setThumbFor:scrolledView.
-	    ^ self
-	].
-	something == #originOfContents ifTrue:[
-	    lockUpdates ifFalse:[
-		scrollBar setThumbOriginFor:scrolledView.
-		hScrollBar setThumbOriginFor:scrolledView.
-	    ].
-	    ^ self
-	].
-    ].
+version
+    ^ '$Header: /cvs/stx/stx/libwidg/HVScrollableView.st,v 1.14 1995-11-27 22:28:01 cg Exp $'
 ! !
-
-!HVScrollableView methodsFor:'event processing'!
-
-sizeChanged:how
-    super sizeChanged:how.
-    scrolledView notNil ifTrue:[
-	hScrollBar setThumbFor:scrolledView
-    ].
-    hScrollBar thumbOrigin + hScrollBar thumbHeight >= 100 ifTrue:[
-	hScrollBar thumbOrigin:(100 - hScrollBar thumbHeight).
-	scrolledView scrollHorizontalToPercent:hScrollBar thumbOrigin.
-    ].
-
-    "Modified: 8.9.1995 / 12:46:36 / claus"
-! !