Class that represents a file chooser dialog.
// create a new file dialog object
var dlg = new FileDialog;
// show these file types in the file dialogs filter
dlg.setFilter("Bitmap Files|*.bmp|JPEG Images|*.jpg;*.jpeg");
// show the dialog, and accept the results only if the
// user presses Ok
if (dlg.showDialog() == DialogResult.Ok)
{
var files = dlg.getPaths();
for (var f in files)
alert(files[f]);
}
Returns the caption to display in the file dialog.
Returns the caption to display in the file dialog.
Returns the default filter index for the file dialog.
Returns the default filter index for the file dialog.
Returns the default directory of the file dialog.
Returns the default directory of the file dialog.
Returns the file name from the file dialog.
Returns the file name from the file dialog.
Returns an array of the selected files in the file dialog.
Returns an array of the selected files in the file dialog. In order for the file dialog to return multiple paths, multi-selection mode must be enabled. See OpenFileDialog.setMultiselect()
Returns a string containing the current filter string for the file dialog.
Returns the filter string for the file dialog.
Returns the name of the selected file, including the full directory path.
Returns the name of the selected file, including the full directory path. If multiple files were selected in the file dialog, the first one will be returned.
Returns an array of the file names of the selected files that includes the full directory path.
Returns an array of the file names of the selected files that includes the full directory path. In order for the file dialog to return multiple paths, multi-selection mode must be enabled. See OpenFileDialog.setMultiselect()
Sets the caption to display in the file dialog.
Sets the default filter to the value specified in the index parameter. This zero-based index indicates which filter string is shown by default. See the setFilter() method for more information.
Sets the default directory of the file dialog.
Sets the filter string for the file dialog. A filter string is composed of one or more description/extension pairs. The file dialog will allow the user to search for files with the type(s) specified in the filter string. A filter string for .bmp and .jpg/.jpeg files might look something like this: "Bitmap Files|*.bmp|JPEG Images|*.jpg;*.jpeg"
Returns DialogResult.Ok when the dialog is closed by pressing "OK" or equivalent, and DialogResult.Cancel if the dialog is closed by pressing "Cancel" or equivalent.
Shows a file dialog and returns DialogResult.Ok if the user closes the file dialog by pressing "OK", or the equivalent, and DialogResult.Cancel if the user closes the file dialog by pressing "Cancel", or the equivalent.