File selection prompter
A
CwFileSelectionPrompter prompts the user to choose a file from a directory in the file system. A file selection prompter from the OS/2 platform is shown in the following illustration:
The following methods are used to configure a file selection prompter:
searchPath:
Sets the string specifying the initial directory path presented to the user. The default is a platform-specific string denoting the current working directory.
searchMask:
Sets the string used to filter the file names; an asterisk (*) within the string denotes a wildcard. The default is a platform-specific string denoting all normal files.
fileName:
Sets the string to use as the default file name presented to the user. The default is an empty string.
accessMode:
Hint provided by the application to indicate whether the application intends to open or save a file.
fileExtension:
Hint provided by the application to indicate the preferred file extension for the return value. On some platforms, the prompter ensures that the return value has the correct extension if fileExtension is set. The default is an empty string.
The prompt method returns nil if the prompter is cancelled. If a file is properly selected, a string specifying the full path name of the file is returned.
The file selection prompter shown above is created by the following code.
| reply |
reply :=
CwFileSelectionPrompter new
title: 'File Selection Prompter Example';
searchPath: 'c:\';
searchMask: '*.*';
prompt.
Transcript cr; show: 'The reply was: ', reply printString.
Last modified date: 12/21/2017