class_filedialog.rst 63 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/FileDialog.xml.
  6. .. _class_FileDialog:
  7. FileDialog
  8. ==========
  9. **Inherits:** :ref:`ConfirmationDialog<class_ConfirmationDialog>` **<** :ref:`AcceptDialog<class_AcceptDialog>` **<** :ref:`Window<class_Window>` **<** :ref:`Viewport<class_Viewport>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A dialog for selecting files or directories in the filesystem.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **FileDialog** is a preset dialog used to choose files and directories in the filesystem. It supports filter masks. **FileDialog** automatically sets its window title according to the :ref:`file_mode<class_FileDialog_property_file_mode>`. If you want to use a custom title, disable this by setting :ref:`mode_overrides_title<class_FileDialog_property_mode_overrides_title>` to ``false``.
  15. .. rst-class:: classref-reftable-group
  16. Properties
  17. ----------
  18. .. table::
  19. :widths: auto
  20. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  21. | :ref:`Access<enum_FileDialog_Access>` | :ref:`access<class_FileDialog_property_access>` | ``0`` |
  22. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  23. | :ref:`String<class_String>` | :ref:`current_dir<class_FileDialog_property_current_dir>` | |
  24. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  25. | :ref:`String<class_String>` | :ref:`current_file<class_FileDialog_property_current_file>` | |
  26. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  27. | :ref:`String<class_String>` | :ref:`current_path<class_FileDialog_property_current_path>` | |
  28. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  29. | :ref:`bool<class_bool>` | dialog_hide_on_ok | ``false`` (overrides :ref:`AcceptDialog<class_AcceptDialog_property_dialog_hide_on_ok>`) |
  30. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  31. | :ref:`DisplayMode<enum_FileDialog_DisplayMode>` | :ref:`display_mode<class_FileDialog_property_display_mode>` | ``0`` |
  32. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  33. | :ref:`bool<class_bool>` | :ref:`favorites_enabled<class_FileDialog_property_favorites_enabled>` | ``true`` |
  34. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  35. | :ref:`bool<class_bool>` | :ref:`file_filter_toggle_enabled<class_FileDialog_property_file_filter_toggle_enabled>` | ``true`` |
  36. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  37. | :ref:`FileMode<enum_FileDialog_FileMode>` | :ref:`file_mode<class_FileDialog_property_file_mode>` | ``4`` |
  38. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`file_sort_options_enabled<class_FileDialog_property_file_sort_options_enabled>` | ``true`` |
  40. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  41. | :ref:`String<class_String>` | :ref:`filename_filter<class_FileDialog_property_filename_filter>` | ``""`` |
  42. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  43. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`filters<class_FileDialog_property_filters>` | ``PackedStringArray()`` |
  44. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  45. | :ref:`bool<class_bool>` | :ref:`folder_creation_enabled<class_FileDialog_property_folder_creation_enabled>` | ``true`` |
  46. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  47. | :ref:`bool<class_bool>` | :ref:`hidden_files_toggle_enabled<class_FileDialog_property_hidden_files_toggle_enabled>` | ``true`` |
  48. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  49. | :ref:`bool<class_bool>` | :ref:`layout_toggle_enabled<class_FileDialog_property_layout_toggle_enabled>` | ``true`` |
  50. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  51. | :ref:`bool<class_bool>` | :ref:`mode_overrides_title<class_FileDialog_property_mode_overrides_title>` | ``true`` |
  52. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  53. | :ref:`int<class_int>` | :ref:`option_count<class_FileDialog_property_option_count>` | ``0`` |
  54. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  55. | :ref:`bool<class_bool>` | :ref:`recent_list_enabled<class_FileDialog_property_recent_list_enabled>` | ``true`` |
  56. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  57. | :ref:`String<class_String>` | :ref:`root_subfolder<class_FileDialog_property_root_subfolder>` | ``""`` |
  58. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  59. | :ref:`bool<class_bool>` | :ref:`show_hidden_files<class_FileDialog_property_show_hidden_files>` | ``false`` |
  60. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  61. | :ref:`Vector2i<class_Vector2i>` | size | ``Vector2i(640, 360)`` (overrides :ref:`Window<class_Window_property_size>`) |
  62. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  63. | :ref:`String<class_String>` | title | ``"Save a File"`` (overrides :ref:`Window<class_Window_property_title>`) |
  64. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  65. | :ref:`bool<class_bool>` | :ref:`use_native_dialog<class_FileDialog_property_use_native_dialog>` | ``false`` |
  66. +---------------------------------------------------+-------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+
  67. .. rst-class:: classref-reftable-group
  68. Methods
  69. -------
  70. .. table::
  71. :widths: auto
  72. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  73. | |void| | :ref:`add_filter<class_FileDialog_method_add_filter>`\ (\ filter\: :ref:`String<class_String>`, description\: :ref:`String<class_String>` = ""\ ) |
  74. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  75. | |void| | :ref:`add_option<class_FileDialog_method_add_option>`\ (\ name\: :ref:`String<class_String>`, values\: :ref:`PackedStringArray<class_PackedStringArray>`, default_value_index\: :ref:`int<class_int>`\ ) |
  76. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  77. | |void| | :ref:`clear_filename_filter<class_FileDialog_method_clear_filename_filter>`\ (\ ) |
  78. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  79. | |void| | :ref:`clear_filters<class_FileDialog_method_clear_filters>`\ (\ ) |
  80. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  81. | |void| | :ref:`deselect_all<class_FileDialog_method_deselect_all>`\ (\ ) |
  82. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  83. | :ref:`LineEdit<class_LineEdit>` | :ref:`get_line_edit<class_FileDialog_method_get_line_edit>`\ (\ ) |
  84. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  85. | :ref:`int<class_int>` | :ref:`get_option_default<class_FileDialog_method_get_option_default>`\ (\ option\: :ref:`int<class_int>`\ ) |const| |
  86. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  87. | :ref:`String<class_String>` | :ref:`get_option_name<class_FileDialog_method_get_option_name>`\ (\ option\: :ref:`int<class_int>`\ ) |const| |
  88. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  89. | :ref:`PackedStringArray<class_PackedStringArray>` | :ref:`get_option_values<class_FileDialog_method_get_option_values>`\ (\ option\: :ref:`int<class_int>`\ ) |const| |
  90. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  91. | :ref:`Dictionary<class_Dictionary>` | :ref:`get_selected_options<class_FileDialog_method_get_selected_options>`\ (\ ) |const| |
  92. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  93. | :ref:`VBoxContainer<class_VBoxContainer>` | :ref:`get_vbox<class_FileDialog_method_get_vbox>`\ (\ ) |
  94. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  95. | |void| | :ref:`invalidate<class_FileDialog_method_invalidate>`\ (\ ) |
  96. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  97. | :ref:`bool<class_bool>` | :ref:`is_customization_flag_enabled<class_FileDialog_method_is_customization_flag_enabled>`\ (\ flag\: :ref:`Customization<enum_FileDialog_Customization>`\ ) |const| |
  98. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  99. | |void| | :ref:`set_customization_flag_enabled<class_FileDialog_method_set_customization_flag_enabled>`\ (\ flag\: :ref:`Customization<enum_FileDialog_Customization>`, enabled\: :ref:`bool<class_bool>`\ ) |
  100. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  101. | |void| | :ref:`set_option_default<class_FileDialog_method_set_option_default>`\ (\ option\: :ref:`int<class_int>`, default_value_index\: :ref:`int<class_int>`\ ) |
  102. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  103. | |void| | :ref:`set_option_name<class_FileDialog_method_set_option_name>`\ (\ option\: :ref:`int<class_int>`, name\: :ref:`String<class_String>`\ ) |
  104. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  105. | |void| | :ref:`set_option_values<class_FileDialog_method_set_option_values>`\ (\ option\: :ref:`int<class_int>`, values\: :ref:`PackedStringArray<class_PackedStringArray>`\ ) |
  106. +---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  107. .. rst-class:: classref-reftable-group
  108. Theme Properties
  109. ----------------
  110. .. table::
  111. :widths: auto
  112. +-----------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  113. | :ref:`Color<class_Color>` | :ref:`file_disabled_color<class_FileDialog_theme_color_file_disabled_color>` | ``Color(1, 1, 1, 0.25)`` |
  114. +-----------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  115. | :ref:`Color<class_Color>` | :ref:`file_icon_color<class_FileDialog_theme_color_file_icon_color>` | ``Color(1, 1, 1, 1)`` |
  116. +-----------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  117. | :ref:`Color<class_Color>` | :ref:`folder_icon_color<class_FileDialog_theme_color_folder_icon_color>` | ``Color(1, 1, 1, 1)`` |
  118. +-----------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  119. | :ref:`int<class_int>` | :ref:`thumbnail_size<class_FileDialog_theme_constant_thumbnail_size>` | ``64`` |
  120. +-----------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  121. | :ref:`Texture2D<class_Texture2D>` | :ref:`back_folder<class_FileDialog_theme_icon_back_folder>` | |
  122. +-----------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  123. | :ref:`Texture2D<class_Texture2D>` | :ref:`create_folder<class_FileDialog_theme_icon_create_folder>` | |
  124. +-----------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  125. | :ref:`Texture2D<class_Texture2D>` | :ref:`favorite<class_FileDialog_theme_icon_favorite>` | |
  126. +-----------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  127. | :ref:`Texture2D<class_Texture2D>` | :ref:`favorite_down<class_FileDialog_theme_icon_favorite_down>` | |
  128. +-----------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  129. | :ref:`Texture2D<class_Texture2D>` | :ref:`favorite_up<class_FileDialog_theme_icon_favorite_up>` | |
  130. +-----------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  131. | :ref:`Texture2D<class_Texture2D>` | :ref:`file<class_FileDialog_theme_icon_file>` | |
  132. +-----------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  133. | :ref:`Texture2D<class_Texture2D>` | :ref:`file_thumbnail<class_FileDialog_theme_icon_file_thumbnail>` | |
  134. +-----------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  135. | :ref:`Texture2D<class_Texture2D>` | :ref:`folder<class_FileDialog_theme_icon_folder>` | |
  136. +-----------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  137. | :ref:`Texture2D<class_Texture2D>` | :ref:`folder_thumbnail<class_FileDialog_theme_icon_folder_thumbnail>` | |
  138. +-----------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  139. | :ref:`Texture2D<class_Texture2D>` | :ref:`forward_folder<class_FileDialog_theme_icon_forward_folder>` | |
  140. +-----------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  141. | :ref:`Texture2D<class_Texture2D>` | :ref:`list_mode<class_FileDialog_theme_icon_list_mode>` | |
  142. +-----------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  143. | :ref:`Texture2D<class_Texture2D>` | :ref:`parent_folder<class_FileDialog_theme_icon_parent_folder>` | |
  144. +-----------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  145. | :ref:`Texture2D<class_Texture2D>` | :ref:`reload<class_FileDialog_theme_icon_reload>` | |
  146. +-----------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  147. | :ref:`Texture2D<class_Texture2D>` | :ref:`sort<class_FileDialog_theme_icon_sort>` | |
  148. +-----------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  149. | :ref:`Texture2D<class_Texture2D>` | :ref:`thumbnail_mode<class_FileDialog_theme_icon_thumbnail_mode>` | |
  150. +-----------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  151. | :ref:`Texture2D<class_Texture2D>` | :ref:`toggle_filename_filter<class_FileDialog_theme_icon_toggle_filename_filter>` | |
  152. +-----------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  153. | :ref:`Texture2D<class_Texture2D>` | :ref:`toggle_hidden<class_FileDialog_theme_icon_toggle_hidden>` | |
  154. +-----------------------------------+-----------------------------------------------------------------------------------+--------------------------+
  155. .. rst-class:: classref-section-separator
  156. ----
  157. .. rst-class:: classref-descriptions-group
  158. Signals
  159. -------
  160. .. _class_FileDialog_signal_dir_selected:
  161. .. rst-class:: classref-signal
  162. **dir_selected**\ (\ dir\: :ref:`String<class_String>`\ ) :ref:`🔗<class_FileDialog_signal_dir_selected>`
  163. Emitted when the user selects a directory.
  164. .. rst-class:: classref-item-separator
  165. ----
  166. .. _class_FileDialog_signal_file_selected:
  167. .. rst-class:: classref-signal
  168. **file_selected**\ (\ path\: :ref:`String<class_String>`\ ) :ref:`🔗<class_FileDialog_signal_file_selected>`
  169. Emitted when the user selects a file by double-clicking it or pressing the **OK** button.
  170. .. rst-class:: classref-item-separator
  171. ----
  172. .. _class_FileDialog_signal_filename_filter_changed:
  173. .. rst-class:: classref-signal
  174. **filename_filter_changed**\ (\ filter\: :ref:`String<class_String>`\ ) :ref:`🔗<class_FileDialog_signal_filename_filter_changed>`
  175. Emitted when the filter for file names changes.
  176. .. rst-class:: classref-item-separator
  177. ----
  178. .. _class_FileDialog_signal_files_selected:
  179. .. rst-class:: classref-signal
  180. **files_selected**\ (\ paths\: :ref:`PackedStringArray<class_PackedStringArray>`\ ) :ref:`🔗<class_FileDialog_signal_files_selected>`
  181. Emitted when the user selects multiple files.
  182. .. rst-class:: classref-section-separator
  183. ----
  184. .. rst-class:: classref-descriptions-group
  185. Enumerations
  186. ------------
  187. .. _enum_FileDialog_FileMode:
  188. .. rst-class:: classref-enumeration
  189. enum **FileMode**: :ref:`🔗<enum_FileDialog_FileMode>`
  190. .. _class_FileDialog_constant_FILE_MODE_OPEN_FILE:
  191. .. rst-class:: classref-enumeration-constant
  192. :ref:`FileMode<enum_FileDialog_FileMode>` **FILE_MODE_OPEN_FILE** = ``0``
  193. The dialog allows selecting one, and only one file.
  194. .. _class_FileDialog_constant_FILE_MODE_OPEN_FILES:
  195. .. rst-class:: classref-enumeration-constant
  196. :ref:`FileMode<enum_FileDialog_FileMode>` **FILE_MODE_OPEN_FILES** = ``1``
  197. The dialog allows selecting multiple files.
  198. .. _class_FileDialog_constant_FILE_MODE_OPEN_DIR:
  199. .. rst-class:: classref-enumeration-constant
  200. :ref:`FileMode<enum_FileDialog_FileMode>` **FILE_MODE_OPEN_DIR** = ``2``
  201. The dialog only allows selecting a directory, disallowing the selection of any file.
  202. .. _class_FileDialog_constant_FILE_MODE_OPEN_ANY:
  203. .. rst-class:: classref-enumeration-constant
  204. :ref:`FileMode<enum_FileDialog_FileMode>` **FILE_MODE_OPEN_ANY** = ``3``
  205. The dialog allows selecting one file or directory.
  206. .. _class_FileDialog_constant_FILE_MODE_SAVE_FILE:
  207. .. rst-class:: classref-enumeration-constant
  208. :ref:`FileMode<enum_FileDialog_FileMode>` **FILE_MODE_SAVE_FILE** = ``4``
  209. The dialog will warn when a file exists.
  210. .. rst-class:: classref-item-separator
  211. ----
  212. .. _enum_FileDialog_Access:
  213. .. rst-class:: classref-enumeration
  214. enum **Access**: :ref:`🔗<enum_FileDialog_Access>`
  215. .. _class_FileDialog_constant_ACCESS_RESOURCES:
  216. .. rst-class:: classref-enumeration-constant
  217. :ref:`Access<enum_FileDialog_Access>` **ACCESS_RESOURCES** = ``0``
  218. The dialog only allows accessing files under the :ref:`Resource<class_Resource>` path (``res://``).
  219. .. _class_FileDialog_constant_ACCESS_USERDATA:
  220. .. rst-class:: classref-enumeration-constant
  221. :ref:`Access<enum_FileDialog_Access>` **ACCESS_USERDATA** = ``1``
  222. The dialog only allows accessing files under user data path (``user://``).
  223. .. _class_FileDialog_constant_ACCESS_FILESYSTEM:
  224. .. rst-class:: classref-enumeration-constant
  225. :ref:`Access<enum_FileDialog_Access>` **ACCESS_FILESYSTEM** = ``2``
  226. The dialog allows accessing files on the whole file system.
  227. .. rst-class:: classref-item-separator
  228. ----
  229. .. _enum_FileDialog_DisplayMode:
  230. .. rst-class:: classref-enumeration
  231. enum **DisplayMode**: :ref:`🔗<enum_FileDialog_DisplayMode>`
  232. .. _class_FileDialog_constant_DISPLAY_THUMBNAILS:
  233. .. rst-class:: classref-enumeration-constant
  234. :ref:`DisplayMode<enum_FileDialog_DisplayMode>` **DISPLAY_THUMBNAILS** = ``0``
  235. The dialog displays files as a grid of thumbnails. Use :ref:`thumbnail_size<class_FileDialog_theme_constant_thumbnail_size>` to adjust their size.
  236. .. _class_FileDialog_constant_DISPLAY_LIST:
  237. .. rst-class:: classref-enumeration-constant
  238. :ref:`DisplayMode<enum_FileDialog_DisplayMode>` **DISPLAY_LIST** = ``1``
  239. The dialog displays files as a list of filenames.
  240. .. rst-class:: classref-item-separator
  241. ----
  242. .. _enum_FileDialog_Customization:
  243. .. rst-class:: classref-enumeration
  244. enum **Customization**: :ref:`🔗<enum_FileDialog_Customization>`
  245. .. _class_FileDialog_constant_CUSTOMIZATION_HIDDEN_FILES:
  246. .. rst-class:: classref-enumeration-constant
  247. :ref:`Customization<enum_FileDialog_Customization>` **CUSTOMIZATION_HIDDEN_FILES** = ``0``
  248. Toggles visibility of the favorite button, and the favorite list on the left side of the dialog.
  249. Equivalent to :ref:`hidden_files_toggle_enabled<class_FileDialog_property_hidden_files_toggle_enabled>`.
  250. .. _class_FileDialog_constant_CUSTOMIZATION_CREATE_FOLDER:
  251. .. rst-class:: classref-enumeration-constant
  252. :ref:`Customization<enum_FileDialog_Customization>` **CUSTOMIZATION_CREATE_FOLDER** = ``1``
  253. If enabled, shows the button for creating new directories (when using :ref:`FILE_MODE_OPEN_DIR<class_FileDialog_constant_FILE_MODE_OPEN_DIR>`, :ref:`FILE_MODE_OPEN_ANY<class_FileDialog_constant_FILE_MODE_OPEN_ANY>`, or :ref:`FILE_MODE_SAVE_FILE<class_FileDialog_constant_FILE_MODE_SAVE_FILE>`).
  254. Equivalent to :ref:`folder_creation_enabled<class_FileDialog_property_folder_creation_enabled>`.
  255. .. _class_FileDialog_constant_CUSTOMIZATION_FILE_FILTER:
  256. .. rst-class:: classref-enumeration-constant
  257. :ref:`Customization<enum_FileDialog_Customization>` **CUSTOMIZATION_FILE_FILTER** = ``2``
  258. If enabled, shows the toggle file filter button.
  259. Equivalent to :ref:`file_filter_toggle_enabled<class_FileDialog_property_file_filter_toggle_enabled>`.
  260. .. _class_FileDialog_constant_CUSTOMIZATION_FILE_SORT:
  261. .. rst-class:: classref-enumeration-constant
  262. :ref:`Customization<enum_FileDialog_Customization>` **CUSTOMIZATION_FILE_SORT** = ``3``
  263. If enabled, shows the file sorting options button.
  264. Equivalent to :ref:`file_sort_options_enabled<class_FileDialog_property_file_sort_options_enabled>`.
  265. .. _class_FileDialog_constant_CUSTOMIZATION_FAVORITES:
  266. .. rst-class:: classref-enumeration-constant
  267. :ref:`Customization<enum_FileDialog_Customization>` **CUSTOMIZATION_FAVORITES** = ``4``
  268. If enabled, shows the toggle favorite button and favorite list on the left side of the dialog.
  269. Equivalent to :ref:`favorites_enabled<class_FileDialog_property_favorites_enabled>`.
  270. .. _class_FileDialog_constant_CUSTOMIZATION_RECENT:
  271. .. rst-class:: classref-enumeration-constant
  272. :ref:`Customization<enum_FileDialog_Customization>` **CUSTOMIZATION_RECENT** = ``5``
  273. If enabled, shows the recent directories list on the left side of the dialog.
  274. Equivalent to :ref:`recent_list_enabled<class_FileDialog_property_recent_list_enabled>`.
  275. .. _class_FileDialog_constant_CUSTOMIZATION_LAYOUT:
  276. .. rst-class:: classref-enumeration-constant
  277. :ref:`Customization<enum_FileDialog_Customization>` **CUSTOMIZATION_LAYOUT** = ``6``
  278. If enabled, shows the layout switch buttons (list/thumbnails).
  279. Equivalent to :ref:`layout_toggle_enabled<class_FileDialog_property_layout_toggle_enabled>`.
  280. .. rst-class:: classref-section-separator
  281. ----
  282. .. rst-class:: classref-descriptions-group
  283. Property Descriptions
  284. ---------------------
  285. .. _class_FileDialog_property_access:
  286. .. rst-class:: classref-property
  287. :ref:`Access<enum_FileDialog_Access>` **access** = ``0`` :ref:`🔗<class_FileDialog_property_access>`
  288. .. rst-class:: classref-property-setget
  289. - |void| **set_access**\ (\ value\: :ref:`Access<enum_FileDialog_Access>`\ )
  290. - :ref:`Access<enum_FileDialog_Access>` **get_access**\ (\ )
  291. The file system access scope.
  292. \ **Warning:** In Web builds, FileDialog cannot access the host file system. In sandboxed Linux and macOS environments, :ref:`use_native_dialog<class_FileDialog_property_use_native_dialog>` is automatically used to allow limited access to host file system.
  293. .. rst-class:: classref-item-separator
  294. ----
  295. .. _class_FileDialog_property_current_dir:
  296. .. rst-class:: classref-property
  297. :ref:`String<class_String>` **current_dir** :ref:`🔗<class_FileDialog_property_current_dir>`
  298. .. rst-class:: classref-property-setget
  299. - |void| **set_current_dir**\ (\ value\: :ref:`String<class_String>`\ )
  300. - :ref:`String<class_String>` **get_current_dir**\ (\ )
  301. The current working directory of the file dialog.
  302. \ **Note:** For native file dialogs, this property is only treated as a hint and may not be respected by specific OS implementations.
  303. .. rst-class:: classref-item-separator
  304. ----
  305. .. _class_FileDialog_property_current_file:
  306. .. rst-class:: classref-property
  307. :ref:`String<class_String>` **current_file** :ref:`🔗<class_FileDialog_property_current_file>`
  308. .. rst-class:: classref-property-setget
  309. - |void| **set_current_file**\ (\ value\: :ref:`String<class_String>`\ )
  310. - :ref:`String<class_String>` **get_current_file**\ (\ )
  311. The currently selected file of the file dialog.
  312. .. rst-class:: classref-item-separator
  313. ----
  314. .. _class_FileDialog_property_current_path:
  315. .. rst-class:: classref-property
  316. :ref:`String<class_String>` **current_path** :ref:`🔗<class_FileDialog_property_current_path>`
  317. .. rst-class:: classref-property-setget
  318. - |void| **set_current_path**\ (\ value\: :ref:`String<class_String>`\ )
  319. - :ref:`String<class_String>` **get_current_path**\ (\ )
  320. The currently selected file path of the file dialog.
  321. .. rst-class:: classref-item-separator
  322. ----
  323. .. _class_FileDialog_property_display_mode:
  324. .. rst-class:: classref-property
  325. :ref:`DisplayMode<enum_FileDialog_DisplayMode>` **display_mode** = ``0`` :ref:`🔗<class_FileDialog_property_display_mode>`
  326. .. rst-class:: classref-property-setget
  327. - |void| **set_display_mode**\ (\ value\: :ref:`DisplayMode<enum_FileDialog_DisplayMode>`\ )
  328. - :ref:`DisplayMode<enum_FileDialog_DisplayMode>` **get_display_mode**\ (\ )
  329. Display mode of the dialog's file list.
  330. .. rst-class:: classref-item-separator
  331. ----
  332. .. _class_FileDialog_property_favorites_enabled:
  333. .. rst-class:: classref-property
  334. :ref:`bool<class_bool>` **favorites_enabled** = ``true`` :ref:`🔗<class_FileDialog_property_favorites_enabled>`
  335. .. rst-class:: classref-property-setget
  336. - |void| **set_customization_flag_enabled**\ (\ flag\: :ref:`Customization<enum_FileDialog_Customization>`, enabled\: :ref:`bool<class_bool>`\ )
  337. - :ref:`bool<class_bool>` **is_customization_flag_enabled**\ (\ flag\: :ref:`Customization<enum_FileDialog_Customization>`\ ) |const|
  338. If ``true``, shows the toggle favorite button and favorite list on the left side of the dialog.
  339. .. rst-class:: classref-item-separator
  340. ----
  341. .. _class_FileDialog_property_file_filter_toggle_enabled:
  342. .. rst-class:: classref-property
  343. :ref:`bool<class_bool>` **file_filter_toggle_enabled** = ``true`` :ref:`🔗<class_FileDialog_property_file_filter_toggle_enabled>`
  344. .. rst-class:: classref-property-setget
  345. - |void| **set_customization_flag_enabled**\ (\ flag\: :ref:`Customization<enum_FileDialog_Customization>`, enabled\: :ref:`bool<class_bool>`\ )
  346. - :ref:`bool<class_bool>` **is_customization_flag_enabled**\ (\ flag\: :ref:`Customization<enum_FileDialog_Customization>`\ ) |const|
  347. If ``true``, shows the toggle file filter button.
  348. .. rst-class:: classref-item-separator
  349. ----
  350. .. _class_FileDialog_property_file_mode:
  351. .. rst-class:: classref-property
  352. :ref:`FileMode<enum_FileDialog_FileMode>` **file_mode** = ``4`` :ref:`🔗<class_FileDialog_property_file_mode>`
  353. .. rst-class:: classref-property-setget
  354. - |void| **set_file_mode**\ (\ value\: :ref:`FileMode<enum_FileDialog_FileMode>`\ )
  355. - :ref:`FileMode<enum_FileDialog_FileMode>` **get_file_mode**\ (\ )
  356. The dialog's open or save mode, which affects the selection behavior.
  357. .. rst-class:: classref-item-separator
  358. ----
  359. .. _class_FileDialog_property_file_sort_options_enabled:
  360. .. rst-class:: classref-property
  361. :ref:`bool<class_bool>` **file_sort_options_enabled** = ``true`` :ref:`🔗<class_FileDialog_property_file_sort_options_enabled>`
  362. .. rst-class:: classref-property-setget
  363. - |void| **set_customization_flag_enabled**\ (\ flag\: :ref:`Customization<enum_FileDialog_Customization>`, enabled\: :ref:`bool<class_bool>`\ )
  364. - :ref:`bool<class_bool>` **is_customization_flag_enabled**\ (\ flag\: :ref:`Customization<enum_FileDialog_Customization>`\ ) |const|
  365. If ``true``, shows the file sorting options button.
  366. .. rst-class:: classref-item-separator
  367. ----
  368. .. _class_FileDialog_property_filename_filter:
  369. .. rst-class:: classref-property
  370. :ref:`String<class_String>` **filename_filter** = ``""`` :ref:`🔗<class_FileDialog_property_filename_filter>`
  371. .. rst-class:: classref-property-setget
  372. - |void| **set_filename_filter**\ (\ value\: :ref:`String<class_String>`\ )
  373. - :ref:`String<class_String>` **get_filename_filter**\ (\ )
  374. The filter for file names (case-insensitive). When set to a non-empty string, only files that contains the substring will be shown. :ref:`filename_filter<class_FileDialog_property_filename_filter>` can be edited by the user with the filter button at the top of the file dialog.
  375. See also :ref:`filters<class_FileDialog_property_filters>`, which should be used to restrict the file types that can be selected instead of :ref:`filename_filter<class_FileDialog_property_filename_filter>` which is meant to be set by the user.
  376. .. rst-class:: classref-item-separator
  377. ----
  378. .. _class_FileDialog_property_filters:
  379. .. rst-class:: classref-property
  380. :ref:`PackedStringArray<class_PackedStringArray>` **filters** = ``PackedStringArray()`` :ref:`🔗<class_FileDialog_property_filters>`
  381. .. rst-class:: classref-property-setget
  382. - |void| **set_filters**\ (\ value\: :ref:`PackedStringArray<class_PackedStringArray>`\ )
  383. - :ref:`PackedStringArray<class_PackedStringArray>` **get_filters**\ (\ )
  384. The available file type filters. Each filter string in the array should be formatted like this: ``*.png,*.jpg,*.jpeg;Image Files;image/png,image/jpeg``. The description text of the filter is optional and can be omitted. Both file extensions and MIME type should be always set.
  385. \ **Note:** Embedded file dialog and Windows file dialog support only file extensions, while Android, Linux, and macOS file dialogs also support MIME types.
  386. **Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedStringArray<class_PackedStringArray>` for more details.
  387. .. rst-class:: classref-item-separator
  388. ----
  389. .. _class_FileDialog_property_folder_creation_enabled:
  390. .. rst-class:: classref-property
  391. :ref:`bool<class_bool>` **folder_creation_enabled** = ``true`` :ref:`🔗<class_FileDialog_property_folder_creation_enabled>`
  392. .. rst-class:: classref-property-setget
  393. - |void| **set_customization_flag_enabled**\ (\ flag\: :ref:`Customization<enum_FileDialog_Customization>`, enabled\: :ref:`bool<class_bool>`\ )
  394. - :ref:`bool<class_bool>` **is_customization_flag_enabled**\ (\ flag\: :ref:`Customization<enum_FileDialog_Customization>`\ ) |const|
  395. If ``true``, shows the button for creating new directories (when using :ref:`FILE_MODE_OPEN_DIR<class_FileDialog_constant_FILE_MODE_OPEN_DIR>`, :ref:`FILE_MODE_OPEN_ANY<class_FileDialog_constant_FILE_MODE_OPEN_ANY>`, or :ref:`FILE_MODE_SAVE_FILE<class_FileDialog_constant_FILE_MODE_SAVE_FILE>`).
  396. .. rst-class:: classref-item-separator
  397. ----
  398. .. _class_FileDialog_property_hidden_files_toggle_enabled:
  399. .. rst-class:: classref-property
  400. :ref:`bool<class_bool>` **hidden_files_toggle_enabled** = ``true`` :ref:`🔗<class_FileDialog_property_hidden_files_toggle_enabled>`
  401. .. rst-class:: classref-property-setget
  402. - |void| **set_customization_flag_enabled**\ (\ flag\: :ref:`Customization<enum_FileDialog_Customization>`, enabled\: :ref:`bool<class_bool>`\ )
  403. - :ref:`bool<class_bool>` **is_customization_flag_enabled**\ (\ flag\: :ref:`Customization<enum_FileDialog_Customization>`\ ) |const|
  404. If ``true``, shows the toggle hidden files button.
  405. .. rst-class:: classref-item-separator
  406. ----
  407. .. _class_FileDialog_property_layout_toggle_enabled:
  408. .. rst-class:: classref-property
  409. :ref:`bool<class_bool>` **layout_toggle_enabled** = ``true`` :ref:`🔗<class_FileDialog_property_layout_toggle_enabled>`
  410. .. rst-class:: classref-property-setget
  411. - |void| **set_customization_flag_enabled**\ (\ flag\: :ref:`Customization<enum_FileDialog_Customization>`, enabled\: :ref:`bool<class_bool>`\ )
  412. - :ref:`bool<class_bool>` **is_customization_flag_enabled**\ (\ flag\: :ref:`Customization<enum_FileDialog_Customization>`\ ) |const|
  413. If ``true``, shows the layout switch buttons (list/thumbnails).
  414. .. rst-class:: classref-item-separator
  415. ----
  416. .. _class_FileDialog_property_mode_overrides_title:
  417. .. rst-class:: classref-property
  418. :ref:`bool<class_bool>` **mode_overrides_title** = ``true`` :ref:`🔗<class_FileDialog_property_mode_overrides_title>`
  419. .. rst-class:: classref-property-setget
  420. - |void| **set_mode_overrides_title**\ (\ value\: :ref:`bool<class_bool>`\ )
  421. - :ref:`bool<class_bool>` **is_mode_overriding_title**\ (\ )
  422. If ``true``, changing the :ref:`file_mode<class_FileDialog_property_file_mode>` property will set the window title accordingly (e.g. setting :ref:`file_mode<class_FileDialog_property_file_mode>` to :ref:`FILE_MODE_OPEN_FILE<class_FileDialog_constant_FILE_MODE_OPEN_FILE>` will change the window title to "Open a File").
  423. .. rst-class:: classref-item-separator
  424. ----
  425. .. _class_FileDialog_property_option_count:
  426. .. rst-class:: classref-property
  427. :ref:`int<class_int>` **option_count** = ``0`` :ref:`🔗<class_FileDialog_property_option_count>`
  428. .. rst-class:: classref-property-setget
  429. - |void| **set_option_count**\ (\ value\: :ref:`int<class_int>`\ )
  430. - :ref:`int<class_int>` **get_option_count**\ (\ )
  431. The number of additional :ref:`OptionButton<class_OptionButton>`\ s and :ref:`CheckBox<class_CheckBox>`\ es in the dialog.
  432. .. rst-class:: classref-item-separator
  433. ----
  434. .. _class_FileDialog_property_recent_list_enabled:
  435. .. rst-class:: classref-property
  436. :ref:`bool<class_bool>` **recent_list_enabled** = ``true`` :ref:`🔗<class_FileDialog_property_recent_list_enabled>`
  437. .. rst-class:: classref-property-setget
  438. - |void| **set_customization_flag_enabled**\ (\ flag\: :ref:`Customization<enum_FileDialog_Customization>`, enabled\: :ref:`bool<class_bool>`\ )
  439. - :ref:`bool<class_bool>` **is_customization_flag_enabled**\ (\ flag\: :ref:`Customization<enum_FileDialog_Customization>`\ ) |const|
  440. If ``true``, shows the recent directories list on the left side of the dialog.
  441. .. rst-class:: classref-item-separator
  442. ----
  443. .. _class_FileDialog_property_root_subfolder:
  444. .. rst-class:: classref-property
  445. :ref:`String<class_String>` **root_subfolder** = ``""`` :ref:`🔗<class_FileDialog_property_root_subfolder>`
  446. .. rst-class:: classref-property-setget
  447. - |void| **set_root_subfolder**\ (\ value\: :ref:`String<class_String>`\ )
  448. - :ref:`String<class_String>` **get_root_subfolder**\ (\ )
  449. If non-empty, the given sub-folder will be "root" of this **FileDialog**, i.e. user won't be able to go to its parent directory.
  450. \ **Note:** This property is ignored by native file dialogs.
  451. .. rst-class:: classref-item-separator
  452. ----
  453. .. _class_FileDialog_property_show_hidden_files:
  454. .. rst-class:: classref-property
  455. :ref:`bool<class_bool>` **show_hidden_files** = ``false`` :ref:`🔗<class_FileDialog_property_show_hidden_files>`
  456. .. rst-class:: classref-property-setget
  457. - |void| **set_show_hidden_files**\ (\ value\: :ref:`bool<class_bool>`\ )
  458. - :ref:`bool<class_bool>` **is_showing_hidden_files**\ (\ )
  459. If ``true``, the dialog will show hidden files.
  460. \ **Note:** This property is ignored by native file dialogs on Android and Linux.
  461. .. rst-class:: classref-item-separator
  462. ----
  463. .. _class_FileDialog_property_use_native_dialog:
  464. .. rst-class:: classref-property
  465. :ref:`bool<class_bool>` **use_native_dialog** = ``false`` :ref:`🔗<class_FileDialog_property_use_native_dialog>`
  466. .. rst-class:: classref-property-setget
  467. - |void| **set_use_native_dialog**\ (\ value\: :ref:`bool<class_bool>`\ )
  468. - :ref:`bool<class_bool>` **get_use_native_dialog**\ (\ )
  469. If ``true``, and if supported by the current :ref:`DisplayServer<class_DisplayServer>`, OS native dialog will be used instead of custom one.
  470. \ **Note:** On Android, it is only supported for Android 10+ devices and when using :ref:`ACCESS_FILESYSTEM<class_FileDialog_constant_ACCESS_FILESYSTEM>`. For access mode :ref:`ACCESS_RESOURCES<class_FileDialog_constant_ACCESS_RESOURCES>` and :ref:`ACCESS_USERDATA<class_FileDialog_constant_ACCESS_USERDATA>`, the system will fall back to custom FileDialog.
  471. \ **Note:** On Linux and macOS, sandboxed apps always use native dialogs to access the host file system.
  472. \ **Note:** On macOS, sandboxed apps will save security-scoped bookmarks to retain access to the opened folders across multiple sessions. Use :ref:`OS.get_granted_permissions()<class_OS_method_get_granted_permissions>` to get a list of saved bookmarks.
  473. \ **Note:** Native dialogs are isolated from the base process, file dialog properties can't be modified once the dialog is shown.
  474. .. rst-class:: classref-section-separator
  475. ----
  476. .. rst-class:: classref-descriptions-group
  477. Method Descriptions
  478. -------------------
  479. .. _class_FileDialog_method_add_filter:
  480. .. rst-class:: classref-method
  481. |void| **add_filter**\ (\ filter\: :ref:`String<class_String>`, description\: :ref:`String<class_String>` = ""\ ) :ref:`🔗<class_FileDialog_method_add_filter>`
  482. Adds a comma-separated file name ``filter`` option to the **FileDialog** with an optional ``description``, which restricts what files can be picked.
  483. A ``filter`` should be of the form ``"filename.extension"``, where filename and extension can be ``*`` to match any string. Filters starting with ``.`` (i.e. empty filenames) are not allowed.
  484. For example, a ``filter`` of ``"*.png, *.jpg"`` and a ``description`` of ``"Images"`` results in filter text "Images (\*.png, \*.jpg)".
  485. .. rst-class:: classref-item-separator
  486. ----
  487. .. _class_FileDialog_method_add_option:
  488. .. rst-class:: classref-method
  489. |void| **add_option**\ (\ name\: :ref:`String<class_String>`, values\: :ref:`PackedStringArray<class_PackedStringArray>`, default_value_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FileDialog_method_add_option>`
  490. Adds an additional :ref:`OptionButton<class_OptionButton>` to the file dialog. If ``values`` is empty, a :ref:`CheckBox<class_CheckBox>` is added instead.
  491. \ ``default_value_index`` should be an index of the value in the ``values``. If ``values`` is empty it should be either ``1`` (checked), or ``0`` (unchecked).
  492. .. rst-class:: classref-item-separator
  493. ----
  494. .. _class_FileDialog_method_clear_filename_filter:
  495. .. rst-class:: classref-method
  496. |void| **clear_filename_filter**\ (\ ) :ref:`🔗<class_FileDialog_method_clear_filename_filter>`
  497. Clear the filter for file names.
  498. .. rst-class:: classref-item-separator
  499. ----
  500. .. _class_FileDialog_method_clear_filters:
  501. .. rst-class:: classref-method
  502. |void| **clear_filters**\ (\ ) :ref:`🔗<class_FileDialog_method_clear_filters>`
  503. Clear all the added filters in the dialog.
  504. .. rst-class:: classref-item-separator
  505. ----
  506. .. _class_FileDialog_method_deselect_all:
  507. .. rst-class:: classref-method
  508. |void| **deselect_all**\ (\ ) :ref:`🔗<class_FileDialog_method_deselect_all>`
  509. Clear all currently selected items in the dialog.
  510. .. rst-class:: classref-item-separator
  511. ----
  512. .. _class_FileDialog_method_get_line_edit:
  513. .. rst-class:: classref-method
  514. :ref:`LineEdit<class_LineEdit>` **get_line_edit**\ (\ ) :ref:`🔗<class_FileDialog_method_get_line_edit>`
  515. Returns the LineEdit for the selected file.
  516. \ **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.
  517. .. rst-class:: classref-item-separator
  518. ----
  519. .. _class_FileDialog_method_get_option_default:
  520. .. rst-class:: classref-method
  521. :ref:`int<class_int>` **get_option_default**\ (\ option\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FileDialog_method_get_option_default>`
  522. Returns the default value index of the :ref:`OptionButton<class_OptionButton>` or :ref:`CheckBox<class_CheckBox>` with index ``option``.
  523. .. rst-class:: classref-item-separator
  524. ----
  525. .. _class_FileDialog_method_get_option_name:
  526. .. rst-class:: classref-method
  527. :ref:`String<class_String>` **get_option_name**\ (\ option\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FileDialog_method_get_option_name>`
  528. Returns the name of the :ref:`OptionButton<class_OptionButton>` or :ref:`CheckBox<class_CheckBox>` with index ``option``.
  529. .. rst-class:: classref-item-separator
  530. ----
  531. .. _class_FileDialog_method_get_option_values:
  532. .. rst-class:: classref-method
  533. :ref:`PackedStringArray<class_PackedStringArray>` **get_option_values**\ (\ option\: :ref:`int<class_int>`\ ) |const| :ref:`🔗<class_FileDialog_method_get_option_values>`
  534. Returns an array of values of the :ref:`OptionButton<class_OptionButton>` with index ``option``.
  535. .. rst-class:: classref-item-separator
  536. ----
  537. .. _class_FileDialog_method_get_selected_options:
  538. .. rst-class:: classref-method
  539. :ref:`Dictionary<class_Dictionary>` **get_selected_options**\ (\ ) |const| :ref:`🔗<class_FileDialog_method_get_selected_options>`
  540. Returns a :ref:`Dictionary<class_Dictionary>` with the selected values of the additional :ref:`OptionButton<class_OptionButton>`\ s and/or :ref:`CheckBox<class_CheckBox>`\ es. :ref:`Dictionary<class_Dictionary>` keys are names and values are selected value indices.
  541. .. rst-class:: classref-item-separator
  542. ----
  543. .. _class_FileDialog_method_get_vbox:
  544. .. rst-class:: classref-method
  545. :ref:`VBoxContainer<class_VBoxContainer>` **get_vbox**\ (\ ) :ref:`🔗<class_FileDialog_method_get_vbox>`
  546. Returns the vertical box container of the dialog, custom controls can be added to it.
  547. \ **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.
  548. \ **Note:** Changes to this node are ignored by native file dialogs, use :ref:`add_option()<class_FileDialog_method_add_option>` to add custom elements to the dialog instead.
  549. .. rst-class:: classref-item-separator
  550. ----
  551. .. _class_FileDialog_method_invalidate:
  552. .. rst-class:: classref-method
  553. |void| **invalidate**\ (\ ) :ref:`🔗<class_FileDialog_method_invalidate>`
  554. Invalidate and update the current dialog content list.
  555. \ **Note:** This method does nothing on native file dialogs.
  556. .. rst-class:: classref-item-separator
  557. ----
  558. .. _class_FileDialog_method_is_customization_flag_enabled:
  559. .. rst-class:: classref-method
  560. :ref:`bool<class_bool>` **is_customization_flag_enabled**\ (\ flag\: :ref:`Customization<enum_FileDialog_Customization>`\ ) |const| :ref:`🔗<class_FileDialog_method_is_customization_flag_enabled>`
  561. Returns ``true`` if the provided ``flag`` is enabled.
  562. .. rst-class:: classref-item-separator
  563. ----
  564. .. _class_FileDialog_method_set_customization_flag_enabled:
  565. .. rst-class:: classref-method
  566. |void| **set_customization_flag_enabled**\ (\ flag\: :ref:`Customization<enum_FileDialog_Customization>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_FileDialog_method_set_customization_flag_enabled>`
  567. Toggles the specified customization ``flag``, allowing to customize features available in this **FileDialog**. See :ref:`Customization<enum_FileDialog_Customization>` for options.
  568. .. rst-class:: classref-item-separator
  569. ----
  570. .. _class_FileDialog_method_set_option_default:
  571. .. rst-class:: classref-method
  572. |void| **set_option_default**\ (\ option\: :ref:`int<class_int>`, default_value_index\: :ref:`int<class_int>`\ ) :ref:`🔗<class_FileDialog_method_set_option_default>`
  573. Sets the default value index of the :ref:`OptionButton<class_OptionButton>` or :ref:`CheckBox<class_CheckBox>` with index ``option``.
  574. .. rst-class:: classref-item-separator
  575. ----
  576. .. _class_FileDialog_method_set_option_name:
  577. .. rst-class:: classref-method
  578. |void| **set_option_name**\ (\ option\: :ref:`int<class_int>`, name\: :ref:`String<class_String>`\ ) :ref:`🔗<class_FileDialog_method_set_option_name>`
  579. Sets the name of the :ref:`OptionButton<class_OptionButton>` or :ref:`CheckBox<class_CheckBox>` with index ``option``.
  580. .. rst-class:: classref-item-separator
  581. ----
  582. .. _class_FileDialog_method_set_option_values:
  583. .. rst-class:: classref-method
  584. |void| **set_option_values**\ (\ option\: :ref:`int<class_int>`, values\: :ref:`PackedStringArray<class_PackedStringArray>`\ ) :ref:`🔗<class_FileDialog_method_set_option_values>`
  585. Sets the option values of the :ref:`OptionButton<class_OptionButton>` with index ``option``.
  586. .. rst-class:: classref-section-separator
  587. ----
  588. .. rst-class:: classref-descriptions-group
  589. Theme Property Descriptions
  590. ---------------------------
  591. .. _class_FileDialog_theme_color_file_disabled_color:
  592. .. rst-class:: classref-themeproperty
  593. :ref:`Color<class_Color>` **file_disabled_color** = ``Color(1, 1, 1, 0.25)`` :ref:`🔗<class_FileDialog_theme_color_file_disabled_color>`
  594. The color tint for disabled files (when the **FileDialog** is used in open folder mode).
  595. .. rst-class:: classref-item-separator
  596. ----
  597. .. _class_FileDialog_theme_color_file_icon_color:
  598. .. rst-class:: classref-themeproperty
  599. :ref:`Color<class_Color>` **file_icon_color** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_FileDialog_theme_color_file_icon_color>`
  600. The color modulation applied to the file icon.
  601. .. rst-class:: classref-item-separator
  602. ----
  603. .. _class_FileDialog_theme_color_folder_icon_color:
  604. .. rst-class:: classref-themeproperty
  605. :ref:`Color<class_Color>` **folder_icon_color** = ``Color(1, 1, 1, 1)`` :ref:`🔗<class_FileDialog_theme_color_folder_icon_color>`
  606. The color modulation applied to the folder icon.
  607. .. rst-class:: classref-item-separator
  608. ----
  609. .. _class_FileDialog_theme_constant_thumbnail_size:
  610. .. rst-class:: classref-themeproperty
  611. :ref:`int<class_int>` **thumbnail_size** = ``64`` :ref:`🔗<class_FileDialog_theme_constant_thumbnail_size>`
  612. The size of thumbnail icons when :ref:`DISPLAY_THUMBNAILS<class_FileDialog_constant_DISPLAY_THUMBNAILS>` is enabled.
  613. .. rst-class:: classref-item-separator
  614. ----
  615. .. _class_FileDialog_theme_icon_back_folder:
  616. .. rst-class:: classref-themeproperty
  617. :ref:`Texture2D<class_Texture2D>` **back_folder** :ref:`🔗<class_FileDialog_theme_icon_back_folder>`
  618. Custom icon for the back arrow.
  619. .. rst-class:: classref-item-separator
  620. ----
  621. .. _class_FileDialog_theme_icon_create_folder:
  622. .. rst-class:: classref-themeproperty
  623. :ref:`Texture2D<class_Texture2D>` **create_folder** :ref:`🔗<class_FileDialog_theme_icon_create_folder>`
  624. Custom icon for the create folder button.
  625. .. rst-class:: classref-item-separator
  626. ----
  627. .. _class_FileDialog_theme_icon_favorite:
  628. .. rst-class:: classref-themeproperty
  629. :ref:`Texture2D<class_Texture2D>` **favorite** :ref:`🔗<class_FileDialog_theme_icon_favorite>`
  630. Custom icon for favorite folder button.
  631. .. rst-class:: classref-item-separator
  632. ----
  633. .. _class_FileDialog_theme_icon_favorite_down:
  634. .. rst-class:: classref-themeproperty
  635. :ref:`Texture2D<class_Texture2D>` **favorite_down** :ref:`🔗<class_FileDialog_theme_icon_favorite_down>`
  636. Custom icon for button to move down a favorite entry.
  637. .. rst-class:: classref-item-separator
  638. ----
  639. .. _class_FileDialog_theme_icon_favorite_up:
  640. .. rst-class:: classref-themeproperty
  641. :ref:`Texture2D<class_Texture2D>` **favorite_up** :ref:`🔗<class_FileDialog_theme_icon_favorite_up>`
  642. Custom icon for button to move up a favorite entry.
  643. .. rst-class:: classref-item-separator
  644. ----
  645. .. _class_FileDialog_theme_icon_file:
  646. .. rst-class:: classref-themeproperty
  647. :ref:`Texture2D<class_Texture2D>` **file** :ref:`🔗<class_FileDialog_theme_icon_file>`
  648. Custom icon for files.
  649. .. rst-class:: classref-item-separator
  650. ----
  651. .. _class_FileDialog_theme_icon_file_thumbnail:
  652. .. rst-class:: classref-themeproperty
  653. :ref:`Texture2D<class_Texture2D>` **file_thumbnail** :ref:`🔗<class_FileDialog_theme_icon_file_thumbnail>`
  654. Icon for files when in thumbnail mode.
  655. .. rst-class:: classref-item-separator
  656. ----
  657. .. _class_FileDialog_theme_icon_folder:
  658. .. rst-class:: classref-themeproperty
  659. :ref:`Texture2D<class_Texture2D>` **folder** :ref:`🔗<class_FileDialog_theme_icon_folder>`
  660. Custom icon for folders.
  661. .. rst-class:: classref-item-separator
  662. ----
  663. .. _class_FileDialog_theme_icon_folder_thumbnail:
  664. .. rst-class:: classref-themeproperty
  665. :ref:`Texture2D<class_Texture2D>` **folder_thumbnail** :ref:`🔗<class_FileDialog_theme_icon_folder_thumbnail>`
  666. Icon for folders when in thumbnail mode.
  667. .. rst-class:: classref-item-separator
  668. ----
  669. .. _class_FileDialog_theme_icon_forward_folder:
  670. .. rst-class:: classref-themeproperty
  671. :ref:`Texture2D<class_Texture2D>` **forward_folder** :ref:`🔗<class_FileDialog_theme_icon_forward_folder>`
  672. Custom icon for the forward arrow.
  673. .. rst-class:: classref-item-separator
  674. ----
  675. .. _class_FileDialog_theme_icon_list_mode:
  676. .. rst-class:: classref-themeproperty
  677. :ref:`Texture2D<class_Texture2D>` **list_mode** :ref:`🔗<class_FileDialog_theme_icon_list_mode>`
  678. Icon for the button that enables list mode.
  679. .. rst-class:: classref-item-separator
  680. ----
  681. .. _class_FileDialog_theme_icon_parent_folder:
  682. .. rst-class:: classref-themeproperty
  683. :ref:`Texture2D<class_Texture2D>` **parent_folder** :ref:`🔗<class_FileDialog_theme_icon_parent_folder>`
  684. Custom icon for the parent folder arrow.
  685. .. rst-class:: classref-item-separator
  686. ----
  687. .. _class_FileDialog_theme_icon_reload:
  688. .. rst-class:: classref-themeproperty
  689. :ref:`Texture2D<class_Texture2D>` **reload** :ref:`🔗<class_FileDialog_theme_icon_reload>`
  690. Custom icon for the reload button.
  691. .. rst-class:: classref-item-separator
  692. ----
  693. .. _class_FileDialog_theme_icon_sort:
  694. .. rst-class:: classref-themeproperty
  695. :ref:`Texture2D<class_Texture2D>` **sort** :ref:`🔗<class_FileDialog_theme_icon_sort>`
  696. Custom icon for the sorting options menu.
  697. .. rst-class:: classref-item-separator
  698. ----
  699. .. _class_FileDialog_theme_icon_thumbnail_mode:
  700. .. rst-class:: classref-themeproperty
  701. :ref:`Texture2D<class_Texture2D>` **thumbnail_mode** :ref:`🔗<class_FileDialog_theme_icon_thumbnail_mode>`
  702. Icon for the button that enables thumbnail mode.
  703. .. rst-class:: classref-item-separator
  704. ----
  705. .. _class_FileDialog_theme_icon_toggle_filename_filter:
  706. .. rst-class:: classref-themeproperty
  707. :ref:`Texture2D<class_Texture2D>` **toggle_filename_filter** :ref:`🔗<class_FileDialog_theme_icon_toggle_filename_filter>`
  708. Custom icon for the toggle button for the filter for file names.
  709. .. rst-class:: classref-item-separator
  710. ----
  711. .. _class_FileDialog_theme_icon_toggle_hidden:
  712. .. rst-class:: classref-themeproperty
  713. :ref:`Texture2D<class_Texture2D>` **toggle_hidden** :ref:`🔗<class_FileDialog_theme_icon_toggle_hidden>`
  714. Custom icon for the toggle hidden button.
  715. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  716. .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
  717. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  718. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  719. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  720. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  721. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  722. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  723. .. |void| replace:: :abbr:`void (No return value.)`