Signal3
Signal support.
FileDialog.swift:1223class Signal3
Use the connect(flags:_:)
method to connect to the signal on the container object, and disconnect(_:)
to drop the connection.
You can also await the emitted
property for waiting for a single emission of the signal.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (33) members.
Types
enum Access
enum FileMode
class Signal1
Signal support.
class Signal2
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 fileMode: FileDialog.FileMode
The dialog’s open or save mode, which affects the selection behavior. See
FileMode
.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. Each filter string in the array should be formatted like this:
*.txt,*.doc;Text Files
. The description text of the filter is optional and can be omitted.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 optionCount: Int32
The number of additional
OptionButton
s andCheckBox
es in the dialog.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 addOption(name: String, values: PackedStringArray, defaultValueIndex: Int32
) Adds an additional
OptionButton
to the file dialog. Ifvalues
is empty, aCheckBox
is added instead.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 getOptionDefault(option: Int32
) -> Int32 Returns the default value index of the
OptionButton
orCheckBox
with indexoption
.func getOptionName(option: Int32
) -> String Returns the name of the
OptionButton
orCheckBox
with indexoption
.func getOptionValues(option: Int32
) -> PackedStringArray Returns an array of values of the
OptionButton
with indexoption
.func getSelectedOptions(
) -> GDictionary Returns a
GDictionary
with the selected values of the additionalOptionButton
s and/orCheckBox
es.GDictionary
keys are names and values are selected value indices.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.
func setOptionDefault(option: Int32, defaultValueIndex: Int32
) Sets the default value index of the
OptionButton
orCheckBox
with indexoption
.func setOptionName(option: Int32, name: String
) Sets the name of the
OptionButton
orCheckBox
with indexoption
.func setOptionValues(option: Int32, values: PackedStringArray
) Sets the option values of the
OptionButton
with indexoption
.
Citizens in SwiftGodot
Instance members
var emitted: Void
You can await this property to wait for the signal to be emitted once
func connect(flags: Object.ConnectFlags, @escaping (_ dir: String) -> ()
) -> Object Connects the signal to the specified callback
func disconnect(Object
) Disconnects a signal that was previously connected, the return value from calling
connect(flags:_:)