SelectionInTreeView.st
changeset 3744 b956bec8751b
parent 3739 99fb8ac5cf72
child 3985 4638e9fbb842
--- a/SelectionInTreeView.st	Tue Sep 15 21:01:55 2009 +0200
+++ b/SelectionInTreeView.st	Wed Sep 16 16:16:36 2009 +0200
@@ -1265,6 +1265,30 @@
 
 !SelectionInTreeView methodsFor:'event handling'!
 
+activateMenu
+    |node menu|
+
+    node := self selectedNode.
+    node notNil ifTrue:[
+        menu := node middleButtonMenu.
+        menu notNil ifTrue:[
+            menu isCollection ifTrue:[
+                |appl|
+
+                menu := Menu decodeFromLiteralArray:menu.
+
+                (appl := self application) notNil ifTrue:[
+                    menu findGuiResourcesIn:appl
+                ].
+                "/ menu receiver:appl. -- now done in findGuiResources ...
+            ].
+            self startUpMenu:menu.
+            ^ self.
+        ].
+    ].
+    super activateMenu
+!
+
 buttonMotion:buttonMask x:x y:y
     "mouse-move while button was pressed - handle selection changes"
 
@@ -1284,41 +1308,23 @@
 !
 
 buttonPress:button x:x y:y
-    "handle button press event
-    "
-    |node menu|
-
-    (button == 2) ifTrue:[
-        (     (node := self selectedNode) notNil
-         and:[(menu := node middleButtonMenu) notNil]
-        ) ifTrue:[
-            menu isCollection ifTrue:[
-                |appl|
-
-                menu := Menu decodeFromLiteralArray:menu.
-
-                (appl := self application) notNil ifTrue:[
-                    menu findGuiResourcesIn:appl
-                ].
-                "/ menu receiver:appl. -- now done in findGuiResources ...
-            ].
-            self startUpMenu:menu
-        ] ifFalse:[
-            super buttonPress:button x:x y:y
-        ]
-    ] ifFalse:[
+    "handle button press event"
+
+    |node|
+
+    (button == 1) ifTrue:[
         self handleSelectButtonAtX:x y:y.
 
-        (     editorWidget isNil
+        (editorWidget isNil
          and:[(node := self selectedNode) notNil
          and:[node canEdit
          and:[x >= (self xOfValueNode:node)]]]
         ) ifTrue:[
             self openEditor
-        ]
-    ]
-
-    "Modified: / 27-03-2007 / 08:44:01 / cg"
+        ].
+        ^ self.
+    ].
+    super buttonPress:button x:x y:y
 !
 
 buttonRelease:button x:x y:y
@@ -1361,7 +1367,7 @@
     lineNr := self indicatiorLineForButton:#select atX:x y:y.
 
     lineNr == 0 ifTrue:[
-        ^ super buttonPress:#select x:x y:y
+        ^ super buttonPress:1 x:x y:y
     ].
     node := listOfNodes at:lineNr.
 
@@ -2496,5 +2502,5 @@
 !SelectionInTreeView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/SelectionInTreeView.st,v 1.113 2009-09-15 18:15:40 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/SelectionInTreeView.st,v 1.114 2009-09-16 14:16:36 cg Exp $'
 ! !