FileDialog¶
Inherits: ConfirmationDialog < AcceptDialog < WindowDialog < Popup < Control < CanvasItem < Node < Object
Category: Core
Brief Description¶
Dialog for selecting files or directories in the filesystem.
Member Functions¶
void | add_filter ( String filter ) |
void | clear_filters ( ) |
int | get_access ( ) const |
String | get_current_dir ( ) const |
String | get_current_file ( ) const |
String | get_current_path ( ) const |
PoolStringArray | get_filters ( ) const |
int | get_mode ( ) const |
VBoxContainer | get_vbox ( ) |
void | invalidate ( ) |
bool | is_showing_hidden_files ( ) const |
void | set_access ( int access ) |
void | set_current_dir ( String dir ) |
void | set_current_file ( String file ) |
void | set_current_path ( String path ) |
void | set_filters ( PoolStringArray filters ) |
void | set_mode ( int mode ) |
void | set_show_hidden_files ( bool show ) |
Signals¶
- dir_selected ( String dir )
Event emitted when the user selects a directory.
- file_selected ( String path )
Event emitted when the user selects a file (double clicks it or presses the OK button).
- files_selected ( StringArray paths )
Event emitted when the user selects multiple files.
Numeric Constants¶
- MODE_OPEN_FILE = 0 — The dialog allows the selection of one, and only one file.
- MODE_OPEN_FILES = 1 — The dialog allows the selection of multiple files.
- MODE_OPEN_DIR = 2 — The dialog functions as a folder selector, disallowing the selection of any file.
- MODE_OPEN_ANY = 3 — The dialog allows the selection of a file or a directory.
- MODE_SAVE_FILE = 4 — The dialog will warn when a file exists.
- ACCESS_RESOURCES = 0 — The dialog allows the selection of file and directory.
- ACCESS_USERDATA = 1 — The dialog allows ascess files under Resource path(res://) .
- ACCESS_FILESYSTEM = 2 — The dialog allows ascess files in whole file system.
Description¶
FileDialog is a preset dialog used to choose files and directories in the filesystem. It supports filter masks.
Member Function Description¶
- void add_filter ( String filter )
Add a custom filter. Filter format is: “mask ; description”, example (C++): dialog->add_filter(“*.png ; PNG Images”);
- void clear_filters ( )
Clear all the added filters in the dialog.
- int get_access ( ) const
Return the file access permission of the dialog.
- String get_current_dir ( ) const
Get the current working directory of the file dialog.
- String get_current_file ( ) const
Get the current selected file of the file dialog (empty if none).
- String get_current_path ( ) const
Get the current selected path (directory and file) of the file dialog (empty if none).
- PoolStringArray get_filters ( ) const
- int get_mode ( ) const
Get the file dialog mode from the MODE_* enum.
- VBoxContainer get_vbox ( )
Return the vertical box container of the dialog, custom controls can be added to it.
- void invalidate ( )
Invalidate and update the current dialog content list.
Return true if the diaog allows show hidden files.
- void set_access ( int access )
Set the file access permission of the dialog(Must be one of ACCESS_RESOURCES, ACCESS_USERDATA or ACCESS_FILESYSTEM).
- void set_current_dir ( String dir )
Set the current working directory of the file dialog.
- void set_current_file ( String file )
Set the current selected file name of the file dialog.
- void set_current_path ( String path )
Set the current selected file path of the file dialog.
- void set_filters ( PoolStringArray filters )
- void set_mode ( int mode )
Set the file dialog mode from the MODE_* enum.
Set the dialog should show hidden files.