changed: #openEditorOnSelection
authorClaus Gittinger <cg@exept.de>
Wed, 11 Nov 2009 22:25:51 +0100
changeset 3855 41653ef27914
parent 3854 d7904ce12bb6
child 3856 ef485acbfd81
changed: #openEditorOnSelection cursor key fixes
DSVColumnView.st
--- a/DSVColumnView.st	Wed Nov 11 13:04:33 2009 +0100
+++ b/DSVColumnView.st	Wed Nov 11 22:25:51 2009 +0100
@@ -4086,7 +4086,7 @@
 !
 
 openEditorOnSelection
-     |colIdx column rowIdx editSpec winGroup
+     |colIdx column rowIdx editorAndModel winGroup
       editor filter keyBrdFwd selColor|
 
     (shown and:[editView isNil]) ifFalse:[
@@ -4105,8 +4105,9 @@
     rowIdx isSequenceable ifTrue:[
         rowIdx := rowIdx at:1 ifAbsent:[ ^ self ].
     ].
-    editSpec := column editorSpecForRowAt:rowIdx.
-    editSpec isNil ifTrue:[^ self].
+
+    editorAndModel := column editorForRowAt:rowIdx.      
+    editorAndModel isNil ifTrue:[^ self].
 
     autoScrollToColumn == true ifTrue:[
         self scrollToRowAt:rowIdx colAt:colIdx.
@@ -4126,12 +4127,24 @@
     ].
     editView viewBackground:selectionBackgroundColor.
 
-    editor := editSpec editor.
+    editor := editorAndModel editor.
     editView add:editor.
-    editSpec isStandardEditorSpec ifTrue:[
-        filter := [:aKey | #( #Tab #CursorUp #CursorDown #Return ) includes:aKey ]
+    editorAndModel editorNeedsCursorKeys ifTrue:[
+        editorAndModel editorNeedsReturnKey ifTrue:[
+            "/ only steal TAB from the editor
+            filter := [:aKey | aKey == #Tab ]
+        ] ifFalse:[
+            "/ steal TAB and RETURN from the editor
+            filter := [:aKey | #( #Tab #Return ) includes:aKey ]
+        ].
     ] ifFalse:[
-        filter := [:aKey | aKey == #Tab ]
+        editorAndModel editorNeedsReturnKey ifTrue:[
+            "/ only steal TAB and Curosr Keys from the editor
+            filter := [:aKey | #( #Tab #CursorUp #CursorDown ) includes:aKey ]
+        ] ifFalse:[
+            "/ steal TAB, RETURN and Curosr Keys from the editor
+            filter := [:aKey | #( #Tab #CursorUp #CursorDown #Return ) includes:aKey ]
+        ].
     ].
     keyBrdFwd := KeyboardForwarder 
                 toView:self
@@ -4143,7 +4156,7 @@
             aView font:font.
         ].
 
-    (editValue := editSpec model) notNil ifTrue:[
+    (editValue := editorAndModel model) notNil ifTrue:[
         editValue addDependent:self.
     ].
     editView realize.
@@ -4588,9 +4601,9 @@
 !DSVColumnView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/DSVColumnView.st,v 1.254 2009-10-19 20:55:08 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/DSVColumnView.st,v 1.255 2009-11-11 21:25:51 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libwidg2/DSVColumnView.st,v 1.254 2009-10-19 20:55:08 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/DSVColumnView.st,v 1.255 2009-11-11 21:25:51 cg Exp $'
 ! !