class_filedialog.rst 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the FileDialog.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_FileDialog:
  5. FileDialog
  6. ==========
  7. **Inherits:** :ref:`ConfirmationDialog<class_confirmationdialog>` **<** :ref:`AcceptDialog<class_acceptdialog>` **<** :ref:`WindowDialog<class_windowdialog>` **<** :ref:`Popup<class_popup>` **<** :ref:`Control<class_control>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Dialog for selecting files or directories in the filesystem.
  12. Member Functions
  13. ----------------
  14. +--------------------------------------------+---------------------------------------------------------------------------------------------------------+
  15. | void | :ref:`add_filter<class_FileDialog_add_filter>` **(** :ref:`String<class_string>` filter **)** |
  16. +--------------------------------------------+---------------------------------------------------------------------------------------------------------+
  17. | void | :ref:`clear_filters<class_FileDialog_clear_filters>` **(** **)** |
  18. +--------------------------------------------+---------------------------------------------------------------------------------------------------------+
  19. | void | :ref:`deselect_items<class_FileDialog_deselect_items>` **(** **)** |
  20. +--------------------------------------------+---------------------------------------------------------------------------------------------------------+
  21. | :ref:`String<class_string>` | :ref:`get_current_dir<class_FileDialog_get_current_dir>` **(** **)** const |
  22. +--------------------------------------------+---------------------------------------------------------------------------------------------------------+
  23. | :ref:`String<class_string>` | :ref:`get_current_file<class_FileDialog_get_current_file>` **(** **)** const |
  24. +--------------------------------------------+---------------------------------------------------------------------------------------------------------+
  25. | :ref:`String<class_string>` | :ref:`get_current_path<class_FileDialog_get_current_path>` **(** **)** const |
  26. +--------------------------------------------+---------------------------------------------------------------------------------------------------------+
  27. | :ref:`VBoxContainer<class_vboxcontainer>` | :ref:`get_vbox<class_FileDialog_get_vbox>` **(** **)** |
  28. +--------------------------------------------+---------------------------------------------------------------------------------------------------------+
  29. | void | :ref:`invalidate<class_FileDialog_invalidate>` **(** **)** |
  30. +--------------------------------------------+---------------------------------------------------------------------------------------------------------+
  31. | void | :ref:`set_current_dir<class_FileDialog_set_current_dir>` **(** :ref:`String<class_string>` dir **)** |
  32. +--------------------------------------------+---------------------------------------------------------------------------------------------------------+
  33. | void | :ref:`set_current_file<class_FileDialog_set_current_file>` **(** :ref:`String<class_string>` file **)** |
  34. +--------------------------------------------+---------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`set_current_path<class_FileDialog_set_current_path>` **(** :ref:`String<class_string>` path **)** |
  36. +--------------------------------------------+---------------------------------------------------------------------------------------------------------+
  37. Signals
  38. -------
  39. .. _class_FileDialog_dir_selected:
  40. - **dir_selected** **(** :ref:`String<class_string>` dir **)**
  41. Event emitted when the user selects a directory.
  42. .. _class_FileDialog_file_selected:
  43. - **file_selected** **(** :ref:`String<class_string>` path **)**
  44. Event emitted when the user selects a file (double clicks it or presses the OK button).
  45. .. _class_FileDialog_files_selected:
  46. - **files_selected** **(** :ref:`PoolStringArray<class_poolstringarray>` paths **)**
  47. Event emitted when the user selects multiple files.
  48. Member Variables
  49. ----------------
  50. .. _class_FileDialog_access:
  51. - :ref:`int<class_int>` **access**
  52. .. _class_FileDialog_filters:
  53. - :ref:`PoolStringArray<class_poolstringarray>` **filters**
  54. .. _class_FileDialog_mode:
  55. - :ref:`int<class_int>` **mode**
  56. .. _class_FileDialog_show_hidden_files:
  57. - :ref:`bool<class_bool>` **show_hidden_files**
  58. Numeric Constants
  59. -----------------
  60. - **MODE_OPEN_FILE** = **0** --- The dialog allows the selection of one, and only one file.
  61. - **MODE_OPEN_FILES** = **1** --- The dialog allows the selection of multiple files.
  62. - **MODE_OPEN_DIR** = **2** --- The dialog functions as a folder selector, disallowing the selection of any file.
  63. - **MODE_OPEN_ANY** = **3** --- The dialog allows the selection of a file or a directory.
  64. - **MODE_SAVE_FILE** = **4** --- The dialog will warn when a file exists.
  65. - **ACCESS_RESOURCES** = **0** --- The dialog allows the selection of file and directory.
  66. - **ACCESS_USERDATA** = **1** --- The dialog allows access files under :ref:`Resource<class_resource>` path(res://) .
  67. - **ACCESS_FILESYSTEM** = **2** --- The dialog allows access files in whole file system.
  68. Description
  69. -----------
  70. FileDialog is a preset dialog used to choose files and directories in the filesystem. It supports filter masks.
  71. Member Function Description
  72. ---------------------------
  73. .. _class_FileDialog_add_filter:
  74. - void **add_filter** **(** :ref:`String<class_string>` filter **)**
  75. Add a custom filter. Filter format is: "mask ; description", example (C++): dialog->add_filter("\*.png ; PNG Images");
  76. .. _class_FileDialog_clear_filters:
  77. - void **clear_filters** **(** **)**
  78. Clear all the added filters in the dialog.
  79. .. _class_FileDialog_deselect_items:
  80. - void **deselect_items** **(** **)**
  81. .. _class_FileDialog_get_current_dir:
  82. - :ref:`String<class_string>` **get_current_dir** **(** **)** const
  83. Get the current working directory of the file dialog.
  84. .. _class_FileDialog_get_current_file:
  85. - :ref:`String<class_string>` **get_current_file** **(** **)** const
  86. Get the current selected file of the file dialog (empty if none).
  87. .. _class_FileDialog_get_current_path:
  88. - :ref:`String<class_string>` **get_current_path** **(** **)** const
  89. Get the current selected path (directory and file) of the file dialog (empty if none).
  90. .. _class_FileDialog_get_vbox:
  91. - :ref:`VBoxContainer<class_vboxcontainer>` **get_vbox** **(** **)**
  92. Return the vertical box container of the dialog, custom controls can be added to it.
  93. .. _class_FileDialog_invalidate:
  94. - void **invalidate** **(** **)**
  95. Invalidate and update the current dialog content list.
  96. .. _class_FileDialog_set_current_dir:
  97. - void **set_current_dir** **(** :ref:`String<class_string>` dir **)**
  98. Set the current working directory of the file dialog.
  99. .. _class_FileDialog_set_current_file:
  100. - void **set_current_file** **(** :ref:`String<class_string>` file **)**
  101. Set the current selected file name of the file dialog.
  102. .. _class_FileDialog_set_current_path:
  103. - void **set_current_path** **(** :ref:`String<class_string>` path **)**
  104. Set the current selected file path of the file dialog.