2017-09-12 22:42:36 +02:00
<?xml version="1.0" encoding="UTF-8" ?>
2021-04-26 13:14:51 +02:00
<class name= "FileDialog" inherits= "ConfirmationDialog" version= "3.4" >
2017-09-12 22:42:36 +02:00
<brief_description >
Dialog for selecting files or directories in the filesystem.
</brief_description>
<description >
2020-06-05 15:47:45 +02:00
FileDialog is a preset dialog used to choose files and directories in the filesystem. It supports filter masks. The FileDialog automatically sets its window title according to the [member mode]. If you want to use a custom title, disable this by setting [member mode_overrides_title] to [code]false[/code].
2017-09-12 22:42:36 +02:00
</description>
<tutorials >
</tutorials>
<methods >
<method name= "add_filter" >
<return type= "void" >
</return>
<argument index= "0" name= "filter" type= "String" >
</argument>
<description >
2019-06-22 01:04:47 +02:00
Adds [code]filter[/code] as a custom filter; [code]filter[/code] should be of the form [code]"filename.extension ; Description"[/code]. For example, [code]"*.png ; PNG Images"[/code].
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "clear_filters" >
<return type= "void" >
</return>
<description >
Clear all the added filters in the dialog.
</description>
</method>
2017-11-27 23:37:47 +01:00
<method name= "deselect_items" >
<return type= "void" >
</return>
<description >
2018-10-11 19:28:36 +02:00
Clear currently selected items in the dialog.
2017-11-27 23:37:47 +01:00
</description>
</method>
2018-06-11 18:41:16 +02:00
<method name= "get_line_edit" >
<return type= "LineEdit" >
</return>
<description >
2018-10-11 19:28:36 +02:00
Returns the LineEdit for the selected file.
2018-06-11 18:41:16 +02:00
</description>
</method>
2017-09-12 22:42:36 +02:00
<method name= "get_vbox" >
<return type= "VBoxContainer" >
</return>
<description >
2019-05-24 04:15:43 +02:00
Returns the vertical box container of the dialog, custom controls can be added to it.
2017-09-12 22:42:36 +02:00
</description>
</method>
<method name= "invalidate" >
<return type= "void" >
</return>
<description >
Invalidate and update the current dialog content list.
</description>
</method>
</methods>
<members >
2019-06-29 12:38:01 +02:00
<member name= "access" type= "int" setter= "set_access" getter= "get_access" enum= "FileDialog.Access" default= "0" >
2018-10-11 19:28:36 +02:00
The file system access scope. See enum [code]Access[/code] constants.
2020-09-01 00:58:51 +02:00
[b]Warning:[/b] Currently, in sandboxed environments such as HTML5 builds or sandboxed macOS apps, FileDialog cannot access the host file system. See [url=https://github.com/godotengine/godot-proposals/issues/1123]godot-proposals#1123[/url].
2017-09-12 22:42:36 +02:00
</member>
2019-06-29 12:38:01 +02:00
<member name= "current_dir" type= "String" setter= "set_current_dir" getter= "get_current_dir" default= ""res://"" >
2018-01-11 23:38:35 +01:00
The current working directory of the file dialog.
</member>
2019-06-29 12:38:01 +02:00
<member name= "current_file" type= "String" setter= "set_current_file" getter= "get_current_file" default= """" >
2018-01-11 23:38:35 +01:00
The currently selected file of the file dialog.
</member>
2019-06-29 12:38:01 +02:00
<member name= "current_path" type= "String" setter= "set_current_path" getter= "get_current_path" default= ""res://"" >
2018-01-11 23:38:35 +01:00
The currently selected file path of the file dialog.
</member>
2019-09-24 13:34:03 +02:00
<member name= "dialog_hide_on_ok" type= "bool" setter= "set_hide_on_ok" getter= "get_hide_on_ok" override= "true" default= "false" />
2019-06-29 12:38:01 +02:00
<member name= "filters" type= "PoolStringArray" setter= "set_filters" getter= "get_filters" default= "PoolStringArray( )" >
2019-06-22 01:04:47 +02:00
The available file type filters. For example, this shows only [code].png[/code] and [code].gd[/code] files: [code]set_filters(PoolStringArray(["*.png ; PNG Images","*.gd ; GDScript Files"]))[/code].
2017-09-12 22:42:36 +02:00
</member>
2019-06-29 12:38:01 +02:00
<member name= "mode" type= "int" setter= "set_mode" getter= "get_mode" enum= "FileDialog.Mode" default= "4" >
2019-06-22 01:04:47 +02:00
The dialog's open or save mode, which affects the selection behavior. See enum [code]Mode[/code] constants.
2017-09-12 22:42:36 +02:00
</member>
2019-06-29 12:38:01 +02:00
<member name= "mode_overrides_title" type= "bool" setter= "set_mode_overrides_title" getter= "is_mode_overriding_title" default= "true" >
2019-06-27 12:34:26 +02:00
If [code]true[/code], changing the [code]Mode[/code] property will set the window title accordingly (e.g. setting mode to [constant MODE_OPEN_FILE] will change the window title to "Open a File").
2017-12-03 02:54:06 +01:00
</member>
2019-06-29 12:38:01 +02:00
<member name= "show_hidden_files" type= "bool" setter= "set_show_hidden_files" getter= "is_showing_hidden_files" default= "false" >
2018-10-11 19:28:36 +02:00
If [code]true[/code], the dialog will show hidden files.
2017-09-12 22:42:36 +02:00
</member>
2019-09-24 13:34:03 +02:00
<member name= "window_title" type= "String" setter= "set_title" getter= "get_title" override= "true" default= ""Save a File"" />
2017-09-12 22:42:36 +02:00
</members>
<signals >
<signal name= "dir_selected" >
<argument index= "0" name= "dir" type= "String" >
</argument>
<description >
2019-06-22 01:04:47 +02:00
Emitted when the user selects a directory.
2017-09-12 22:42:36 +02:00
</description>
</signal>
<signal name= "file_selected" >
<argument index= "0" name= "path" type= "String" >
</argument>
<description >
2019-06-22 01:04:47 +02:00
Emitted when the user selects a file by double-clicking it or pressing the [b]OK[/b] button.
2017-09-12 22:42:36 +02:00
</description>
</signal>
<signal name= "files_selected" >
<argument index= "0" name= "paths" type= "PoolStringArray" >
</argument>
<description >
2019-06-22 01:04:47 +02:00
Emitted when the user selects multiple files.
2017-09-12 22:42:36 +02:00
</description>
</signal>
</signals>
<constants >
2017-11-24 23:16:30 +01:00
<constant name= "MODE_OPEN_FILE" value= "0" enum= "Mode" >
2019-06-22 01:04:47 +02:00
The dialog allows selecting one, and only one file.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "MODE_OPEN_FILES" value= "1" enum= "Mode" >
2019-06-22 01:04:47 +02:00
The dialog allows selecting multiple files.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "MODE_OPEN_DIR" value= "2" enum= "Mode" >
2019-06-22 01:04:47 +02:00
The dialog only allows selecting a directory, disallowing the selection of any file.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "MODE_OPEN_ANY" value= "3" enum= "Mode" >
2019-06-22 01:04:47 +02:00
The dialog allows selecting one file or directory.
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "MODE_SAVE_FILE" value= "4" enum= "Mode" >
2017-09-12 22:42:36 +02:00
The dialog will warn when a file exists.
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ACCESS_RESOURCES" value= "0" enum= "Access" >
2019-06-22 01:04:47 +02:00
The dialog only allows accessing files under the [Resource] path ([code]res://[/code]).
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ACCESS_USERDATA" value= "1" enum= "Access" >
2019-06-22 01:04:47 +02:00
The dialog only allows accessing files under user data path ([code]user://[/code]).
2017-09-12 22:42:36 +02:00
</constant>
2017-11-24 23:16:30 +01:00
<constant name= "ACCESS_FILESYSTEM" value= "2" enum= "Access" >
2019-06-22 01:04:47 +02:00
The dialog allows accessing files on the whole file system.
2017-09-12 22:42:36 +02:00
</constant>
</constants>
<theme_items >
2020-06-08 14:41:45 +02:00
<theme_item name= "file" type= "Texture" >
Custom icon for files.
</theme_item>
<theme_item name= "file_icon_modulate" type= "Color" default= "Color( 1, 1, 1, 1 )" >
The color modulation applied to the file icon.
</theme_item>
2019-06-29 12:38:01 +02:00
<theme_item name= "files_disabled" type= "Color" default= "Color( 0, 0, 0, 0.7 )" >
2020-03-03 19:21:21 +01:00
The color tint for disabled files (when the [FileDialog] is used in open folder mode).
2017-09-12 22:42:36 +02:00
</theme_item>
<theme_item name= "folder" type= "Texture" >
2020-03-03 19:21:21 +01:00
Custom icon for folders.
2017-09-12 22:42:36 +02:00
</theme_item>
2019-08-21 18:43:01 +02:00
<theme_item name= "folder_icon_modulate" type= "Color" default= "Color( 1, 1, 1, 1 )" >
2020-03-03 19:21:21 +01:00
The color modulation applied to the folder icon.
2019-08-21 18:43:01 +02:00
</theme_item>
2017-12-07 08:23:08 +01:00
<theme_item name= "parent_folder" type= "Texture" >
2020-03-03 19:21:21 +01:00
Custom icon for the parent folder arrow.
2017-12-07 08:23:08 +01:00
</theme_item>
2017-09-12 22:42:36 +02:00
<theme_item name= "reload" type= "Texture" >
2020-03-03 19:21:21 +01:00
Custom icon for the reload button.
2017-09-12 22:42:36 +02:00
</theme_item>
2019-06-15 00:04:55 +02:00
<theme_item name= "toggle_hidden" type= "Texture" >
2020-03-03 19:21:21 +01:00
Custom icon for the toggle hidden button.
2019-06-15 00:04:55 +02:00
</theme_item>
2017-09-12 22:42:36 +02:00
</theme_items>
</class>