class: EditFieldWithCompletion
authorStefan Vogel <sv@exept.de>
Mon, 04 Feb 2013 18:51:47 +0100
changeset 12389 83d4d24d847c
parent 12386 1206aff1f11d
child 12390 70b71b28a20f
class: EditFieldWithCompletion changed: #keyPress:x:y: do not do both a Delete and an BackSpace when typing BackSpace
EditFieldWithCompletion.st
--- a/EditFieldWithCompletion.st	Sat Feb 02 01:23:18 2013 +0100
+++ b/EditFieldWithCompletion.st	Mon Feb 04 18:51:47 2013 +0100
@@ -239,27 +239,24 @@
 keyPress:key x:x y:y 
     "Forward certain events to optionsView if any"
 
-    <resource: #keyboard (#CursorDown #CursorUp #Accept #Return #Escape #BackSpace)>
+    <resource: #keyboard (#CursorDown #CursorUp #Accept #Return #Escape #BackSpace #Delete)>
     
-    (optionsView notNil and:
-        [(#( #CursorDown #CursorUp ) includes:key)]) 
-            ifTrue:[^ optionsView keyPress:key x:x y:y].
+    (optionsView notNil 
+     and:[#(CursorDown CursorUp) includes:key]) ifTrue:[
+        optionsView keyPress:key x:x y:y.
+        ^ self.
+    ].
 
     key = #Accept ifTrue:[self hideOptionsWindow].
     key = #Return ifTrue:[self hideOptionsWindow].
     key = #Escape ifTrue:[self hideOptionsWindow].
-    key = #BackSpace ifTrue:
-        [super 
-            keyPress:#Delete x:x y:y;
-            keyPress:#BackSpace x:x y:y.
-        ^ self startCompletion].
+    (key = #BackSpace or:[key = #Delete]) ifTrue:[
+        super keyPress:key x:x y:y.
+        self startCompletion.
+        ^ self.
+    ].
 
-    
-
-    ^ super 
-        keyPress:key
-        x:x
-        y:y
+    super keyPress:key x:x y:y
 
     "Created: / 08-08-2009 / 22:02:13 / Jan Vrany <vranyj1@fel.cvut.cz>"
     "Modified: / 09-08-2009 / 14:06:43 / Jan Vrany <vranyj1@fel.cvut.cz>"
@@ -402,7 +399,7 @@
 !EditFieldWithCompletion class methodsFor:'documentation'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/EditFieldWithCompletion.st,v 1.6 2013-01-17 10:47:17 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/EditFieldWithCompletion.st,v 1.7 2013-02-04 17:51:47 stefan Exp $'
 !
 
 version_SVN