#UI_ENHANCEMENT by cg
authorClaus Gittinger <cg@exept.de>
Thu, 14 Apr 2016 19:51:43 +0200
changeset 5664 a8ecef1ff7e2
parent 5663 4e9d4fa76738
child 5665 a28ccea0dc36
child 5666 cb5ef2978993
#UI_ENHANCEMENT by cg class: SelectionInListView changed: #key:select:x:y:shifted: #keyPress:x:y: select next on keyPress must skip over disabled items (variable list in browser, with grey class names)
SelectionInListView.st
--- a/SelectionInListView.st	Thu Apr 14 12:53:44 2016 +0200
+++ b/SelectionInListView.st	Thu Apr 14 19:51:43 2016 +0200
@@ -2486,40 +2486,42 @@
     |oldSelection|
 
     enabled ifFalse:[
-        ^ self
+        ^ false
     ].
 
-    keyActionStyle notNil ifTrue:[
-        "/ this item selectable ?
-        (selectConditionBlock notNil 
-         and:[(selectConditionBlock value:index) not]) ifTrue:[^ self].
-
-        keyActionStyle == #pass ifTrue:[
-            ^ super keyPress:key x:x y:y
+    keyActionStyle isNil ifTrue:[^ false].
+    
+    "/ this item selectable ?
+    (selectConditionBlock notNil 
+     and:[(selectConditionBlock value:index) not]) ifTrue:[^ false].
+
+    keyActionStyle == #pass ifTrue:[
+        super keyPress:key x:x y:y.
+        ^ false.
+    ].
+
+    (self multipleSelectOk and:[shifted]) ifTrue:[
+        oldSelection := selection copy.
+        (self isInSelection:index) ifTrue:[
+            self removeFromSelection:index
+        ] ifFalse:[
+            self addToSelection:index.
+            self makeLineVisible:index.
         ].
-
-        (self multipleSelectOk and:[shifted]) ifTrue:[
-            oldSelection := selection copy.
-            (self isInSelection:index) ifTrue:[
-                self removeFromSelection:index
-            ] ifFalse:[
-                self addToSelection:index.
-                self makeLineVisible:index.
-            ].
-            (selection ~= oldSelection) ifTrue:[
-                self selectionChangedFrom:oldSelection.
-            ].
+        (selection ~= oldSelection) ifTrue:[
+            self selectionChangedFrom:oldSelection.
+        ].
+    ] ifFalse:[
+        self multipleSelectOk ifTrue:[
+            self selection:(OrderedCollection with:index)
         ] ifFalse:[
-            self multipleSelectOk ifTrue:[
-                self selection:(OrderedCollection with:index)
-            ] ifFalse:[
-                self selection:index.
-            ].    
-            keyActionStyle == #selectAndDoubleClick ifTrue:[
-                self doubleClicked
-            ]
+            self selection:index.
+        ].    
+        keyActionStyle == #selectAndDoubleClick ifTrue:[
+            self doubleClicked
         ]
     ].
+    ^ true
 
     "Modified: / 4.2.2000 / 14:51:25 / cg"
 !
@@ -2678,7 +2680,9 @@
                 s notNil ifTrue:[
                     (s string withoutSeparators asLowercase startsWith:searchPrefix) ifTrue:[
                         searchIndex = selection ifTrue:[^ self].
-                        ^ self key:key select:searchIndex x:x y:y shifted:false
+                        (selectConditionBlock isNil or:[(selectConditionBlock value:searchIndex)]) ifTrue:[
+                            ^ self key:key select:searchIndex x:x y:y shifted:false
+                        ].
                     ].
                 ].
                 backSearch ifTrue:[