shift-click or ctrl-click on scrollBars arrow buttons will
authorClaus Gittinger <cg@exept.de>
Mon, 28 Sep 1998 13:50:27 +0200
changeset 1695 c289e9656d9d
parent 1694 61bcd88d3721
child 1696 adfae835bac8
shift-click or ctrl-click on scrollBars arrow buttons will scroll to top/bottom.
ScrView.st
ScrollableView.st
--- a/ScrView.st	Mon Sep 28 11:27:50 1998 +0200
+++ b/ScrView.st	Mon Sep 28 13:50:27 1998 +0200
@@ -1497,22 +1497,54 @@
     lockUpdates := false.
 
     vScrollBar notNil ifTrue:[
-	vScrollBar scrollAction:[:position |
-	    lockUpdates := true.
-	    scrolledView scrollVerticalToPercent:position.
-	    lockUpdates := false
-	].
-	vScrollBar scrollUpAction:[scrolledView scrollUp].
-	vScrollBar scrollDownAction:[scrolledView scrollDown].
+        vScrollBar scrollAction:[:position |
+            lockUpdates := true.
+            scrolledView scrollVerticalToPercent:position.
+            lockUpdates := false
+        ].
+        vScrollBar 
+            scrollUpAction:[|sensor|
+                            ((sensor := self sensor) notNil
+                            and:[sensor shiftDown or:[sensor ctrlDown]]) ifTrue:[
+                                scrolledView scrollToTop
+                            ] ifFalse:[
+                                scrolledView scrollUp
+                            ]
+                           ].
+        vScrollBar 
+            scrollDownAction:[|sensor|
+                            ((sensor := self sensor) notNil
+                            and:[sensor shiftDown or:[sensor ctrlDown]]) ifTrue:[
+                                scrolledView scrollToBottom
+                            ] ifFalse:[
+                                scrolledView scrollDown
+                            ]
+                           ].
     ].
     hScrollBar notNil ifTrue:[
-	hScrollBar scrollAction:[:position |
-	    lockUpdates := true.
-	    scrolledView scrollHorizontalToPercent:position.
-	    lockUpdates := false
-	].
-	hScrollBar scrollUpAction:[scrolledView scrollLeft].
-	hScrollBar scrollDownAction:[scrolledView scrollRight].
+        hScrollBar scrollAction:[:position |
+            lockUpdates := true.
+            scrolledView scrollHorizontalToPercent:position.
+            lockUpdates := false
+        ].
+        hScrollBar 
+            scrollUpAction:[|sensor|
+                            ((sensor := self sensor) notNil
+                            and:[sensor shiftDown or:[sensor ctrlDown]]) ifTrue:[
+                                scrolledView scrollToLeft
+                            ] ifFalse:[
+                                scrolledView scrollLeft
+                            ]
+                           ].
+        hScrollBar 
+            scrollDownAction:[|sensor|
+                            ((sensor := self sensor) notNil
+                            and:[sensor shiftDown or:[sensor ctrlDown]]) ifTrue:[
+                                scrolledView scrollToRight
+                            ] ifFalse:[
+                                scrolledView scrollRight
+                            ]
+                             ].
     ].
 
     scrolledView addDependent:self.
@@ -2002,5 +2034,5 @@
 !ScrollableView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/Attic/ScrView.st,v 1.88 1998-09-28 09:27:50 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/Attic/ScrView.st,v 1.89 1998-09-28 11:50:27 cg Exp $'
 ! !
--- a/ScrollableView.st	Mon Sep 28 11:27:50 1998 +0200
+++ b/ScrollableView.st	Mon Sep 28 13:50:27 1998 +0200
@@ -1497,22 +1497,54 @@
     lockUpdates := false.
 
     vScrollBar notNil ifTrue:[
-	vScrollBar scrollAction:[:position |
-	    lockUpdates := true.
-	    scrolledView scrollVerticalToPercent:position.
-	    lockUpdates := false
-	].
-	vScrollBar scrollUpAction:[scrolledView scrollUp].
-	vScrollBar scrollDownAction:[scrolledView scrollDown].
+        vScrollBar scrollAction:[:position |
+            lockUpdates := true.
+            scrolledView scrollVerticalToPercent:position.
+            lockUpdates := false
+        ].
+        vScrollBar 
+            scrollUpAction:[|sensor|
+                            ((sensor := self sensor) notNil
+                            and:[sensor shiftDown or:[sensor ctrlDown]]) ifTrue:[
+                                scrolledView scrollToTop
+                            ] ifFalse:[
+                                scrolledView scrollUp
+                            ]
+                           ].
+        vScrollBar 
+            scrollDownAction:[|sensor|
+                            ((sensor := self sensor) notNil
+                            and:[sensor shiftDown or:[sensor ctrlDown]]) ifTrue:[
+                                scrolledView scrollToBottom
+                            ] ifFalse:[
+                                scrolledView scrollDown
+                            ]
+                           ].
     ].
     hScrollBar notNil ifTrue:[
-	hScrollBar scrollAction:[:position |
-	    lockUpdates := true.
-	    scrolledView scrollHorizontalToPercent:position.
-	    lockUpdates := false
-	].
-	hScrollBar scrollUpAction:[scrolledView scrollLeft].
-	hScrollBar scrollDownAction:[scrolledView scrollRight].
+        hScrollBar scrollAction:[:position |
+            lockUpdates := true.
+            scrolledView scrollHorizontalToPercent:position.
+            lockUpdates := false
+        ].
+        hScrollBar 
+            scrollUpAction:[|sensor|
+                            ((sensor := self sensor) notNil
+                            and:[sensor shiftDown or:[sensor ctrlDown]]) ifTrue:[
+                                scrolledView scrollToLeft
+                            ] ifFalse:[
+                                scrolledView scrollLeft
+                            ]
+                           ].
+        hScrollBar 
+            scrollDownAction:[|sensor|
+                            ((sensor := self sensor) notNil
+                            and:[sensor shiftDown or:[sensor ctrlDown]]) ifTrue:[
+                                scrolledView scrollToRight
+                            ] ifFalse:[
+                                scrolledView scrollRight
+                            ]
+                             ].
     ].
 
     scrolledView addDependent:self.
@@ -2002,5 +2034,5 @@
 !ScrollableView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/ScrollableView.st,v 1.88 1998-09-28 09:27:50 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/ScrollableView.st,v 1.89 1998-09-28 11:50:27 cg Exp $'
 ! !