--- a/SelectionInListView.st Wed Apr 13 09:24:13 2016 +0100
+++ b/SelectionInListView.st Fri Apr 15 06:50:58 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:[
@@ -2917,7 +2921,7 @@
#hack.
"/ q&d temporary hack.
"/ X11 fonts are currently so ugly... add more spacing.
- device platformName = #X11 ifTrue:[
+ device platformName == #X11 ifTrue:[
lineSpacing := lineSpacing + 3.
].
hilightFgColor isNil ifTrue:[