#FEATURE
authorClaus Gittinger <cg@exept.de>
Sun, 04 Oct 2015 12:11:29 +0200
changeset 6952 832f15fc0e4c
parent 6951 fb0d3f672ecd
child 6953 eac8b255a9e1
#FEATURE class: SimpleView changed: #mouseWheelMotion:x:y:amount:deltaTime:
SimpleView.st
--- a/SimpleView.st	Sun Oct 04 09:22:52 2015 +0200
+++ b/SimpleView.st	Sun Oct 04 12:11:29 2015 +0200
@@ -6281,7 +6281,7 @@
      if shift is pressed, always scroll a single scroll-step;
      if ctrl is pressed, always scroll one page."
 
-    |pageScroll amountToScroll zoomInOrOut sensor|
+    |horizontal pageScroll amountToScroll zoomInOrOut sensor|
 
     sensor := self sensor.
 
@@ -6293,26 +6293,31 @@
         ].
     ].
 
-    pageScroll := sensor shiftDown.
-
+    horizontal := pageScroll := false.
+    (UserPreferences current shiftMouseWheelScrollsHorizontally) ifTrue:[
+        horizontal := sensor shiftDown
+    ] ifFalse:[                              
+        pageScroll := sensor shiftDown.
+    ].
+    
     pageScroll ifFalse:[
-        amountToScroll := self verticalScrollStep.
-        sensor shiftDown ifFalse:[
-            amountToScroll := self scaleMouseWheelScrollAmount:amountToScroll.
-        ]
+        amountToScroll := horizontal 
+                            ifTrue:[ self horizontalScrollStep]
+                            ifFalse:[ self verticalScrollStep ].
+        amountToScroll := self scaleMouseWheelScrollAmount:amountToScroll.
     ].
 
     amount > 0 ifTrue:[
         pageScroll ifTrue:[
-            self pageUp
+            horizontal ifTrue:[self pageLeft] ifFalse:[self pageUp]
         ] ifFalse:[
-            self scrollUp:amountToScroll
+            horizontal ifTrue:[self scrollLeft:amountToScroll] ifFalse:[self scrollUp:amountToScroll]
         ]
     ] ifFalse:[
         pageScroll ifTrue:[
-            self pageDown
+            horizontal ifTrue:[self pageRight] ifFalse:[self pageDown]
         ] ifFalse:[
-            self scrollDown:amountToScroll
+            horizontal ifTrue:[self scrollRight:amountToScroll] ifFalse:[self scrollDown:amountToScroll]
         ]
     ].