FilenameEditFieldV2.st
changeset 8798 7c48ce02da90
parent 6446 5d2119be7b34
child 12117 d12665ccf213
child 12123 4bde08cebd48
--- a/FilenameEditFieldV2.st	Mon Sep 28 18:19:39 2009 +0200
+++ b/FilenameEditFieldV2.st	Tue Sep 29 09:57:23 2009 +0200
@@ -9,7 +9,6 @@
  other person.  No title to or ownership of the software is
  hereby transferred.
 "
-
 "{ Package: 'stx:libtool' }"
 
 ComboBoxView subclass:#FilenameEditFieldV2
@@ -219,19 +218,18 @@
     "catch keyEvents in pulled menu (see redefined pullMenu-method).
      Return true, if I have eaten the event"
 
-    |wg|
-
     activeMenu notNil ifTrue:[
         anEvent isKeyPressEvent ifTrue:[
-            anEvent key isCharacter ifTrue:[
+            "/ typing into the pulled menu behaves like typing into the field
+            "/ followed by a TAB (to reopen the menu)
+            (anEvent key isCharacter 
+            or:[ anEvent key == #BackSpace]) ifTrue:[
                 "/ activeMenu windowGroup removePreEventHook:self.
+                field dispatchEvent:anEvent.
 
-                wg := self windowGroup.
-                wg focusView:field.
-                wg sensor pushEvent:anEvent.
                 WindowGroup leaveSignal raiseRequest.
                 self error:'should not be reached'.
-            ]
+            ].
         ].
     ].
     ^ false.
@@ -241,7 +239,6 @@
     "pull the menu - triggered from the button"
 
     |menu origin plug acceptOnLostFocus|
-
     
     completitionList notNil ifTrue:[
         self list:completitionList
@@ -268,6 +265,7 @@
     "prevent editfield from acceptOnLostFocus events so no accept happen while menue is open"
     acceptOnLostFocus := field acceptOnLostFocus. 
     field acceptOnLostFocus:false.
+    menu sensor addEventListener:self.
     menu showAt:origin.
     field acceptOnLostFocus:acceptOnLostFocus.
     activeMenu := nil.
@@ -277,5 +275,5 @@
 !FilenameEditFieldV2 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/FilenameEditFieldV2.st,v 1.12 2005-12-21 16:33:39 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/FilenameEditFieldV2.st,v 1.13 2009-09-29 07:57:23 cg Exp $'
 ! !