class: EditFieldWithCompletion
changed: #keyPress:x:y:
do not do both a Delete and an BackSpace when typing BackSpace
--- 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