#REFACTORING by stefan
authorStefan Vogel <sv@exept.de>
Wed, 16 May 2018 09:01:02 +0200
changeset 6322 d6cd7f125437
parent 6321 cf13accef85c
child 6323 9d9d186b4bac
#REFACTORING by stefan class: SelectionInListView changed: #keyPress:x:y:
SelectionInListView.st
--- a/SelectionInListView.st	Wed May 16 08:38:42 2018 +0200
+++ b/SelectionInListView.st	Wed May 16 09:01:02 2018 +0200
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
@@ -2679,25 +2677,23 @@
                 searchIndex := startSearch.
                 [true] whileTrue:[
                     s := self characterSearchItemStringAt:searchIndex.
-                    s notNil ifTrue:[
-                        (s string withoutSeparators asLowercase startsWith:searchPrefix) ifTrue:[
-                            |selectable didAskInteractively|
-
-                            searchIndex = selection ifTrue:[^ self].
-                            Dialog aboutToOpenBoxNotificationSignal
-                                handle:[:ex |
-                                    didAskInteractively := true.
-                                    selectable := false.
-                                ] do:[    
-                                    didAskInteractively := false.
-                                    selectable := selectConditionBlock isNil or:[(selectConditionBlock value:searchIndex)].
-                                ].
-
-                            selectable ifTrue:[
-                                ^ self key:key select:searchIndex x:x y:y shifted:false
+                    (s notNil and:[s string withoutSeparators asLowercase startsWith:searchPrefix]) ifTrue:[
+                        |selectable didAskInteractively|
+
+                        searchIndex = selection ifTrue:[^ self].
+                        self class aboutToOpenBoxNotificationSignal
+                            handle:[:ex |
+                                didAskInteractively := true.
+                                selectable := false.
+                            ] do:[    
+                                didAskInteractively := false.
+                                selectable := selectConditionBlock isNil or:[selectConditionBlock value:searchIndex].
                             ].
-                            didAskInteractively ifTrue:[^ self]. "/ ignore
+
+                        selectable ifTrue:[
+                            ^ self key:key select:searchIndex x:x y:y shifted:false
                         ].
+                        didAskInteractively ifTrue:[^ self]. "/ ignore
                     ].
                     backSearch ifTrue:[
                         searchIndex := searchIndex - 1.
@@ -2729,6 +2725,7 @@
     super keyPress:key x:x y:y
 
     "Modified: / 17-08-2017 / 09:42:06 / cg"
+    "Modified: / 16-05-2018 / 09:00:35 / stefan"
 !
 
 sizeChanged:how