Enumerationmigueldeicaza.swiftgodot 0.46.0SwiftGodot
FileMode
FileDialog.swift:26enum FileMode
Cases
case openFile
The dialog allows selecting one, and only one file.
case openFiles
The dialog allows selecting multiple files.
case openDir
The dialog only allows selecting a directory, disallowing the selection of any file.
case openAny
The dialog allows selecting one file or directory.
case saveFile
The dialog will warn when a file exists.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (33) members.
Types
enum Access
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 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
Conformances
protocol CaseIterable
A type that provides a collection of all of its values.
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
Type members
Instance members
var debugDescription: String
A textual representation of this instance, suitable for debugging
Type features
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.