class_filedialog.rst 63 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280
  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.)`