FileDialog.xml 5.2 KB

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