ListSelectionBox.st
changeset 2280 d9ee8906706e
parent 2261 260a8cd9905d
child 2282 10fc88f073ee
--- a/ListSelectionBox.st	Mon Sep 25 15:29:07 2000 +0200
+++ b/ListSelectionBox.st	Tue Sep 26 14:53:22 2000 +0200
@@ -92,6 +92,19 @@
         box abortAction:[:dummy | box hide].
         box openModeless
                                                                         [exEnd]
+
+    showing fileNames:
+                                                                        [exBegin]
+        |box|
+
+        box := ListSelectionBox new.
+        box title:'select something:'.
+        box list:('.' asFilename directoryContents).
+        box okAction:[:sel | Transcript showCR:'the selection was:' , sel].
+        box showAtPointer
+                                                                        [exEnd]
+
+
 "
 ! !
 
@@ -246,6 +259,17 @@
 
     enterField removeDependent:self. "dont want preferredExtent-changes"
 
+    enterField immediateAccept:true.
+    enterField acceptAction:
+                    [:text | |string index|
+                        string := enterField contents.
+                        "/ find the first list-entry, starting with entered text
+                        index := selectionList list findFirst:[:line | line startsWith:string].
+                        index ~~ 0 ifTrue:[
+                            selectionList makeLineVisible:index.
+                        ].
+                    ].
+
     "
      mhm: the lists keyboard functions are disabled,
      and input passed to the enterfield (except cursor keys)
@@ -350,5 +374,5 @@
 !ListSelectionBox class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/ListSelectionBox.st,v 1.40 2000-09-07 17:39:31 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/ListSelectionBox.st,v 1.41 2000-09-26 12:53:22 cg Exp $'
 ! !