ViewScroller.st
changeset 424 c66e66d82e02
parent 236 20dba8483ad7
child 425 be88918a571b
--- a/ViewScroller.st	Tue Jun 17 13:37:08 1997 +0200
+++ b/ViewScroller.st	Tue Jun 17 20:55:46 1997 +0200
@@ -17,7 +17,7 @@
 	category:'Views-Basic'
 !
 
-!ViewScroller  class methodsFor:'documentation'!
+!ViewScroller class methodsFor:'documentation'!
 
 copyright
 "
@@ -151,6 +151,12 @@
 
 !ViewScroller methodsFor:'accessing'!
 
+scrolledView
+    "return the view which is scrolled"
+
+    ^ scrolledView 
+!
+
 scrolledView:aView
     "set the view to be scrolled"
 
@@ -205,6 +211,7 @@
 heightOfContents
     "return my contents' height; this is the scrolledViews height"
 
+    scrolledView isNil ifTrue:[^ super heightOfContents].
     ^ scrolledView height
 
     "Modified: 24.5.1996 / 17:34:48 / cg"
@@ -213,6 +220,7 @@
 viewOrigin
     "the viewOrigin (for scrollBars) is based upon the scrolledViews origin"
 
+    scrolledView isNil ifTrue:[^ 0@0].
     ^ scrolledView origin negated
 
     "Modified: 24.5.1996 / 17:48:13 / cg"
@@ -221,6 +229,7 @@
 widthOfContents
     "return my contents' width; this is the scrolledViews width"
 
+    scrolledView isNil ifTrue:[^ super widthOfContents].
     ^ scrolledView width
 
     "Modified: 24.5.1996 / 17:34:56 / cg"
@@ -228,6 +237,12 @@
 
 !ViewScroller methodsFor:'scrolling'!
 
+horizontalScrollStep
+    "return the amount by which to step-scroll horizontally"
+
+    ^ self width // 2
+!
+
 scrollTo:aPoint
     "change origin of scrolledView to scroll to aPoint"
 
@@ -235,6 +250,8 @@
      iw ih       "{ Class:SmallInteger }"
      viewOrigin orgX orgY newX newY|
 
+    scrolledView isNil ifTrue:[^ self].
+
     viewOrigin := scrolledView origin.
     orgX := viewOrigin x negated.
     orgY := viewOrigin y negated.
@@ -264,10 +281,16 @@
     self originChanged:((newX-orgX) negated @ (newY-orgY) negated).
 
     "Modified: 21.8.1996 / 09:17:49 / stefan"
+!
+
+verticalScrollStep
+    "return the amount by which to step-scroll vertically"
+
+    ^ self height // 2
 ! !
 
-!ViewScroller  class methodsFor:'documentation'!
+!ViewScroller class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/ViewScroller.st,v 1.10 1996-08-21 08:15:42 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/ViewScroller.st,v 1.11 1997-06-17 18:55:46 ca Exp $'
 ! !