class_editorfiledialog.rst 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/EditorFileDialog.xml.
  6. .. _class_EditorFileDialog:
  7. EditorFileDialog
  8. ================
  9. **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>`
  10. A modified version of :ref:`FileDialog<class_FileDialog>` used by the editor.
  11. .. rst-class:: classref-reftable-group
  12. Properties
  13. ----------
  14. .. table::
  15. :widths: auto
  16. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+
  17. | :ref:`Access<enum_EditorFileDialog_Access>` | :ref:`access<class_EditorFileDialog_property_access>` | ``0`` |
  18. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+
  19. | :ref:`String<class_String>` | :ref:`current_dir<class_EditorFileDialog_property_current_dir>` | |
  20. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+
  21. | :ref:`String<class_String>` | :ref:`current_file<class_EditorFileDialog_property_current_file>` | |
  22. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+
  23. | :ref:`String<class_String>` | :ref:`current_path<class_EditorFileDialog_property_current_path>` | |
  24. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+
  25. | :ref:`bool<class_bool>` | dialog_hide_on_ok | ``false`` (overrides :ref:`AcceptDialog<class_AcceptDialog_property_dialog_hide_on_ok>`) |
  26. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+
  27. | :ref:`bool<class_bool>` | :ref:`disable_overwrite_warning<class_EditorFileDialog_property_disable_overwrite_warning>` | ``false`` |
  28. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+
  29. | :ref:`DisplayMode<enum_EditorFileDialog_DisplayMode>` | :ref:`display_mode<class_EditorFileDialog_property_display_mode>` | ``0`` |
  30. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+
  31. | :ref:`Mode<enum_EditorFileDialog_Mode>` | :ref:`mode<class_EditorFileDialog_property_mode>` | ``4`` |
  32. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+
  33. | :ref:`bool<class_bool>` | resizable | ``true`` (overrides :ref:`WindowDialog<class_WindowDialog_property_resizable>`) |
  34. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+
  35. | :ref:`bool<class_bool>` | :ref:`show_hidden_files<class_EditorFileDialog_property_show_hidden_files>` | ``false`` |
  36. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+
  37. | :ref:`String<class_String>` | window_title | ``"Save a File"`` (overrides :ref:`WindowDialog<class_WindowDialog_property_window_title>`) |
  38. +-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------+
  39. .. rst-class:: classref-reftable-group
  40. Methods
  41. -------
  42. .. table::
  43. :widths: auto
  44. +-------------------------------------------+------------------------------------------------------------------------------------------------------------+
  45. | void | :ref:`add_filter<class_EditorFileDialog_method_add_filter>` **(** :ref:`String<class_String>` filter **)** |
  46. +-------------------------------------------+------------------------------------------------------------------------------------------------------------+
  47. | void | :ref:`clear_filters<class_EditorFileDialog_method_clear_filters>` **(** **)** |
  48. +-------------------------------------------+------------------------------------------------------------------------------------------------------------+
  49. | :ref:`VBoxContainer<class_VBoxContainer>` | :ref:`get_vbox<class_EditorFileDialog_method_get_vbox>` **(** **)** |
  50. +-------------------------------------------+------------------------------------------------------------------------------------------------------------+
  51. | void | :ref:`invalidate<class_EditorFileDialog_method_invalidate>` **(** **)** |
  52. +-------------------------------------------+------------------------------------------------------------------------------------------------------------+
  53. .. rst-class:: classref-section-separator
  54. ----
  55. .. rst-class:: classref-descriptions-group
  56. Signals
  57. -------
  58. .. _class_EditorFileDialog_signal_dir_selected:
  59. .. rst-class:: classref-signal
  60. **dir_selected** **(** :ref:`String<class_String>` dir **)**
  61. Emitted when a directory is selected.
  62. .. rst-class:: classref-item-separator
  63. ----
  64. .. _class_EditorFileDialog_signal_file_selected:
  65. .. rst-class:: classref-signal
  66. **file_selected** **(** :ref:`String<class_String>` path **)**
  67. Emitted when a file is selected.
  68. .. rst-class:: classref-item-separator
  69. ----
  70. .. _class_EditorFileDialog_signal_files_selected:
  71. .. rst-class:: classref-signal
  72. **files_selected** **(** :ref:`PoolStringArray<class_PoolStringArray>` paths **)**
  73. Emitted when multiple files are selected.
  74. .. rst-class:: classref-section-separator
  75. ----
  76. .. rst-class:: classref-descriptions-group
  77. Enumerations
  78. ------------
  79. .. _enum_EditorFileDialog_Mode:
  80. .. rst-class:: classref-enumeration
  81. enum **Mode**:
  82. .. _class_EditorFileDialog_constant_MODE_OPEN_FILE:
  83. .. rst-class:: classref-enumeration-constant
  84. :ref:`Mode<enum_EditorFileDialog_Mode>` **MODE_OPEN_FILE** = ``0``
  85. The **EditorFileDialog** can select only one file. Accepting the window will open the file.
  86. .. _class_EditorFileDialog_constant_MODE_OPEN_FILES:
  87. .. rst-class:: classref-enumeration-constant
  88. :ref:`Mode<enum_EditorFileDialog_Mode>` **MODE_OPEN_FILES** = ``1``
  89. The **EditorFileDialog** can select multiple files. Accepting the window will open all files.
  90. .. _class_EditorFileDialog_constant_MODE_OPEN_DIR:
  91. .. rst-class:: classref-enumeration-constant
  92. :ref:`Mode<enum_EditorFileDialog_Mode>` **MODE_OPEN_DIR** = ``2``
  93. The **EditorFileDialog** can select only one directory. Accepting the window will open the directory.
  94. .. _class_EditorFileDialog_constant_MODE_OPEN_ANY:
  95. .. rst-class:: classref-enumeration-constant
  96. :ref:`Mode<enum_EditorFileDialog_Mode>` **MODE_OPEN_ANY** = ``3``
  97. The **EditorFileDialog** can select a file or directory. Accepting the window will open it.
  98. .. _class_EditorFileDialog_constant_MODE_SAVE_FILE:
  99. .. rst-class:: classref-enumeration-constant
  100. :ref:`Mode<enum_EditorFileDialog_Mode>` **MODE_SAVE_FILE** = ``4``
  101. The **EditorFileDialog** can select only one file. Accepting the window will save the file.
  102. .. rst-class:: classref-item-separator
  103. ----
  104. .. _enum_EditorFileDialog_Access:
  105. .. rst-class:: classref-enumeration
  106. enum **Access**:
  107. .. _class_EditorFileDialog_constant_ACCESS_RESOURCES:
  108. .. rst-class:: classref-enumeration-constant
  109. :ref:`Access<enum_EditorFileDialog_Access>` **ACCESS_RESOURCES** = ``0``
  110. The **EditorFileDialog** can only view ``res://`` directory contents.
  111. .. _class_EditorFileDialog_constant_ACCESS_USERDATA:
  112. .. rst-class:: classref-enumeration-constant
  113. :ref:`Access<enum_EditorFileDialog_Access>` **ACCESS_USERDATA** = ``1``
  114. The **EditorFileDialog** can only view ``user://`` directory contents.
  115. .. _class_EditorFileDialog_constant_ACCESS_FILESYSTEM:
  116. .. rst-class:: classref-enumeration-constant
  117. :ref:`Access<enum_EditorFileDialog_Access>` **ACCESS_FILESYSTEM** = ``2``
  118. The **EditorFileDialog** can view the entire local file system.
  119. .. rst-class:: classref-item-separator
  120. ----
  121. .. _enum_EditorFileDialog_DisplayMode:
  122. .. rst-class:: classref-enumeration
  123. enum **DisplayMode**:
  124. .. _class_EditorFileDialog_constant_DISPLAY_THUMBNAILS:
  125. .. rst-class:: classref-enumeration-constant
  126. :ref:`DisplayMode<enum_EditorFileDialog_DisplayMode>` **DISPLAY_THUMBNAILS** = ``0``
  127. The **EditorFileDialog** displays resources as thumbnails.
  128. .. _class_EditorFileDialog_constant_DISPLAY_LIST:
  129. .. rst-class:: classref-enumeration-constant
  130. :ref:`DisplayMode<enum_EditorFileDialog_DisplayMode>` **DISPLAY_LIST** = ``1``
  131. The **EditorFileDialog** displays resources as a list of filenames.
  132. .. rst-class:: classref-section-separator
  133. ----
  134. .. rst-class:: classref-descriptions-group
  135. Property Descriptions
  136. ---------------------
  137. .. _class_EditorFileDialog_property_access:
  138. .. rst-class:: classref-property
  139. :ref:`Access<enum_EditorFileDialog_Access>` **access** = ``0``
  140. .. rst-class:: classref-property-setget
  141. - void **set_access** **(** :ref:`Access<enum_EditorFileDialog_Access>` value **)**
  142. - :ref:`Access<enum_EditorFileDialog_Access>` **get_access** **(** **)**
  143. The location from which the user may select a file, including ``res://``, ``user://``, and the local file system.
  144. .. rst-class:: classref-item-separator
  145. ----
  146. .. _class_EditorFileDialog_property_current_dir:
  147. .. rst-class:: classref-property
  148. :ref:`String<class_String>` **current_dir**
  149. .. rst-class:: classref-property-setget
  150. - void **set_current_dir** **(** :ref:`String<class_String>` value **)**
  151. - :ref:`String<class_String>` **get_current_dir** **(** **)**
  152. The currently occupied directory.
  153. .. rst-class:: classref-item-separator
  154. ----
  155. .. _class_EditorFileDialog_property_current_file:
  156. .. rst-class:: classref-property
  157. :ref:`String<class_String>` **current_file**
  158. .. rst-class:: classref-property-setget
  159. - void **set_current_file** **(** :ref:`String<class_String>` value **)**
  160. - :ref:`String<class_String>` **get_current_file** **(** **)**
  161. The currently selected file.
  162. .. rst-class:: classref-item-separator
  163. ----
  164. .. _class_EditorFileDialog_property_current_path:
  165. .. rst-class:: classref-property
  166. :ref:`String<class_String>` **current_path**
  167. .. rst-class:: classref-property-setget
  168. - void **set_current_path** **(** :ref:`String<class_String>` value **)**
  169. - :ref:`String<class_String>` **get_current_path** **(** **)**
  170. The file system path in the address bar.
  171. .. rst-class:: classref-item-separator
  172. ----
  173. .. _class_EditorFileDialog_property_disable_overwrite_warning:
  174. .. rst-class:: classref-property
  175. :ref:`bool<class_bool>` **disable_overwrite_warning** = ``false``
  176. .. rst-class:: classref-property-setget
  177. - void **set_disable_overwrite_warning** **(** :ref:`bool<class_bool>` value **)**
  178. - :ref:`bool<class_bool>` **is_overwrite_warning_disabled** **(** **)**
  179. If ``true``, the **EditorFileDialog** will not warn the user before overwriting files.
  180. .. rst-class:: classref-item-separator
  181. ----
  182. .. _class_EditorFileDialog_property_display_mode:
  183. .. rst-class:: classref-property
  184. :ref:`DisplayMode<enum_EditorFileDialog_DisplayMode>` **display_mode** = ``0``
  185. .. rst-class:: classref-property-setget
  186. - void **set_display_mode** **(** :ref:`DisplayMode<enum_EditorFileDialog_DisplayMode>` value **)**
  187. - :ref:`DisplayMode<enum_EditorFileDialog_DisplayMode>` **get_display_mode** **(** **)**
  188. The view format in which the **EditorFileDialog** displays resources to the user.
  189. .. rst-class:: classref-item-separator
  190. ----
  191. .. _class_EditorFileDialog_property_mode:
  192. .. rst-class:: classref-property
  193. :ref:`Mode<enum_EditorFileDialog_Mode>` **mode** = ``4``
  194. .. rst-class:: classref-property-setget
  195. - void **set_mode** **(** :ref:`Mode<enum_EditorFileDialog_Mode>` value **)**
  196. - :ref:`Mode<enum_EditorFileDialog_Mode>` **get_mode** **(** **)**
  197. The purpose of the **EditorFileDialog**, which defines the allowed behaviors.
  198. .. rst-class:: classref-item-separator
  199. ----
  200. .. _class_EditorFileDialog_property_show_hidden_files:
  201. .. rst-class:: classref-property
  202. :ref:`bool<class_bool>` **show_hidden_files** = ``false``
  203. .. rst-class:: classref-property-setget
  204. - void **set_show_hidden_files** **(** :ref:`bool<class_bool>` value **)**
  205. - :ref:`bool<class_bool>` **is_showing_hidden_files** **(** **)**
  206. If ``true``, hidden files and directories will be visible in the **EditorFileDialog**.
  207. .. rst-class:: classref-section-separator
  208. ----
  209. .. rst-class:: classref-descriptions-group
  210. Method Descriptions
  211. -------------------
  212. .. _class_EditorFileDialog_method_add_filter:
  213. .. rst-class:: classref-method
  214. void **add_filter** **(** :ref:`String<class_String>` filter **)**
  215. Adds a comma-delimited file extension filter option to the **EditorFileDialog** with an optional semi-colon-delimited label.
  216. For example, ``"*.tscn, *.scn; Scenes"`` results in filter text "Scenes (\*.tscn, \*.scn)".
  217. .. rst-class:: classref-item-separator
  218. ----
  219. .. _class_EditorFileDialog_method_clear_filters:
  220. .. rst-class:: classref-method
  221. void **clear_filters** **(** **)**
  222. Removes all filters except for "All Files (\*)".
  223. .. rst-class:: classref-item-separator
  224. ----
  225. .. _class_EditorFileDialog_method_get_vbox:
  226. .. rst-class:: classref-method
  227. :ref:`VBoxContainer<class_VBoxContainer>` **get_vbox** **(** **)**
  228. Returns the ``VBoxContainer`` used to display the file system.
  229. \ **Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use their :ref:`CanvasItem.visible<class_CanvasItem_property_visible>` property.
  230. .. rst-class:: classref-item-separator
  231. ----
  232. .. _class_EditorFileDialog_method_invalidate:
  233. .. rst-class:: classref-method
  234. void **invalidate** **(** **)**
  235. Notify the **EditorFileDialog** that its view of the data is no longer accurate. Updates the view contents on next view update.
  236. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  237. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  238. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  239. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`