class_filedialog.rst 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the FileDialog.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_FileDialog:
  5. FileDialog
  6. ==========
  7. **Inherits:** :ref:`ConfirmationDialog<class_confirmationdialog>` **<** :ref:`AcceptDialog<class_acceptdialog>` **<** :ref:`WindowDialog<class_windowdialog>` **<** :ref:`Popup<class_popup>` **<** :ref:`Control<class_control>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Dialog for selecting files or directories in the filesystem.
  12. Member Functions
  13. ----------------
  14. +--------------------------------------------+-----------------------------------------------------------------------------------------------+
  15. | void | :ref:`add_filter<class_FileDialog_add_filter>` **(** :ref:`String<class_string>` filter **)** |
  16. +--------------------------------------------+-----------------------------------------------------------------------------------------------+
  17. | void | :ref:`clear_filters<class_FileDialog_clear_filters>` **(** **)** |
  18. +--------------------------------------------+-----------------------------------------------------------------------------------------------+
  19. | void | :ref:`deselect_items<class_FileDialog_deselect_items>` **(** **)** |
  20. +--------------------------------------------+-----------------------------------------------------------------------------------------------+
  21. | :ref:`VBoxContainer<class_vboxcontainer>` | :ref:`get_vbox<class_FileDialog_get_vbox>` **(** **)** |
  22. +--------------------------------------------+-----------------------------------------------------------------------------------------------+
  23. | void | :ref:`invalidate<class_FileDialog_invalidate>` **(** **)** |
  24. +--------------------------------------------+-----------------------------------------------------------------------------------------------+
  25. Signals
  26. -------
  27. .. _class_FileDialog_dir_selected:
  28. - **dir_selected** **(** :ref:`String<class_string>` dir **)**
  29. Event emitted when the user selects a directory.
  30. .. _class_FileDialog_file_selected:
  31. - **file_selected** **(** :ref:`String<class_string>` path **)**
  32. Event emitted when the user selects a file (double clicks it or presses the OK button).
  33. .. _class_FileDialog_files_selected:
  34. - **files_selected** **(** :ref:`PoolStringArray<class_poolstringarray>` paths **)**
  35. Event emitted when the user selects multiple files.
  36. Member Variables
  37. ----------------
  38. .. _class_FileDialog_access:
  39. - :ref:`Access<enum_filedialog_access>` **access**
  40. .. _class_FileDialog_current_dir:
  41. - :ref:`String<class_string>` **current_dir** - The current working directory of the file dialog.
  42. .. _class_FileDialog_current_file:
  43. - :ref:`String<class_string>` **current_file** - The currently selected file of the file dialog.
  44. .. _class_FileDialog_current_path:
  45. - :ref:`String<class_string>` **current_path** - The currently selected file path of the file dialog.
  46. .. _class_FileDialog_filters:
  47. - :ref:`PoolStringArray<class_poolstringarray>` **filters**
  48. .. _class_FileDialog_mode:
  49. - :ref:`Mode<enum_filedialog_mode>` **mode**
  50. .. _class_FileDialog_mode_overrides_title:
  51. - :ref:`bool<class_bool>` **mode_overrides_title** - If ``true``, changing the ``mode`` property will set the window title accordingly (e. g. setting mode to ``MODE_OPEN_FILE`` will change the window title to "Open a File").
  52. .. _class_FileDialog_show_hidden_files:
  53. - :ref:`bool<class_bool>` **show_hidden_files**
  54. Enums
  55. -----
  56. .. _enum_FileDialog_Access:
  57. enum **Access**
  58. - **ACCESS_RESOURCES** = **0** --- The dialog allows the selection of file and directory.
  59. - **ACCESS_USERDATA** = **1** --- The dialog allows access files under :ref:`Resource<class_resource>` path(res://) .
  60. - **ACCESS_FILESYSTEM** = **2** --- The dialog allows access files in whole file system.
  61. .. _enum_FileDialog_Mode:
  62. enum **Mode**
  63. - **MODE_OPEN_FILE** = **0** --- The dialog allows the selection of one, and only one file.
  64. - **MODE_OPEN_FILES** = **1** --- The dialog allows the selection of multiple files.
  65. - **MODE_OPEN_DIR** = **2** --- The dialog functions as a folder selector, disallowing the selection of any file.
  66. - **MODE_OPEN_ANY** = **3** --- The dialog allows the selection of a file or a directory.
  67. - **MODE_SAVE_FILE** = **4** --- The dialog will warn when a file exists.
  68. Description
  69. -----------
  70. FileDialog is a preset dialog used to choose files and directories in the filesystem. It supports filter masks.
  71. Member Function Description
  72. ---------------------------
  73. .. _class_FileDialog_add_filter:
  74. - void **add_filter** **(** :ref:`String<class_string>` filter **)**
  75. Add a custom filter. Filter format is: "mask ; description", example (C++): dialog->add_filter("\*.png ; PNG Images");
  76. .. _class_FileDialog_clear_filters:
  77. - void **clear_filters** **(** **)**
  78. Clear all the added filters in the dialog.
  79. .. _class_FileDialog_deselect_items:
  80. - void **deselect_items** **(** **)**
  81. .. _class_FileDialog_get_vbox:
  82. - :ref:`VBoxContainer<class_vboxcontainer>` **get_vbox** **(** **)**
  83. Return the vertical box container of the dialog, custom controls can be added to it.
  84. .. _class_FileDialog_invalidate:
  85. - void **invalidate** **(** **)**
  86. Invalidate and update the current dialog content list.