share code
authorClaus Gittinger <cg@exept.de>
Thu, 01 Aug 1996 18:25:33 +0200
changeset 814 5b80bc44f52b
parent 813 7168eda47e3b
child 815 38082a0ff5c9
share code
HVScrView.st
HVScrollableView.st
ScrView.st
ScrollableView.st
--- a/HVScrView.st	Thu Aug 01 18:24:25 1996 +0200
+++ b/HVScrView.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/Attic/HVScrView.st,v 1.19 1996-07-22 08:56:41 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Attic/HVScrView.st,v 1.20 1996-08-01 16:25:08 cg Exp $'
 ! !
--- 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 $'
 ! !
--- a/ScrView.st	Thu Aug 01 18:24:25 1996 +0200
+++ b/ScrView.st	Thu Aug 01 18:25:33 1996 +0200
@@ -543,87 +543,83 @@
     |halfMargin twoMargins isOpenwin|
 
     scrolledView notNil ifTrue:[
-	scrolledView destroy.
-	scrolledView := nil.
+        scrolledView destroy.
+        scrolledView := nil.
     ].
     scrolledView := aView.
 
 "/    ((style ~~ #normal) and:[style ~~ #mswindows]) ifTrue:[
     styleSheet is3D ifTrue:[
-	"3D look"
+        "3D look"
 
-	isOpenwin := styleSheet name = #openwin.
+        isOpenwin := styleSheet name = #openwin.
 
-	twoMargins := innerMargin * 2.
-	halfMargin := innerMargin // 2.
+        twoMargins := innerMargin * 2.
+        halfMargin := innerMargin // 2.
 
-	isOpenwin ifTrue:[
-	    scrolledView level:0.
-	    scrolledView borderWidth:1
-	] ifFalse:[
-	    scrolledView level:DefaultScrolledViewLevel.
+        isOpenwin ifTrue:[
+            scrolledView level:0.
+            scrolledView borderWidth:1
+        ] ifFalse:[
+            scrolledView level:DefaultScrolledViewLevel.
 "/            scrolledView level:-1
-	].
+        ].
 
-	(scrollBarPosition == #right) ifTrue:[
-	    scrolledView 
-		origin:halfMargin asPoint
-		extent:[(width - 
-			 scrollBar width - 
-			 twoMargins) 
-			@ 
-			(height - innerMargin)
-		       ].
-	] ifFalse:[
-	    scrolledView 
-		origin:((scrollBar origin x 
-			 + scrollBar width 
-			 + innerMargin)
-			@
-			halfMargin)
-		extent:[(width 
-			 - scrollBar width 
-			 - twoMargins) 
-			@ 
-			(height - innerMargin)
-		       ].
-	]
+        (scrollBarPosition == #right) ifTrue:[
+            scrolledView 
+                origin:halfMargin asPoint
+                extent:[(width - 
+                         scrollBar width - 
+                         twoMargins) 
+                        @ 
+                        (height - innerMargin)
+                       ].
+        ] ifFalse:[
+            scrolledView 
+                origin:((scrollBar origin x 
+                         + scrollBar width 
+                         + innerMargin)
+                        @
+                        halfMargin)
+                extent:[(width 
+                         - scrollBar width 
+                         - twoMargins) 
+                        @ 
+                        (height - innerMargin)
+                       ].
+        ]
     ] ifFalse:[
-	"non 3D look"
-	(scrollBarPosition == #right) ifTrue:[
-	    scrolledView 
-		origin:scrolledView borderWidth negated asPoint
-	] ifFalse:[
-	    scrolledView 
-		origin:((scrollBar width 
-			 + scrollBar borderWidth 
-			 - scrolledView borderWidth) 
-			@ 
-			scrolledView borderWidth negated)
-	].
-	scrolledView 
-	    extent:[
-		    (width 
-		     - scrollBar width 
-		     - scrolledView borderWidth) 
-		    @ 
-		    (height + (scrollBar borderWidth))
-		   ]
+        "non 3D look"
+        (scrollBarPosition == #right) ifTrue:[
+            scrolledView 
+                origin:scrolledView borderWidth negated asPoint
+        ] ifFalse:[
+            scrolledView 
+                origin:((scrollBar width 
+                         + scrollBar borderWidth 
+                         - scrolledView borderWidth) 
+                        @ 
+                        scrolledView borderWidth negated)
+        ].
+        scrolledView 
+            extent:[
+                    (width 
+                     - scrollBar width 
+                     - scrolledView borderWidth) 
+                    @ 
+                    (height + (scrollBar borderWidth))
+                   ]
     ].
 
     super addSubView:scrolledView.
     self setScrollActions.
 
-    "
-     pass my keyboard input (and other subviews input) 
-     to the scrolled view ...
-    "
-    self delegate:(KeyboardForwarder toView:scrolledView).
+    realized ifTrue:[
+        self sizeChanged:nil.
+        scrolledView realize
+    ].
 
-    realized ifTrue:[
-	self sizeChanged:nil.
-	scrolledView realize
-    ].
+    "Modified: 1.8.1996 / 12:44:27 / cg"
 ! !
 
 !ScrollableView methodsFor:'changes '!
@@ -721,22 +717,22 @@
     is3D := styleSheet is3D.
 
     isST80 ifTrue:[
-	innerMargin := 0
+        innerMargin := 0
     ] ifFalse:[
-	is3D ifTrue:[
-	    innerMargin := ViewSpacing.
-	] ifFalse:[
-	    innerMargin := 0    
-	]
+        is3D ifTrue:[
+            innerMargin := ViewSpacing.
+        ] ifFalse:[
+            innerMargin := 0    
+        ]
     ].
     negativeOffset := borderWidth negated.
 
     "create the scrollbar"
 
     isST80 ifTrue:[
-	cls := ScrollBar
+        cls := ScrollBar
     ] ifFalse:[
-	cls := miniV ifTrue:[MiniScroller] ifFalse:[ScrollBar].
+        cls := miniV ifTrue:[MiniScroller] ifFalse:[ScrollBar].
     ].
 
     scrollBar := cls in:self.
@@ -746,17 +742,17 @@
 
     "create the subview"
     is3D ifTrue:[
-	twoMargins := innerMargin * 2.
-	halfMargin := innerMargin // 2.
+        twoMargins := innerMargin * 2.
+        halfMargin := innerMargin // 2.
 
-	aViewClass notNil ifTrue:[
-	    scrolledView := aViewClass in:self.
-	    isOpenWin ifTrue:[
-		lvl := 0.
-		"/ scrolledView level:0.
-		scrolledView borderWidth:1.
-	    ] ifFalse:[
-		lvl := DefaultScrolledViewLevel.
+        aViewClass notNil ifTrue:[
+            scrolledView := aViewClass in:self.
+            isOpenWin ifTrue:[
+                lvl := 0.
+                "/ scrolledView level:0.
+                scrolledView borderWidth:1.
+            ] ifFalse:[
+                lvl := DefaultScrolledViewLevel.
 "/                isST80 ifTrue:[
 "/                    "/ scrolledView level:1.
 "/                    lvl := 1.
@@ -764,80 +760,77 @@
 "/                    "/ scrolledView level:-1
 "/                     lvl := -1
 "/                ]
-	    ].
-	    scrolledView level:lvl.
-	    extra := scrolledView borderWidth * 2.
-	].
+            ].
+            scrolledView level:lvl.
+            extra := scrolledView borderWidth * 2.
+        ].
 
-	scrollBar extent:[scrollBar extent x
-			  @ 
-			  (height - innerMargin "new:" + extra)].
-	scrolledView notNil ifTrue:[
-	    scrolledView
-		extent:[(width 
-			 - scrollBar width 
-			 - twoMargins) 
-			@ 
-			(height - innerMargin)].
-	].
+        scrollBar extent:[scrollBar extent x
+                          @ 
+                          (height - innerMargin "new:" + extra)].
+        scrolledView notNil ifTrue:[
+            scrolledView
+                extent:[(width 
+                         - scrollBar width 
+                         - twoMargins) 
+                        @ 
+                        (height - innerMargin)].
+        ].
 
-	(scrollBarPosition == #right) ifTrue:[
-	    scrollBar origin:[width - scrollBar extent x 
-				    - (scrollBar borderWidth * 2)
-				    - halfMargin
-			      @
-			      halfMargin].
+        (scrollBarPosition == #right) ifTrue:[
+            scrollBar origin:[width - scrollBar extent x 
+                                    - (scrollBar borderWidth * 2)
+                                    - halfMargin
+                              @
+                              halfMargin].
 
-	    scrolledView notNil ifTrue:[
-		scrolledView origin:halfMargin asPoint
-		]
-	] ifFalse:[
-	    scrollBar origin:halfMargin asPoint.
+            scrolledView notNil ifTrue:[
+                scrolledView origin:halfMargin asPoint
+                ]
+        ] ifFalse:[
+            scrollBar origin:halfMargin asPoint.
 
-	    scrolledView notNil ifTrue:[
-		scrolledView origin:((scrollBar origin x + scrollBar width + innerMargin)
-				     @
-				     halfMargin)
-	    ]
-	].
+            scrolledView notNil ifTrue:[
+                scrolledView origin:((scrollBar origin x + scrollBar width + innerMargin)
+                                     @
+                                     halfMargin)
+            ]
+        ].
     ] ifFalse:[
-	(scrollBarPosition == #right) ifTrue:[
-	    scrollBar origin:[width - scrollBar extent x 
-				    - scrollBar borderWidth
-			      @
-			      negativeOffset]
-	] ifFalse:[
-	    scrollBar origin:negativeOffset asPoint
-	].
-	scrollBar extent:[scrollBar extent x 
-			  @ 
-			  (height "+ (scrollBar borderWidth * 1)")].
+        (scrollBarPosition == #right) ifTrue:[
+            scrollBar origin:[width - scrollBar extent x 
+                                    - scrollBar borderWidth
+                              @
+                              negativeOffset]
+        ] ifFalse:[
+            scrollBar origin:negativeOffset asPoint
+        ].
+        scrollBar extent:[scrollBar extent x 
+                          @ 
+                          (height "+ (scrollBar borderWidth * 1)")].
 
-	aViewClass notNil ifTrue:[
-	    scrolledView := aViewClass in:self.
-	    (scrollBarPosition == #right) ifTrue:[
-		scrolledView origin:scrolledView borderWidth negated asPoint
-	    ] ifFalse:[
-		scrolledView origin:((scrollBar width + 
-				      scrollBar borderWidth - 
-				      scrolledView borderWidth) 
-				    @ 
-				    scrolledView borderWidth negated)
-	    ].
-	    scrolledView extent:[(width - scrollBar width - scrolledView borderWidth) 
-				 @ 
-				 (height + (scrollBar borderWidth))
-				]
-	].
+        aViewClass notNil ifTrue:[
+            scrolledView := aViewClass in:self.
+            (scrollBarPosition == #right) ifTrue:[
+                scrolledView origin:scrolledView borderWidth negated asPoint
+            ] ifFalse:[
+                scrolledView origin:((scrollBar width + 
+                                      scrollBar borderWidth - 
+                                      scrolledView borderWidth) 
+                                    @ 
+                                    scrolledView borderWidth negated)
+            ].
+            scrolledView extent:[(width - scrollBar width - scrolledView borderWidth) 
+                                 @ 
+                                 (height + (scrollBar borderWidth))
+                                ]
+        ].
     ].
     scrolledView notNil ifTrue:[
-	self setScrollActions.
-	"
-	 pass my keyboard input (and other subviews input) 
-	 to the scrolled view ...
-	"
-	self delegate:(KeyboardForwarder toView:scrolledView).
+        self setScrollActions.
     ]
+
+    "Modified: 1.8.1996 / 12:44:32 / cg"
 !
 
 realize
@@ -866,14 +859,22 @@
     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].
 
     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:21 / cg"
 ! !
 
 !ScrollableView methodsFor:'queries'!
@@ -985,5 +986,5 @@
 !ScrollableView  class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Attic/ScrView.st,v 1.37 1996-07-19 18:55:12 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Attic/ScrView.st,v 1.38 1996-08-01 16:25:33 cg Exp $'
 ! !
--- a/ScrollableView.st	Thu Aug 01 18:24:25 1996 +0200
+++ b/ScrollableView.st	Thu Aug 01 18:25:33 1996 +0200
@@ -543,87 +543,83 @@
     |halfMargin twoMargins isOpenwin|
 
     scrolledView notNil ifTrue:[
-	scrolledView destroy.
-	scrolledView := nil.
+        scrolledView destroy.
+        scrolledView := nil.
     ].
     scrolledView := aView.
 
 "/    ((style ~~ #normal) and:[style ~~ #mswindows]) ifTrue:[
     styleSheet is3D ifTrue:[
-	"3D look"
+        "3D look"
 
-	isOpenwin := styleSheet name = #openwin.
+        isOpenwin := styleSheet name = #openwin.
 
-	twoMargins := innerMargin * 2.
-	halfMargin := innerMargin // 2.
+        twoMargins := innerMargin * 2.
+        halfMargin := innerMargin // 2.
 
-	isOpenwin ifTrue:[
-	    scrolledView level:0.
-	    scrolledView borderWidth:1
-	] ifFalse:[
-	    scrolledView level:DefaultScrolledViewLevel.
+        isOpenwin ifTrue:[
+            scrolledView level:0.
+            scrolledView borderWidth:1
+        ] ifFalse:[
+            scrolledView level:DefaultScrolledViewLevel.
 "/            scrolledView level:-1
-	].
+        ].
 
-	(scrollBarPosition == #right) ifTrue:[
-	    scrolledView 
-		origin:halfMargin asPoint
-		extent:[(width - 
-			 scrollBar width - 
-			 twoMargins) 
-			@ 
-			(height - innerMargin)
-		       ].
-	] ifFalse:[
-	    scrolledView 
-		origin:((scrollBar origin x 
-			 + scrollBar width 
-			 + innerMargin)
-			@
-			halfMargin)
-		extent:[(width 
-			 - scrollBar width 
-			 - twoMargins) 
-			@ 
-			(height - innerMargin)
-		       ].
-	]
+        (scrollBarPosition == #right) ifTrue:[
+            scrolledView 
+                origin:halfMargin asPoint
+                extent:[(width - 
+                         scrollBar width - 
+                         twoMargins) 
+                        @ 
+                        (height - innerMargin)
+                       ].
+        ] ifFalse:[
+            scrolledView 
+                origin:((scrollBar origin x 
+                         + scrollBar width 
+                         + innerMargin)
+                        @
+                        halfMargin)
+                extent:[(width 
+                         - scrollBar width 
+                         - twoMargins) 
+                        @ 
+                        (height - innerMargin)
+                       ].
+        ]
     ] ifFalse:[
-	"non 3D look"
-	(scrollBarPosition == #right) ifTrue:[
-	    scrolledView 
-		origin:scrolledView borderWidth negated asPoint
-	] ifFalse:[
-	    scrolledView 
-		origin:((scrollBar width 
-			 + scrollBar borderWidth 
-			 - scrolledView borderWidth) 
-			@ 
-			scrolledView borderWidth negated)
-	].
-	scrolledView 
-	    extent:[
-		    (width 
-		     - scrollBar width 
-		     - scrolledView borderWidth) 
-		    @ 
-		    (height + (scrollBar borderWidth))
-		   ]
+        "non 3D look"
+        (scrollBarPosition == #right) ifTrue:[
+            scrolledView 
+                origin:scrolledView borderWidth negated asPoint
+        ] ifFalse:[
+            scrolledView 
+                origin:((scrollBar width 
+                         + scrollBar borderWidth 
+                         - scrolledView borderWidth) 
+                        @ 
+                        scrolledView borderWidth negated)
+        ].
+        scrolledView 
+            extent:[
+                    (width 
+                     - scrollBar width 
+                     - scrolledView borderWidth) 
+                    @ 
+                    (height + (scrollBar borderWidth))
+                   ]
     ].
 
     super addSubView:scrolledView.
     self setScrollActions.
 
-    "
-     pass my keyboard input (and other subviews input) 
-     to the scrolled view ...
-    "
-    self delegate:(KeyboardForwarder toView:scrolledView).
+    realized ifTrue:[
+        self sizeChanged:nil.
+        scrolledView realize
+    ].
 
-    realized ifTrue:[
-	self sizeChanged:nil.
-	scrolledView realize
-    ].
+    "Modified: 1.8.1996 / 12:44:27 / cg"
 ! !
 
 !ScrollableView methodsFor:'changes '!
@@ -721,22 +717,22 @@
     is3D := styleSheet is3D.
 
     isST80 ifTrue:[
-	innerMargin := 0
+        innerMargin := 0
     ] ifFalse:[
-	is3D ifTrue:[
-	    innerMargin := ViewSpacing.
-	] ifFalse:[
-	    innerMargin := 0    
-	]
+        is3D ifTrue:[
+            innerMargin := ViewSpacing.
+        ] ifFalse:[
+            innerMargin := 0    
+        ]
     ].
     negativeOffset := borderWidth negated.
 
     "create the scrollbar"
 
     isST80 ifTrue:[
-	cls := ScrollBar
+        cls := ScrollBar
     ] ifFalse:[
-	cls := miniV ifTrue:[MiniScroller] ifFalse:[ScrollBar].
+        cls := miniV ifTrue:[MiniScroller] ifFalse:[ScrollBar].
     ].
 
     scrollBar := cls in:self.
@@ -746,17 +742,17 @@
 
     "create the subview"
     is3D ifTrue:[
-	twoMargins := innerMargin * 2.
-	halfMargin := innerMargin // 2.
+        twoMargins := innerMargin * 2.
+        halfMargin := innerMargin // 2.
 
-	aViewClass notNil ifTrue:[
-	    scrolledView := aViewClass in:self.
-	    isOpenWin ifTrue:[
-		lvl := 0.
-		"/ scrolledView level:0.
-		scrolledView borderWidth:1.
-	    ] ifFalse:[
-		lvl := DefaultScrolledViewLevel.
+        aViewClass notNil ifTrue:[
+            scrolledView := aViewClass in:self.
+            isOpenWin ifTrue:[
+                lvl := 0.
+                "/ scrolledView level:0.
+                scrolledView borderWidth:1.
+            ] ifFalse:[
+                lvl := DefaultScrolledViewLevel.
 "/                isST80 ifTrue:[
 "/                    "/ scrolledView level:1.
 "/                    lvl := 1.
@@ -764,80 +760,77 @@
 "/                    "/ scrolledView level:-1
 "/                     lvl := -1
 "/                ]
-	    ].
-	    scrolledView level:lvl.
-	    extra := scrolledView borderWidth * 2.
-	].
+            ].
+            scrolledView level:lvl.
+            extra := scrolledView borderWidth * 2.
+        ].
 
-	scrollBar extent:[scrollBar extent x
-			  @ 
-			  (height - innerMargin "new:" + extra)].
-	scrolledView notNil ifTrue:[
-	    scrolledView
-		extent:[(width 
-			 - scrollBar width 
-			 - twoMargins) 
-			@ 
-			(height - innerMargin)].
-	].
+        scrollBar extent:[scrollBar extent x
+                          @ 
+                          (height - innerMargin "new:" + extra)].
+        scrolledView notNil ifTrue:[
+            scrolledView
+                extent:[(width 
+                         - scrollBar width 
+                         - twoMargins) 
+                        @ 
+                        (height - innerMargin)].
+        ].
 
-	(scrollBarPosition == #right) ifTrue:[
-	    scrollBar origin:[width - scrollBar extent x 
-				    - (scrollBar borderWidth * 2)
-				    - halfMargin
-			      @
-			      halfMargin].
+        (scrollBarPosition == #right) ifTrue:[
+            scrollBar origin:[width - scrollBar extent x 
+                                    - (scrollBar borderWidth * 2)
+                                    - halfMargin
+                              @
+                              halfMargin].
 
-	    scrolledView notNil ifTrue:[
-		scrolledView origin:halfMargin asPoint
-		]
-	] ifFalse:[
-	    scrollBar origin:halfMargin asPoint.
+            scrolledView notNil ifTrue:[
+                scrolledView origin:halfMargin asPoint
+                ]
+        ] ifFalse:[
+            scrollBar origin:halfMargin asPoint.
 
-	    scrolledView notNil ifTrue:[
-		scrolledView origin:((scrollBar origin x + scrollBar width + innerMargin)
-				     @
-				     halfMargin)
-	    ]
-	].
+            scrolledView notNil ifTrue:[
+                scrolledView origin:((scrollBar origin x + scrollBar width + innerMargin)
+                                     @
+                                     halfMargin)
+            ]
+        ].
     ] ifFalse:[
-	(scrollBarPosition == #right) ifTrue:[
-	    scrollBar origin:[width - scrollBar extent x 
-				    - scrollBar borderWidth
-			      @
-			      negativeOffset]
-	] ifFalse:[
-	    scrollBar origin:negativeOffset asPoint
-	].
-	scrollBar extent:[scrollBar extent x 
-			  @ 
-			  (height "+ (scrollBar borderWidth * 1)")].
+        (scrollBarPosition == #right) ifTrue:[
+            scrollBar origin:[width - scrollBar extent x 
+                                    - scrollBar borderWidth
+                              @
+                              negativeOffset]
+        ] ifFalse:[
+            scrollBar origin:negativeOffset asPoint
+        ].
+        scrollBar extent:[scrollBar extent x 
+                          @ 
+                          (height "+ (scrollBar borderWidth * 1)")].
 
-	aViewClass notNil ifTrue:[
-	    scrolledView := aViewClass in:self.
-	    (scrollBarPosition == #right) ifTrue:[
-		scrolledView origin:scrolledView borderWidth negated asPoint
-	    ] ifFalse:[
-		scrolledView origin:((scrollBar width + 
-				      scrollBar borderWidth - 
-				      scrolledView borderWidth) 
-				    @ 
-				    scrolledView borderWidth negated)
-	    ].
-	    scrolledView extent:[(width - scrollBar width - scrolledView borderWidth) 
-				 @ 
-				 (height + (scrollBar borderWidth))
-				]
-	].
+        aViewClass notNil ifTrue:[
+            scrolledView := aViewClass in:self.
+            (scrollBarPosition == #right) ifTrue:[
+                scrolledView origin:scrolledView borderWidth negated asPoint
+            ] ifFalse:[
+                scrolledView origin:((scrollBar width + 
+                                      scrollBar borderWidth - 
+                                      scrolledView borderWidth) 
+                                    @ 
+                                    scrolledView borderWidth negated)
+            ].
+            scrolledView extent:[(width - scrollBar width - scrolledView borderWidth) 
+                                 @ 
+                                 (height + (scrollBar borderWidth))
+                                ]
+        ].
     ].
     scrolledView notNil ifTrue:[
-	self setScrollActions.
-	"
-	 pass my keyboard input (and other subviews input) 
-	 to the scrolled view ...
-	"
-	self delegate:(KeyboardForwarder toView:scrolledView).
+        self setScrollActions.
     ]
+
+    "Modified: 1.8.1996 / 12:44:32 / cg"
 !
 
 realize
@@ -866,14 +859,22 @@
     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].
 
     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:21 / cg"
 ! !
 
 !ScrollableView methodsFor:'queries'!
@@ -985,5 +986,5 @@
 !ScrollableView  class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/ScrollableView.st,v 1.37 1996-07-19 18:55:12 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/ScrollableView.st,v 1.38 1996-08-01 16:25:33 cg Exp $'
 ! !