FileDialog
Constructors
Description
Creates a new FileDialog window that is not shown by default.
Members
Description
Gets or sets whether the use can select any file type.
Description
Gets or sets if the user is allowed to select a directory in addition to a file.
Description
Gets or sets an array containing the file types (by extension) that are allowed.
Description
Gets or sets whether selecting multiple files is allowed, if the file dialog is a save dialog type this value is ignored.
Description
Gets or sets the directory the file dialog is in.
Description
Gets or sets the filename the file dialog has (specified by the user).
Description
Gets the selection specified by the user once the dialog has been closed. The result is a URL or file path.
Description
Gets or sets the title for the file dialog window.
Description
Gets the type of the file dialog (open or save). This is read only.
Methods
Description
Adds an event listener for various dialog level events. The first parameter is the name of the event, the second parameter is the function to call when the event happens (e.g., a callback).
Parameters
Name | Type | Description |
---|---|---|
eventName | string | The name of the dialog event to start listening to. |
callback | function | The function that will be called when it occurs. |
Description
Opens the file dialog window, if a window object is passed in the file dialog is placed on top of the passed in window preventing any user interaction with it. On OSX this causes a "sheet" effect, on Windows the file dialog is a modal window aligned with the passed in window. Note: Because of security and sandboxing on applications all event loops are paused until a selection is made by the user
Parameters
Name | Type | Description |
---|---|---|
window | Window | The window to associate with this file dialog. |
Description
Removes an event listener for various dialog level events. The first parameter is the name of the event, the second parameter is the function that was originally given as the callback for addEventListener.
Parameters
Name | Type | Description |
---|---|---|
eventName | string | The name of the dialog event to stop listening to. |
callback | function | The function that would have been called. |