FileDialog.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="FileDialog" inherits="ConfirmationDialog" category="Core" version="3.1.2">
  3. <brief_description>
  4. Dialog for selecting files or directories in the filesystem.
  5. </brief_description>
  6. <description>
  7. FileDialog is a preset dialog used to choose files and directories in the filesystem. It supports filter masks.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="add_filter">
  13. <return type="void">
  14. </return>
  15. <argument index="0" name="filter" type="String">
  16. </argument>
  17. <description>
  18. Add a custom filter. Example: [code]add_filter("*.png ; PNG Images")[/code]
  19. </description>
  20. </method>
  21. <method name="clear_filters">
  22. <return type="void">
  23. </return>
  24. <description>
  25. Clear all the added filters in the dialog.
  26. </description>
  27. </method>
  28. <method name="deselect_items">
  29. <return type="void">
  30. </return>
  31. <description>
  32. Clear currently selected items in the dialog.
  33. </description>
  34. </method>
  35. <method name="get_line_edit">
  36. <return type="LineEdit">
  37. </return>
  38. <description>
  39. Returns the LineEdit for the selected file.
  40. </description>
  41. </method>
  42. <method name="get_vbox">
  43. <return type="VBoxContainer">
  44. </return>
  45. <description>
  46. Returns the vertical box container of the dialog, custom controls can be added to it.
  47. </description>
  48. </method>
  49. <method name="invalidate">
  50. <return type="void">
  51. </return>
  52. <description>
  53. Invalidate and update the current dialog content list.
  54. </description>
  55. </method>
  56. </methods>
  57. <members>
  58. <member name="access" type="int" setter="set_access" getter="get_access" enum="FileDialog.Access">
  59. The file system access scope. See enum [code]Access[/code] constants.
  60. </member>
  61. <member name="current_dir" type="String" setter="set_current_dir" getter="get_current_dir">
  62. The current working directory of the file dialog.
  63. </member>
  64. <member name="current_file" type="String" setter="set_current_file" getter="get_current_file">
  65. The currently selected file of the file dialog.
  66. </member>
  67. <member name="current_path" type="String" setter="set_current_path" getter="get_current_path">
  68. The currently selected file path of the file dialog.
  69. </member>
  70. <member name="filters" type="PoolStringArray" setter="set_filters" getter="get_filters">
  71. Set file type filters. This example shows only .png and .gd files [code]set_filters(PoolStringArray(["*.png ; PNG Images","*.gd ; GD Script"]))[/code].
  72. </member>
  73. <member name="mode" type="int" setter="set_mode" getter="get_mode" enum="FileDialog.Mode">
  74. Set dialog to open or save mode, changes selection behavior. See enum [code]Mode[/code] constants.
  75. </member>
  76. <member name="mode_overrides_title" type="bool" setter="set_mode_overrides_title" getter="is_mode_overriding_title">
  77. If [code]true[/code], changing the [code]Mode[/code] property will set the window title accordingly (e.g. setting mode to [constant MODE_OPEN_FILE] will change the window title to "Open a File").
  78. </member>
  79. <member name="show_hidden_files" type="bool" setter="set_show_hidden_files" getter="is_showing_hidden_files">
  80. If [code]true[/code], the dialog will show hidden files.
  81. </member>
  82. </members>
  83. <signals>
  84. <signal name="dir_selected">
  85. <argument index="0" name="dir" type="String">
  86. </argument>
  87. <description>
  88. Event emitted when the user selects a directory.
  89. </description>
  90. </signal>
  91. <signal name="file_selected">
  92. <argument index="0" name="path" type="String">
  93. </argument>
  94. <description>
  95. Event emitted when the user selects a file (double clicks it or presses the OK button).
  96. </description>
  97. </signal>
  98. <signal name="files_selected">
  99. <argument index="0" name="paths" type="PoolStringArray">
  100. </argument>
  101. <description>
  102. Event emitted when the user selects multiple files.
  103. </description>
  104. </signal>
  105. </signals>
  106. <constants>
  107. <constant name="MODE_OPEN_FILE" value="0" enum="Mode">
  108. The dialog allows the selection of one, and only one file.
  109. </constant>
  110. <constant name="MODE_OPEN_FILES" value="1" enum="Mode">
  111. The dialog allows the selection of multiple files.
  112. </constant>
  113. <constant name="MODE_OPEN_DIR" value="2" enum="Mode">
  114. The dialog functions as a folder selector, disallowing the selection of any file.
  115. </constant>
  116. <constant name="MODE_OPEN_ANY" value="3" enum="Mode">
  117. The dialog allows the selection of a file or a directory.
  118. </constant>
  119. <constant name="MODE_SAVE_FILE" value="4" enum="Mode">
  120. The dialog will warn when a file exists.
  121. </constant>
  122. <constant name="ACCESS_RESOURCES" value="0" enum="Access">
  123. The dialog allows the selection of file and directory.
  124. </constant>
  125. <constant name="ACCESS_USERDATA" value="1" enum="Access">
  126. The dialog allows access files under [Resource] path(res://) .
  127. </constant>
  128. <constant name="ACCESS_FILESYSTEM" value="2" enum="Access">
  129. The dialog allows access files in whole file system.
  130. </constant>
  131. </constants>
  132. <theme_items>
  133. <theme_item name="files_disabled" type="Color">
  134. </theme_item>
  135. <theme_item name="folder" type="Texture">
  136. </theme_item>
  137. <theme_item name="parent_folder" type="Texture">
  138. </theme_item>
  139. <theme_item name="reload" type="Texture">
  140. </theme_item>
  141. </theme_items>
  142. </class>