some features for fileRequests - goes to FileDialog
authorpenk
Tue, 08 Oct 2002 16:15:05 +0200
changeset 2631 b45186913368
parent 2630 f3c95e73f862
child 2632 80c3c7c5cc7a
some features for fileRequests - goes to FileDialog
DialogBox.st
--- a/DialogBox.st	Wed Oct 02 18:45:57 2002 +0200
+++ b/DialogBox.st	Tue Oct 08 16:15:05 2002 +0200
@@ -1749,6 +1749,22 @@
     "Modified: 23.10.1997 / 19:24:41 / cg"
 !
 
+requestDirectoryName:titleString default:aFileName ok:okText abort:abortText version:versionSymbol pattern:pattern fromDirectory:aDirectoryPath ifFail:failBlock whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:aBoolean
+    "same as requestFileName, but only show directories"
+
+    ^ FileDialog
+        requestDirectoryName:titleString 
+        default:aFileName 
+        ok:okText 
+        abort:abortText 
+        version:versionSymbol 
+        pattern:pattern 
+        fromDirectory:aDirectoryPath 
+        ifFail:failBlock 
+        whenBoxCreatedEvaluate:boxCreatedCallback 
+        asLoadDialog:aBoolean.
+!
+
 requestFileName
     "launch a Dialog, which allows the user to enter a filename.
      Return the pathname string consisting of the full pathname of the filename,
@@ -1957,6 +1973,35 @@
     "Modified: 23.10.1997 / 19:59:01 / cg"
 !
 
+requestFileName:titleString default:defaultName ok:okText abort:abortText version:versionSymbol ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:aBoolean
+    "launch a Dialog, which allows user to enter a filename.
+     The files presented initially are those in aDirectoryPathOrNil, or the
+     last fileBox directory (default: current directory) (if a nil path is given).
+     The box will show okText in its okButton, abortText in the abortButton.
+     The matchPattern is set to pattern initially.
+     Return the string, or nil if cancel was pressed
+     The version argument allows validation of the files existance;
+     it may be any of:
+        #mustBeNew      - fail (return empty string) if the file exists
+        #new            - confirm if the file exists
+        #mustBeOld      - fail if the file does not exist
+        #old            - confirm if the file does not exist
+        #any (other)    - no validation
+    "
+
+    ^ FileDialog
+        requestFileName:titleString 
+        default:defaultName 
+        ok:okText 
+        abort:abortText 
+        version:versionSymbol 
+        ifFail:failBlock 
+        pattern:pattern 
+        fromDirectory:aDirectoryPath 
+        whenBoxCreatedEvaluate:boxCreatedCallback 
+        asLoadDialog:aBoolean.
+!
+
 requestFileName:titleString default:defaultName pattern:pattern
     "launch a Dialog, which allows user to enter a filename.
      The files presented initially are those from the current directory.
@@ -2346,6 +2391,27 @@
     "
 !
 
+requestFileNames:titleString default:defaultName ok:okText abort:abortText ifFail:failBlock pattern:pattern fromDirectory:aDirectoryPath whenBoxCreatedEvaluate:boxCreatedCallback asLoadDialog:asLoadDialog
+    "launch a Dialog, which allows user to enter a filename.
+     The files presented initially are those in aDirectoryPathOrNil, or the
+     last fileBox directory (default: current directory) (if a nil path is given).
+     The box will show okText in its okButton, abortText in the abortButton.
+     The matchPattern is set to pattern initially.
+     Return all selected Filenames as filenames in a collection, or nil if cancel was pressed
+    "
+
+    ^ FileDialog
+            requestFileNames:titleString 
+            default:defaultName 
+            ok:okText 
+            abort:abortText 
+            ifFail:failBlock 
+            pattern:pattern 
+            fromDirectory:aDirectoryPath 
+            whenBoxCreatedEvaluate:boxCreatedCallback 
+            asLoadDialog:asLoadDialog.
+!
+
 requestNewFileName:titleString default:defaultName
     "launch a Dialog, which allows user to enter a filename.
      We expect a new files (i.e. nonexisting) name to be enterred,
@@ -7597,7 +7663,7 @@
 !DialogBox class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.199 2002-10-01 15:18:59 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libwidg/DialogBox.st,v 1.200 2002-10-08 14:15:05 penk Exp $'
 ! !
 
 DialogBox initialize!