HVScrollableView.st
changeset 814 5b80bc44f52b
parent 802 332e7013a9f5
child 818 e922d238966c
--- a/HVScrollableView.st	Thu Aug 01 18:24:25 1996 +0200
+++ b/HVScrollableView.st	Thu Aug 01 18:25:33 1996 +0200
@@ -60,29 +60,31 @@
 
     "redefine subviews size"
     styleSheet is3D ifTrue:[
-	scrolledView 
-	    extent:[(width 
-		     - scrollBar width 
-		     - (innerMargin * 2))
-		    @
-		    (height 
-		     - hScrollBar height 
-		     - (innerMargin * 2))
-		    ]
+        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")
-		   ]
+        scrolledView
+            extent:[(width
+                     - scrollBar width
+                     - scrollBar borderWidth
+                     "- scrolledView borderWidth") 
+                    @ 
+                    (height
+                     - hScrollBar height
+                     - hScrollBar borderWidth
+                     "- scrolledView borderWidth")
+                   ]
     ].
-    self setScrollActions
+    self setScrollActions.
+
+    "Modified: 1.8.1996 / 12:44:37 / cg"
 ! !
 
 !HVScrollableView methodsFor:'changes '!
@@ -131,17 +133,17 @@
     isST80 := StyleSheet name = #st80.  "leftover - remove it"
 
     isST80 ifTrue:[
-	cls := HorizontalScrollBar
+        cls := HorizontalScrollBar
     ] ifFalse:[
-	cls := miniH ifTrue:[HorizontalMiniScroller] ifFalse:[HorizontalScrollBar].
+        cls := miniH ifTrue:[HorizontalMiniScroller] ifFalse:[HorizontalScrollBar].
     ].
 
     hScrollBar := cls in:self.
 
     super 
-	initializeFor:aViewClass 
-	miniScrollerH:miniH 
-	miniScrollerV:miniV.
+        initializeFor:aViewClass 
+        miniScrollerH:miniH 
+        miniScrollerV:miniV.
 
     negativeOffset := borderWidth negated.
     halfMargin := innerMargin // 2.
@@ -156,83 +158,85 @@
     hBorderWidth := mrg.
 
     is3D ifTrue:[
-	isST80 ifTrue:[
-	    halfSpacing := 0
-	] ifFalse:[
-	    mrg := mrg + innerMargin + innerMargin.
-	    halfSpacing := ViewSpacing // 2.
-	].
+        isST80 ifTrue:[
+            halfSpacing := 0
+        ] ifFalse:[
+            mrg := mrg + innerMargin + innerMargin.
+            halfSpacing := ViewSpacing // 2.
+        ].
     ].
 
     extra := 0.
     isOpenWin ifTrue:[
-	extra := 2.
+        extra := 2.
     ].
 
     scrollBar extent:[scrollBar width 
-		      @ 
-		     (height - hScrollBar height - mrg + extra)].
+                      @ 
+                     (height - hScrollBar height - mrg + extra)].
 
     hScrollBar thumbOrigin:0 thumbHeight:100.
 
     scrollBarPosition == #left ifTrue:[
-	orgX := scrollBar origin x + scrollBar width.
-	is3D ifTrue:[
-	    orgX := orgX + halfSpacing + 1.
-	    isST80 ifTrue:[
-		orgX := orgX - (scrolledView margin)
-	    ]
-	]
+        orgX := scrollBar origin x + scrollBar width.
+        is3D ifTrue:[
+            orgX := orgX + halfSpacing + 1.
+            isST80 ifTrue:[
+                orgX := orgX - (scrolledView margin)
+            ]
+        ]
     ] ifFalse:[
-	orgX := 0 - hBorderWidth.
+        orgX := 0 - hBorderWidth.
 "/      isST80 ifTrue:[
 "/            orgX := orgX + 1
 "/      ]
     ].
     isOpenWin ifTrue:[
-	orgX := orgX + 1
+        orgX := orgX + 1
     ].
 
     is3D ifTrue:[
-	hScrollBar origin:[(orgX + innerMargin - halfSpacing - hScrollBar margin)
-			   @
-			   (height - hScrollBar height - halfMargin)
-			  ]
-		   extent:[(width - scrollBar width - (innerMargin * 2) + extra)
-			   @
-			   hScrollBar height
-			  ]
+        hScrollBar origin:[(orgX + innerMargin - halfSpacing - hScrollBar margin)
+                           @
+                           (height - hScrollBar height - halfMargin)
+                          ]
+                   extent:[(width - scrollBar width - (innerMargin * 2) + extra)
+                           @
+                           hScrollBar height
+                          ]
     ] ifFalse:[
-	scrollBarPosition == #left ifTrue:[
-	    hScrollBar 
-		origin:[(orgX + scrollBar borderWidth)
-			@
-			(height - hScrollBar height - hBorderWidth)
-		       ]
-		extent:[(width - scrollBar width) @ hScrollBar height]
-	] ifFalse:[
-	    hScrollBar 
-		origin:[orgX @ (height - hScrollBar height - hBorderWidth) ]
-		extent:[(width - scrollBar width - hBorderWidth) @ hScrollBar height]
-	]
+        scrollBarPosition == #left ifTrue:[
+            hScrollBar 
+                origin:[(orgX + scrollBar borderWidth)
+                        @
+                        (height - hScrollBar height - hBorderWidth)
+                       ]
+                extent:[(width - scrollBar width) @ hScrollBar height]
+        ] ifFalse:[
+            hScrollBar 
+                origin:[orgX @ (height - hScrollBar height - hBorderWidth) ]
+                extent:[(width - scrollBar width - hBorderWidth) @ hScrollBar height]
+        ]
     ].
 
     scrolledView notNil ifTrue:[
-	"redefine subviews size"
-	is3D ifTrue:[
-	    scrolledView 
-		extent:[(width - scrollBar width - (innerMargin * 2))
-			@
-			(height - hScrollBar height - (innerMargin * 2)) ]
-	] ifFalse:[
-	    scrolledView
-		extent:[(width - scrollBar width - scrollBar borderWidth) 
-			@ 
-			(height - hScrollBar height - hScrollBar borderWidth)
-		       ]
-	].
-	self setScrollActions
+        "redefine subviews size"
+        is3D ifTrue:[
+            scrolledView 
+                extent:[(width - scrollBar width - (innerMargin * 2))
+                        @
+                        (height - hScrollBar height - (innerMargin * 2)) ]
+        ] ifFalse:[
+            scrolledView
+                extent:[(width - scrollBar width - scrollBar borderWidth) 
+                        @ 
+                        (height - hScrollBar height - hScrollBar borderWidth)
+                       ]
+        ].
+        self setScrollActions.
     ]
+
+    "Modified: 1.8.1996 / 12:44:41 / cg"
 !
 
 realize
@@ -245,23 +249,33 @@
 !HVScrollableView methodsFor:'private'!
 
 setScrollActions
+    lockUpdates := false.
+
     scrollBar scrollAction:[:position |
-	lockUpdates := true.
-	scrolledView scrollVerticalToPercent:position.
-	lockUpdates := false
+        lockUpdates := true.
+        scrolledView scrollVerticalToPercent:position.
+        lockUpdates := false
     ].
     scrollBar scrollUpAction:[scrolledView scrollUp].
     scrollBar scrollDownAction:[scrolledView scrollDown].
 
     hScrollBar scrollAction:[:position |
-	lockUpdates := true.
-	scrolledView scrollHorizontalToPercent:position.
-	lockUpdates := false
+        lockUpdates := true.
+        scrolledView scrollHorizontalToPercent:position.
+        lockUpdates := false
     ].
     hScrollBar scrollLeftAction:[scrolledView scrollLeft].
     hScrollBar scrollRightAction:[scrolledView scrollRight].
 
     scrolledView addDependent:self.
+
+    "
+     pass my keyboard input (and other subviews input) 
+     to the scrolled view ...
+    "
+    self delegate:(KeyboardForwarder toView:scrolledView).
+
+    "Modified: 1.8.1996 / 12:44:16 / cg"
 ! !
 
 !HVScrollableView methodsFor:'queries'!
@@ -310,5 +324,5 @@
 !HVScrollableView  class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/HVScrollableView.st,v 1.19 1996-07-22 08:56:41 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/HVScrollableView.st,v 1.20 1996-08-01 16:25:08 cg Exp $'
 ! !