.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_FileDialog: FileDialog ========== **Inherits:** :ref:`ConfirmationDialog` **<** :ref:`AcceptDialog` **<** :ref:`WindowDialog` **<** :ref:`Popup` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` **Category:** Core Brief Description ----------------- Dialog for selecting files or directories in the filesystem. Member Functions ---------------- +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | void | :ref:`add_filter` **(** :ref:`String` filter **)** | +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | void | :ref:`clear_filters` **(** **)** | +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_access` **(** **)** const | +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_current_dir` **(** **)** const | +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_current_file` **(** **)** const | +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_current_path` **(** **)** const | +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :ref:`PoolStringArray` | :ref:`get_filters` **(** **)** const | +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_mode` **(** **)** const | +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :ref:`VBoxContainer` | :ref:`get_vbox` **(** **)** | +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | void | :ref:`invalidate` **(** **)** | +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_showing_hidden_files` **(** **)** const | +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_access` **(** :ref:`int` access **)** | +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_current_dir` **(** :ref:`String` dir **)** | +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_current_file` **(** :ref:`String` file **)** | +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_current_path` **(** :ref:`String` path **)** | +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_filters` **(** :ref:`PoolStringArray` filters **)** | +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_mode` **(** :ref:`int` mode **)** | +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_show_hidden_files` **(** :ref:`bool` show **)** | +------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+ Signals ------- - **dir_selected** **(** :ref:`String` dir **)** Event emitted when the user selects a directory. - **file_selected** **(** :ref:`String` path **)** Event emitted when the user selects a file (double clicks it or presses the OK button). - **files_selected** **(** :ref:`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 :ref:`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 --------------------------- .. _class_FileDialog_add_filter: - void **add_filter** **(** :ref:`String` filter **)** Add a custom filter. Filter format is: "mask ; description", example (C++): dialog->add_filter("\*.png ; PNG Images"); .. _class_FileDialog_clear_filters: - void **clear_filters** **(** **)** Clear all the added filters in the dialog. .. _class_FileDialog_get_access: - :ref:`int` **get_access** **(** **)** const Return the file access permission of the dialog. .. _class_FileDialog_get_current_dir: - :ref:`String` **get_current_dir** **(** **)** const Get the current working directory of the file dialog. .. _class_FileDialog_get_current_file: - :ref:`String` **get_current_file** **(** **)** const Get the current selected file of the file dialog (empty if none). .. _class_FileDialog_get_current_path: - :ref:`String` **get_current_path** **(** **)** const Get the current selected path (directory and file) of the file dialog (empty if none). .. _class_FileDialog_get_filters: - :ref:`PoolStringArray` **get_filters** **(** **)** const .. _class_FileDialog_get_mode: - :ref:`int` **get_mode** **(** **)** const Get the file dialog mode from the MODE\_\* enum. .. _class_FileDialog_get_vbox: - :ref:`VBoxContainer` **get_vbox** **(** **)** Return the vertical box container of the dialog, custom controls can be added to it. .. _class_FileDialog_invalidate: - void **invalidate** **(** **)** Invalidate and update the current dialog content list. .. _class_FileDialog_is_showing_hidden_files: - :ref:`bool` **is_showing_hidden_files** **(** **)** const Return true if the diaog allows show hidden files. .. _class_FileDialog_set_access: - void **set_access** **(** :ref:`int` access **)** Set the file access permission of the dialog(Must be one of ACCESS_RESOURCES, ACCESS_USERDATA or ACCESS_FILESYSTEM). .. _class_FileDialog_set_current_dir: - void **set_current_dir** **(** :ref:`String` dir **)** Set the current working directory of the file dialog. .. _class_FileDialog_set_current_file: - void **set_current_file** **(** :ref:`String` file **)** Set the current selected file name of the file dialog. .. _class_FileDialog_set_current_path: - void **set_current_path** **(** :ref:`String` path **)** Set the current selected file path of the file dialog. .. _class_FileDialog_set_filters: - void **set_filters** **(** :ref:`PoolStringArray` filters **)** .. _class_FileDialog_set_mode: - void **set_mode** **(** :ref:`int` mode **)** Set the file dialog mode from the MODE\_\* enum. .. _class_FileDialog_set_show_hidden_files: - void **set_show_hidden_files** **(** :ref:`bool` show **)** Set the dialog should show hidden files.