DzFileDialog Class Reference
[Interface Dialog Objects]

DAZ Script's global static object for displaying file dialogs. More...

List of all members.

Methods

String doAudioClipOpenDialog (String startWith="", DzWidget parent=undefined)
String doDirectoryDialog (String title, String desc, String startWith, DzWidget parent=undefined)
String doDirectoryDialog (String title="", String desc="", DzWidget parent=undefined)
String doFileDialog (Boolean open, String title="", String startWith="", String filter="", Number selectedFilter=0, DzWidget parent=undefined)
String doImageDialog (Boolean open, String startWith="", DzWidget parent=undefined)
String doVideoClipSaveDialog (String startWith="", DzWidget parent=undefined)
Array getOpenFileNames (String dir="", String filter="", String title="", DzWidget parent=undefined)


Detailed Description

DAZ Script's global static object for displaying file dialogs.

The DzFileDialog class is available in DAZ Script via the global variable FileDialog. It provides functions that display OS native file dialogs to the user.


Member Function Documentation

String DzFileDialog::doAudioClipOpenDialog ( String  startWith = "",
DzWidget  parent = undefined 
)

Convenience file dialog: Automatically creates a filter list for all audio formats we can import and displays a file open dialog

Parameters:
startWith Starting directory (can include a default file name)
parent The parent widget for the file dialog
Returns:
The path of the file selected by the user, undefined if the user cancels.

String DzFileDialog::doDirectoryDialog ( String  title,
String  desc,
String  startWith,
DzWidget  parent = undefined 
)

Display a dialog for the user to choose a directory

Parameters:
title Title of the dialog box
desc If non-null, puts up a description field and returns new desc
startWith The directory that the dialog will start in
parent The parent widget for the directory dialog
Returns:
The path of the file selected by the user, undefined if the user cancels.
Example:
Have the user select a directory
        var path = FileDialog.doDirectoryDialog( "Select a Directory", "", App.getDocumentsPath() );

String DzFileDialog::doDirectoryDialog ( String  title = "",
String  desc = "",
DzWidget  parent = undefined 
)

Display a dialog for the user to choose a directory

Parameters:
title Title of the dialog box
desc If non-null, puts up a description field and returns new desc
parent The parent widget for the directory dialog
Returns:
The path of the file selected by the user, undefined if the user cancels.
Example:
Have the user select a directory
        var path = FileDialog.doDirectoryDialog( "Select a Directory" );

String DzFileDialog::doFileDialog ( Boolean  open,
String  title = "",
String  startWith = "",
String  filter = "",
Number  selectedFilter = 0,
DzWidget  parent = undefined 
)

Display a dialog for the user to choose a file

Parameters:
open If true displays an open file dialog, otherwise displays a save file dialog.
title Title of the dialog box
startWith Starting directory (can include a default file name)
filter The file name filter - e.g. "TIFF files (*.tif *.tiff); JPEG files (*.jpg)";
selectedFilter If not NULL, its value is set to the index of the filter that coresponds to the selected file.
parent The parent widget for the file dialog
Returns:
The path of the file selected by the user, undefined if the user cancels.
Example:
Get the name of an existing jpeg file
        var filename = FileDialog.doFileDialog( true, "Select an Image File", App.getImageMgr().getImportPath(), "JPEG Files (*.jpg)" );

Example:
Get the name of an existing image file (w/ additional filters)
        var filename = FileDialog.doFileDialog( true, "Select an Image File", "",
                            "Image Files (*.tif *.tiff *.jpg);TIFF Files (*.tif *.tiff);JPEG Files (*.jpg)" );

Example:
Get the name of a text file to save to
        var filename = FileDialog.doFileDialog( false, "Save As", "", "Text Files (*.txt)" );

String DzFileDialog::doImageDialog ( Boolean  open,
String  startWith = "",
DzWidget  parent = undefined 
)

Convenience file dialog: Automatically creates a filter list for all image formats we can import/export and displays a file open/save dialog

Parameters:
open If true displays an open image dialog, otherwise displays a save image dialog.
startWith Starting directory (can include a default file name)
parent The parent widget for the file dialog
Returns:
The path of the file selected by the user, undefined if the user cancels.

String DzFileDialog::doVideoClipSaveDialog ( String  startWith = "",
DzWidget  parent = undefined 
)

Convenience file dialog: Automatically creates a filter list for all video formats we can export and displays a file save dialog

Parameters:
startWith Starting directory (can include a default file name)
parent The parent widget for the file dialog
Returns:
The path of the file selected by the user, undefined if the user cancels.

Array DzFileDialog::getOpenFileNames ( String  dir = "",
String  filter = "",
String  title = "",
DzWidget  parent = undefined 
)

Shows an open file dialog to the user that allows selection of multiple files.

Parameters:
dir The directory that the dialog will start with.
filter The file name filter - e.g. "TIFF files (*.tif *.tiff); JPEG files (*.jpg)";
title The title of the dialog
parent The parent widget of the dialog
Returns:
A list of paths for the files selected by the user (empty if none)
Example:
Have the user select one or more image files
        var files = FileDialog.getOpenFileNames( "", "Image files (*.tif *.jpg *.png)", "Select Image Files" );


Generated on Thu Sep 24 12:21:12 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.