Instance Propertymigueldeicaza.swiftgodot 0.45.0SwiftGodot
fileMode
The dialog’s open or save mode, which affects the selection behavior. See FileMode
.
final var fileMode: FileDialog.FileMode { get set }
Other members in extension
Types
enum Access
enum FileMode
class Signal1
Signal support.
class Signal2
Signal support.
class Signal3
Signal support.
Type members
Instance members
var access: FileDialog.Access
The file system access scope. See
Access
constants.var currentDir: String
The current working directory of the file dialog.
var currentFile: String
The currently selected file of the file dialog.
var currentPath: String
The currently selected file path of the file dialog.
var dirSelected: Signal3
Emitted when the user selects a directory.
var fileSelected: Signal1
Emitted when the user selects a file by double-clicking it or pressing the OK button.
var filesSelected: Signal2
Emitted when the user selects multiple files.
var filters: PackedStringArray
The available file type filters. For example, this shows only
.png
and.gd
files:set_filters(PackedStringArray(["*.png ; PNG Images","*.gd ; GDScript Files"]))
. Multiple file types can also be specified in a single filter."*.png, *.jpg, *.jpeg ; Supported Images"
will show both PNG and JPEG files when selected.var modeOverridesTitle: Bool
If
true
, changing thefileMode
property will set the window title accordingly (e.g. settingfileMode
to .openFile will change the window title to “Open a File”).var rootSubfolder: String
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.var showHiddenFiles: Bool
If
true
, the dialog will show hidden files.var useNativeDialog: Bool
If
true
,access
is set to .filesystem, and it is supported by the currentDisplayServer
, OS native dialog will be used instead of custom one.func addFilter(String, description: String
) Adds a comma-delimited file name
filter
option to theFileDialog
with an optionaldescription
, which restricts what files can be picked.func clearFilters(
) Clear all the added filters in the dialog.
func deselectAll(
) Clear all currently selected items in the dialog.
func getLineEdit(
) -> LineEdit? Returns the LineEdit for the selected file.
func getVbox(
) -> VBoxContainer? Returns the vertical box container of the dialog, custom controls can be added to it.
func invalidate(
) Invalidate and update the current dialog content list.