Enumerationmigueldeicaza.swiftgodot 0.45.0SwiftGodot
MenuItems
LineEdit.swift:63enum MenuItems
Cases
case cut
Cuts (copies and clears) the selected text.
case copy
Copies the selected text.
case paste
Pastes the clipboard text over the selected text (or at the caret’s position).
case clear
Erases the whole
LineEdit
text.case selectAll
Selects the whole
LineEdit
text.case undo
Undoes the previous action.
case redo
Reverse the last undo action.
case dirInherited
Sets text direction to inherited.
case dirAuto
Sets text direction to automatic.
case dirLtr
Sets text direction to left-to-right.
case dirRtl
Sets text direction to right-to-left.
case displayUcc
Toggles control character display.
case insertLrm
Inserts left-to-right mark (LRM) character.
case insertRlm
Inserts right-to-left mark (RLM) character.
case insertLre
Inserts start of left-to-right embedding (LRE) character.
case insertRle
Inserts start of right-to-left embedding (RLE) character.
case insertLro
Inserts start of left-to-right override (LRO) character.
case insertRlo
Inserts start of right-to-left override (RLO) character.
case insertPdf
Inserts pop direction formatting (PDF) character.
case insertAlm
Inserts Arabic letter mark (ALM) character.
case insertLri
Inserts left-to-right isolate (LRI) character.
case insertRli
Inserts right-to-left isolate (RLI) character.
case insertFsi
Inserts first strong isolate (FSI) character.
case insertPdi
Inserts pop direction isolate (PDI) character.
case insertZwj
Inserts zero width joiner (ZWJ) character.
case insertZwnj
Inserts zero width non-joiner (ZWNJ) character.
case insertWj
Inserts word joiner (WJ) character.
case insertShy
Inserts soft hyphen (SHY) character.
case max
Represents the size of the
MenuItems
enum.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (53) members.
Types
class Signal1
Signal support.
class Signal2
Signal support.
class Signal3
Signal support.
enum VirtualKeyboardType
Type members
Instance members
var alignment: HorizontalAlignment
Text alignment as defined in the
HorizontalAlignment
enum.var caretBlink: Bool
If
true
, makes the caret blink.var caretBlinkInterval: Double
The interval at which the caret blinks (in seconds).
var caretColumn: Int32
The caret’s column position inside the
LineEdit
. When set, the text may scroll to accommodate it.var caretForceDisplayed: Bool
If
true
, theLineEdit
will always show the caret, even if focus is lost.var caretMidGrapheme: Bool
Allow moving caret, selecting and removing the individual composite character components.
var clearButtonEnabled: Bool
If
true
, theLineEdit
will show a clear button iftext
is not empty, which can be used to clear the text quickly.var contextMenuEnabled: Bool
If
true
, the context menu will appear when right-clicked.var deselectOnFocusLossEnabled: Bool
If
true
, the selected text will be deselected when focus is lost.var dragAndDropSelectionEnabled: Bool
If
true
, allow drag and drop of selected text.var drawControlChars: Bool
If
true
, control characters are displayed.var editable: Bool
If
false
, existing text cannot be modified and new text cannot be added.var expandToTextLength: Bool
If
true
, theLineEdit
width will increase to stay longer than thetext
. It will not compress if thetext
is shortened.var flat: Bool
If
true
, theLineEdit
doesn’t display decoration.var language: String
Language code used for line-breaking and text shaping algorithms. If left empty, current locale is used instead.
var maxLength: Int32
Maximum number of characters that can be entered inside the
LineEdit
. If0
, there is no limit.var middleMousePasteEnabled: Bool
If
false
, using middle mouse button to paste clipboard will be disabled.var placeholderText: String
Text shown when the
LineEdit
is empty. It is not theLineEdit
’s default value (seetext
).var rightIcon: Texture2D?
Sets the icon that will appear in the right end of the
LineEdit
if there’s notext
, or always, ifclearButtonEnabled
is set tofalse
.var secret: Bool
If
true
, every character is replaced with the secret character (seesecretCharacter
).var secretCharacter: String
The character to use to mask secret input. Only a single character can be used as the secret character. If it is longer than one character, only the first one will be used. If it is empty, a space will be used instead.
var selectAllOnFocus: Bool
If
true
, theLineEdit
will select the whole text when it gains focus.var selectingEnabled: Bool
If
false
, it’s impossible to select the text using mouse nor keyboard.var shortcutKeysEnabled: Bool
If
false
, using shortcuts will be disabled.var structuredTextBidiOverride: TextServer.StructuredTextParser
Set BiDi algorithm override for the structured text.
var structuredTextBidiOverrideOptions: GArray
Set additional options for BiDi override.
var text: String
String value of the
LineEdit
.var textChangeRejected: Signal2
Emitted when appending text that overflows the
maxLength
. The appended text is truncated to fitmaxLength
, and the part that couldn’t fit is passed as therejectedSubstring
argument.var textChanged: Signal1
Emitted when the text changes.
var textDirection: Control.TextDirection
Base text writing direction.
var textSubmitted: Signal3
Emitted when the user presses
enter
on theLineEdit
.var virtualKeyboardEnabled: Bool
If
true
, the native virtual keyboard is shown when focused on platforms that support it.var virtualKeyboardType: LineEdit.VirtualKeyboardType
Specifies the type of virtual keyboard to show.
func clear(
) func deleteCharAtCaret(
) Deletes one character at the caret’s current position (equivalent to pressing [kbd]Delete[/kbd]).
func deleteText(fromColumn: Int32, toColumn: Int32
) Deletes a section of the
text
going from positionfromColumn
totoColumn
. Both parameters should be within the text’s length.func deselect(
) Clears the current selection.
func getMenu(
) -> PopupMenu? Returns the
PopupMenu
of thisLineEdit
. By default, this menu is displayed when right-clicking on theLineEdit
.func getScrollOffset(
) -> Double Returns the scroll offset due to
caretColumn
, as a number of characters.func getSelectedText(
) -> String Returns the text inside the selection.
func getSelectionFromColumn(
) -> Int32 Returns the selection begin column.
func getSelectionToColumn(
) -> Int32 Returns the selection end column.
func hasSelection(
) -> Bool Returns
true
if the user has selected text.func insertTextAtCaret(text: String
) Inserts
text
at the caret. If the resulting value is longer thanmaxLength
, nothing happens.func isMenuVisible(
) -> Bool Returns whether the menu is visible. Use this instead of
get_menu().visible
to improve performance (so the creation of the menu is avoided).func select(from: Int32, to: Int32
) Selects characters inside
LineEdit
betweenfrom
andto
. By default,from
is at the beginning andto
at the end.func selectAll(
) Selects the whole
String
.
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.