mouseWheel support for hp (and maybe others)
authorClaus Gittinger <cg@exept.de>
Tue, 26 Sep 2000 17:15:56 +0200
changeset 3312 21eca9090ee2
parent 3311 789892d4bbb6
child 3313 acf38fcda6e9
mouseWheel support for hp (and maybe others)
XWorkstation.st
--- a/XWorkstation.st	Tue Sep 26 17:05:58 2000 +0200
+++ b/XWorkstation.st	Tue Sep 26 17:15:56 2000 +0200
@@ -4394,18 +4394,24 @@
     "/ physical to logical button translation
     logicalButton := buttonTranslation at:button ifAbsent:button.
 
+    "/ special for HPs mouse-wheel implementation
+    (logicalButton == #wheelFwd or:[logicalButton == #wheelBwd]) ifTrue:[
+      self mouseWheelMotion:0 x:x y:y amount:(button == #wheelFwd ifTrue:[10] ifFalse:[-10]) deltaTime:10 view:view.
+      ^ self
+    ].
+
     buttonsPressed := buttonsPressed bitOr:(1 bitShift:logicalButton-1).
 
     multiClickTimeDelta notNil ifTrue:[
-	nextMultiClickTime := time + multiClickTimeDelta.
-	multiClickTime notNil ifTrue:[
-	    time < multiClickTime ifTrue:[
-		multiClickTime := nextMultiClickTime.
-		self buttonMultiPress:logicalButton x:x y:y view:view.
-		^ self.
-	    ]
-	].
-	multiClickTime := nextMultiClickTime.
+        nextMultiClickTime := time + multiClickTimeDelta.
+        multiClickTime notNil ifTrue:[
+            time < multiClickTime ifTrue:[
+                multiClickTime := nextMultiClickTime.
+                self buttonMultiPress:logicalButton x:x y:y view:view.
+                ^ self.
+            ]
+        ].
+        multiClickTime := nextMultiClickTime.
     ].
 
     self buttonPress:logicalButton x:x y:y view:view
@@ -6223,29 +6229,35 @@
 dispatchLastEvent:evArray
     |viewId view evTypeNr evType arguments|
 
+    evArray size < 3 ifTrue:[
+'********** bad event:' errorPrintCR.
+evArray errorPrintCR.
+'********** see newDispatchLastEvent' errorPrintCR.
+        ^ self.
+    ].
+
     viewId := evArray at:1.
     viewId notNil ifTrue:[
-	viewId = lastId ifTrue:[
-	    view := lastView
-	] ifFalse:[
-	    view := self viewFromId:viewId
-	].
+        viewId = lastId ifTrue:[
+            view := lastView
+        ] ifFalse:[
+            view := self viewFromId:viewId
+        ].
     ].
 
     evType := evArray at:3.
 
     (self respondsTo:evType) ifTrue:[
-	arguments := evArray copyFrom:3 to:(3 + evType numArgs - 1).
-	arguments at:1 put:view.
-
-	self perform:evType withArguments:arguments.
-	^ true.
+        arguments := evArray copyFrom:3 to:(3 + evType numArgs - 1).
+        arguments at:1 put:view.
+
+        self perform:evType withArguments:arguments.
+        ^ true.
     ].
 '********** unhandled event:' errorPrintCR.
 evType errorPrintCR.
 '********** see newDispatchLastEvent' errorPrintCR.
     ^ false
-
 !
 
 dispatchPendingEvents
@@ -11621,6 +11633,6 @@
 !XWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.372 2000-09-18 11:56:31 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.373 2000-09-26 15:15:56 cg Exp $'
 ! !
 XWorkstation initialize!