FilenameEditField.st
changeset 2717 f5738b80c8ca
parent 2584 5b3da940cb71
child 3195 39debbeac7d5
--- a/FilenameEditField.st	Mon Jun 07 19:52:55 2004 +0200
+++ b/FilenameEditField.st	Wed Jun 09 17:19:52 2004 +0200
@@ -169,7 +169,7 @@
                 oldContents := oldContents asString
             ].
 
-            entryCompletionBlock value:oldContents.
+            self entryCompletionBlock value:oldContents.
 
             newContents := self contents.
             newContents isNil ifTrue:[
@@ -200,31 +200,32 @@
     directoriesOnly := filesOnly := false.
     directory := Filename currentDirectory.
 
-    entryCompletionBlock := [:contents |
-        |newString isMultiMatch canonContents|
+    self 
+        entryCompletionBlock:[:contents |
+            |newString isMultiMatch canonContents|
 
-        isMultiMatch := false.
-        canonContents := Filename canonicalize:contents.
-        newString := Filename 
-                        filenameCompletionFor:canonContents 
-                        directory:directory 
-                        directoriesOnly:directoriesOnly 
-                        filesOnly:filesOnly 
-                        ifMultiple:[:dir |
-"/                            dir asFilename isDirectory ifTrue:[
-"/                                self changed:#directory with:dir.
-"/                            ].
-                            isMultiMatch := true.
-                            self flash.
-                        ].
-        newString asFilename pathName = canonContents ifTrue:[
-            self flash.
+            isMultiMatch := false.
+            canonContents := Filename canonicalize:contents.
+            newString := Filename 
+                            filenameCompletionFor:canonContents 
+                            directory:directory 
+                            directoriesOnly:directoriesOnly 
+                            filesOnly:filesOnly 
+                            ifMultiple:[:dir |
+"/                                dir asFilename isDirectory ifTrue:[
+"/                                    self changed:#directory with:dir.
+"/                                ].
+                                isMultiMatch := true.
+                                self flash.
+                            ].
+            newString asFilename pathName = canonContents ifTrue:[
+                self flash.
+            ].
+
+            self contents:newString addSeparatorToDirectories:isMultiMatch not.
+            self cursorToEndOfLine.
         ].
 
-        self contents:newString addSeparatorToDirectories:isMultiMatch not.
-        self cursorToEndOfLine.
-    ].
-
     "Modified: 7.9.1995 / 10:20:46 / claus"
     "Modified: 7.9.1997 / 23:51:47 / cg"
 !
@@ -241,5 +242,5 @@
 !FilenameEditField class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg2/FilenameEditField.st,v 1.31 2003-11-19 12:13:56 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg2/FilenameEditField.st,v 1.32 2004-06-09 15:19:52 cg Exp $'
 ! !