DSVColumnView.st
changeset 4664 a537a996fb22
parent 4653 e760275fb093
child 4686 dda678ab83bf
--- a/DSVColumnView.st	Sat Oct 18 17:33:13 2014 +0200
+++ b/DSVColumnView.st	Thu Oct 23 10:45:18 2014 +0200
@@ -2406,27 +2406,39 @@
 buttonPress:button x:x y:y
     "a button was pressed - handle selection here"
 
-    |rowNr colNr sensor clickPoint clickedIntoSelection menu column columnEditorType|
+    |rowNr colNr sensor clickPoint clickedIntoSelection column columnEditorType|
 
     buttonMotionAction := buttonReleaseAction := nil.
 
     self isEnabled ifFalse:[^ self].
 
-    (button == 2) ifTrue:[
+    rowNr := self yVisibleToRowNr:y.
+    colNr := self xVisibleToColNr:x.
+
+    (button == 2) ifTrue:[ |openMenu|
+        openMenu := false.
+        
         UserPreferences current selectOnRightClick ifFalse:[
+            openMenu := true.
+        ] ifTrue:[
+            UserPreferences current showRightButtonMenuOnRelease ifFalse:[
+                (rowNr notNil and:[colNr notNil and:[self isRowSelectable:rowNr]]) ifTrue:[
+                    self selectRowAt:rowNr colAt:colNr atPoint:clickPoint openEditor:false
+                ].
+                openMenu := true.
+            ].
+        ].
+        openMenu ifTrue:[ |menu|
             menu := self findMenuForSelection.
             menu notNil ifTrue:[ 
                 self startUpMenu:menu.
-                ^ self
+            ] ifFalse:[
+                super buttonPress:button x:x y:y.
             ].
-            super buttonPress:button x:x y:y.
             ^ self
-        ]
-    ].
-
-    rowNr := self yVisibleToRowNr:y.
-    colNr := self xVisibleToColNr:x.
-
+        ].
+    ].
+    
     (rowNr isNil or:[colNr isNil]) ifTrue:[
         self deselect.
         super buttonPress:button x:x y:y.
@@ -4814,10 +4826,10 @@
 !DSVColumnView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/DSVColumnView.st,v 1.300 2014-07-10 23:33:39 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/DSVColumnView.st,v 1.301 2014-10-23 08:45:18 ca Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg2/DSVColumnView.st,v 1.300 2014-07-10 23:33:39 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/DSVColumnView.st,v 1.301 2014-10-23 08:45:18 ca Exp $'
 ! !