TextEdit

Multiline text editing control.

TextEdit is meant for editing large, multiline text. It also has facilities for editing code, such as syntax highlighting support and multiple levels of undo/redo.

@GodotBaseClass
struct TextEdit {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Enums

Constants
enum Constants
MenuItems
enum MenuItems
SearchFlags
enum SearchFlags
SearchResult
enum SearchResult

Functions

_clickSelectionHeld
void _clickSelectionHeld()
_cursorChangedEmit
void _cursorChangedEmit()
_guiInput
void _guiInput(InputEvent arg0)
_pushCurrentOp
void _pushCurrentOp()
_scrollMoved
void _scrollMoved(double arg0)
_textChangedEmit
void _textChangedEmit()
_toggleDrawCaret
void _toggleDrawCaret()
_updateWrapAt
void _updateWrapAt()
_vScrollInput
void _vScrollInput()
addColorRegion
void addColorRegion(String begin_key, String end_key, Color color, bool line_only)

Adds color region (given the delimiters) and its colors.

addKeywordColor
void addKeywordColor(String keyword, Color color)

Adds a keyword and its Color.

canFold
bool canFold(long line)

Returns if the given line is foldable, that is, it has indented lines right below it.

centerViewportToCursor
void centerViewportToCursor()

Centers the viewport on the line the editing cursor is at. This also resets the scrollHorizontal value to 0.

clearColors
void clearColors()

Clears all custom syntax coloring information previously added with addColorRegion or addKeywordColor.

clearUndoHistory
void clearUndoHistory()

Clears the undo history.

copy
void copy()

Copy's the current text selection.

cursorGetBlinkEnabled
bool cursorGetBlinkEnabled()
cursorGetBlinkSpeed
double cursorGetBlinkSpeed()
cursorGetColumn
long cursorGetColumn()

Returns the column the editing cursor is at.

cursorGetLine
long cursorGetLine()

Returns the line the editing cursor is at.

cursorIsBlockMode
bool cursorIsBlockMode()
cursorSetBlinkEnabled
void cursorSetBlinkEnabled(bool enable)
cursorSetBlinkSpeed
void cursorSetBlinkSpeed(double blink_speed)
cursorSetBlockMode
void cursorSetBlockMode(bool enable)
cursorSetColumn
void cursorSetColumn(long column, bool adjust_viewport)

Moves the cursor at the specified column index. If adjust_viewport is set to true, the viewport will center at the cursor position after the move occurs.

cursorSetLine
void cursorSetLine(long line, bool adjust_viewport, bool can_be_hidden, long wrap_index)

Moves the cursor at the specified line index. If adjust_viewport is set to true, the viewport will center at the cursor position after the move occurs. If can_be_hidden is set to true, the specified line can be hidden using setLineAsHidden.

cut
void cut()

Cut's the current selection.

deselect
void deselect()

Deselects the current selection.

drawMinimap
void drawMinimap(bool draw)
foldAllLines
void foldAllLines()

Folds all lines that are possible to be folded (see canFold).

foldLine
void foldLine(long line)

Folds the given line, if possible (see canFold).

getBreakpoints
Array getBreakpoints()

Returns an array containing the line number of each breakpoint.

getHScroll
long getHScroll()
getKeywordColor
Color getKeywordColor(String keyword)

Returns the Color of the specified keyword.

getLine
String getLine(long line)

Returns the text of a specific line.

getLineCount
long getLineCount()

Returns the amount of total lines in the text.

getMenu
PopupMenu getMenu()

Returns the PopupMenu of this TextEdit. By default, this menu is displayed when right-clicking on the TextEdit.

getMinimapWidth
long getMinimapWidth()
getSelectionFromColumn
long getSelectionFromColumn()

Returns the selection begin column.

getSelectionFromLine
long getSelectionFromLine()

Returns the selection begin line.

getSelectionText
String getSelectionText()

Returns the text inside the selection.

getSelectionToColumn
long getSelectionToColumn()

Returns the selection end column.

getSelectionToLine
long getSelectionToLine()

Returns the selection end line.

getText
String getText()
getVScroll
double getVScroll()
getVScrollSpeed
double getVScrollSpeed()
getWordUnderCursor
String getWordUnderCursor()

Returns a String text with the word under the caret (text cursor) location.

hasKeywordColor
bool hasKeywordColor(String keyword)

Returns whether the specified keyword has a color set to it or not.

insertTextAtCursor
void insertTextAtCursor(String text)

Insert the specified text at the cursor position.

isBreakpointGutterEnabled
bool isBreakpointGutterEnabled()
isContextMenuEnabled
bool isContextMenuEnabled()
isDrawingFoldGutter
bool isDrawingFoldGutter()
isDrawingMinimap
bool isDrawingMinimap()
isDrawingSpaces
bool isDrawingSpaces()
isDrawingTabs
bool isDrawingTabs()
isFolded
bool isFolded(long line)

Returns whether the line at the specified index is folded or not.

isHidingEnabled
bool isHidingEnabled()
isHighlightAllOccurrencesEnabled
bool isHighlightAllOccurrencesEnabled()
isHighlightCurrentLineEnabled
bool isHighlightCurrentLineEnabled()
isLineHidden
bool isLineHidden(long line)

Returns whether the line at the specified index is hidden or not.

isLineSetAsBookmark
bool isLineSetAsBookmark(long line)

Returns true when the specified line is bookmarked.

isLineSetAsBreakpoint
bool isLineSetAsBreakpoint(long line)

Returns true when the specified line has a breakpoint.

isLineSetAsSafe
bool isLineSetAsSafe(long line)

Returns true when the specified line is marked as safe.

isOverridingSelectedFontColor
bool isOverridingSelectedFontColor()
isReadonly
bool isReadonly()
isRightClickMovingCaret
bool isRightClickMovingCaret()
isSelectingEnabled
bool isSelectingEnabled()
isSelectionActive
bool isSelectionActive()

Returns true if the selection is active.

isShortcutKeysEnabled
bool isShortcutKeysEnabled()
isShowLineNumbersEnabled
bool isShowLineNumbersEnabled()
isSmoothScrollEnabled
bool isSmoothScrollEnabled()
isSyntaxColoringEnabled
bool isSyntaxColoringEnabled()
isVirtualKeyboardEnabled
bool isVirtualKeyboardEnabled()
isWrapEnabled
bool isWrapEnabled()
menuOption
void menuOption(long option)

Triggers a right-click menu action by the specified index. See menuitems for a list of available indexes.

opAssign
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(TextEdit other)
opEquals
bool opEquals(typeof(null) n)
paste
void paste()

Paste the current selection.

redo
void redo()

Perform redo operation.

removeBreakpoints
void removeBreakpoints()

Removes all the breakpoints. This will not fire the breakpointToggled signal.

search
PoolIntArray search(String key, long flags, long from_line, long from_column)

Perform a search inside the text. Search flags can be specified in the searchflags enum. Returns an empty PoolIntArray if no result was found. Otherwise, the result line and column can be accessed at indices specified in the searchresult enum, e.g:

select
void select(long from_line, long from_column, long to_line, long to_column)

Perform selection, from line/column to line/column. If selectingEnabled is false, no selection will occur.

selectAll
void selectAll()

Select all the text. If selectingEnabled is false, no selection will occur.

setBreakpointGutterEnabled
void setBreakpointGutterEnabled(bool enable)
setContextMenuEnabled
void setContextMenuEnabled(bool enable)
setDrawFoldGutter
void setDrawFoldGutter(bool arg0)
setDrawSpaces
void setDrawSpaces(bool arg0)
setDrawTabs
void setDrawTabs(bool arg0)
setHScroll
void setHScroll(long value)
setHidingEnabled
void setHidingEnabled(bool enable)
setHighlightAllOccurrences
void setHighlightAllOccurrences(bool enable)
setHighlightCurrentLine
void setHighlightCurrentLine(bool enabled)
setLine
void setLine(long line, String new_text)

Sets the text for a specific line.

setLineAsBookmark
void setLineAsBookmark(long line, bool bookmark)

Bookmarks the line if bookmark is true. Deletes the bookmark if bookmark is false. Bookmarks are shown in the breakpointGutter.

setLineAsBreakpoint
void setLineAsBreakpoint(long line, bool breakpoint)

Adds or removes the breakpoint in line. Breakpoints are shown in the breakpointGutter.

setLineAsHidden
void setLineAsHidden(long line, bool enable)

If true, hides the line of the specified index.

setLineAsSafe
void setLineAsSafe(long line, bool safe)

If true, marks the line as safe. This will show the line number with the color provided in the safe_line_number_color theme property.

setMinimapWidth
void setMinimapWidth(long width)
setOverrideSelectedFontColor
void setOverrideSelectedFontColor(bool _override)
setReadonly
void setReadonly(bool enable)
setRightClickMovesCaret
void setRightClickMovesCaret(bool enable)
setSelectingEnabled
void setSelectingEnabled(bool enable)
setShortcutKeysEnabled
void setShortcutKeysEnabled(bool enable)
setShowLineNumbers
void setShowLineNumbers(bool enable)
setSmoothScrollEnable
void setSmoothScrollEnable(bool enable)
setSyntaxColoring
void setSyntaxColoring(bool enable)
setText
void setText(String text)
setVScroll
void setVScroll(double value)
setVScrollSpeed
void setVScrollSpeed(double speed)
setVirtualKeyboardEnabled
void setVirtualKeyboardEnabled(bool enable)
setWrapEnabled
void setWrapEnabled(bool enable)
toHash
size_t toHash()
toggleFoldLine
void toggleFoldLine(long line)

Toggle the folding of the code block at the given line.

undo
void undo()

Perform undo operation.

unfoldLine
void unfoldLine(long line)

Unfolds the given line, if folded.

unhideAllLines
void unhideAllLines()

Unhide all lines that were previously set to hidden by setLineAsHidden.

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

breakpointGutter
bool breakpointGutter [@property getter]
bool breakpointGutter [@property setter]

If true, the breakpoint gutter is visible.

caretBlink
bool caretBlink [@property getter]
bool caretBlink [@property setter]

If true, the caret (visual cursor) blinks.

caretBlinkSpeed
double caretBlinkSpeed [@property getter]
double caretBlinkSpeed [@property setter]

Duration (in seconds) of a caret's blinking cycle.

caretBlockMode
bool caretBlockMode [@property getter]
bool caretBlockMode [@property setter]

If true, the caret displays as a rectangle. If false, the caret displays as a bar.

caretMovingByRightClick
bool caretMovingByRightClick [@property getter]
bool caretMovingByRightClick [@property setter]

If true, a right-click moves the cursor at the mouse position before displaying the context menu. If false, the context menu disregards mouse location.

contextMenuEnabled
bool contextMenuEnabled [@property getter]
bool contextMenuEnabled [@property setter]

If true, a right-click displays the context menu.

drawSpaces
bool drawSpaces [@property getter]
bool drawSpaces [@property setter]

If true, the "space" character will have a visible representation.

drawTabs
bool drawTabs [@property getter]
bool drawTabs [@property setter]

If true, the "tab" character will have a visible representation.

foldGutter
bool foldGutter [@property getter]
bool foldGutter [@property setter]

If true, the fold gutter is visible. This enables folding groups of indented lines.

hidingEnabled
bool hidingEnabled [@property getter]
bool hidingEnabled [@property setter]

If true, all lines that have been set to hidden by setLineAsHidden, will not be visible.

highlightAllOccurrences
bool highlightAllOccurrences [@property getter]
bool highlightAllOccurrences [@property setter]

If true, all occurrences of the selected text will be highlighted.

highlightCurrentLine
bool highlightCurrentLine [@property getter]
bool highlightCurrentLine [@property setter]

If true, the line containing the cursor is highlighted.

minimapDraw
bool minimapDraw [@property getter]
bool minimapDraw [@property setter]

If true, a minimap is shown, providing an outline of your source code.

minimapWidth
long minimapWidth [@property getter]
long minimapWidth [@property setter]

The width, in pixels, of the minimap.

overrideSelectedFontColor
bool overrideSelectedFontColor [@property getter]
bool overrideSelectedFontColor [@property setter]

If true, custom font_color_selected will be used for selected text.

readonly
bool readonly [@property getter]
bool readonly [@property setter]

If true, read-only mode is enabled. Existing text cannot be modified and new text cannot be added.

scrollHorizontal
long scrollHorizontal [@property getter]
long scrollHorizontal [@property setter]

The current horizontal scroll value.

scrollVertical
double scrollVertical [@property getter]
double scrollVertical [@property setter]

The current vertical scroll value.

selectingEnabled
bool selectingEnabled [@property getter]
bool selectingEnabled [@property setter]

If true, text can be selected. If false, text can not be selected by the user or by the select or selectAll methods.

shortcutKeysEnabled
bool shortcutKeysEnabled [@property getter]
bool shortcutKeysEnabled [@property setter]

If true, shortcut keys for context menu items are enabled, even if the context menu is disabled.

showLineNumbers
bool showLineNumbers [@property getter]
bool showLineNumbers [@property setter]

If true, line numbers are displayed to the left of the text.

smoothScrolling
bool smoothScrolling [@property getter]
bool smoothScrolling [@property setter]

If true, sets the step of the scrollbars to 0.25 which results in smoother scrolling.

syntaxHighlighting
bool syntaxHighlighting [@property getter]
bool syntaxHighlighting [@property setter]

If true, any custom color properties that have been set for this TextEdit will be visible.

text
String text [@property setter]

String value of the TextEdit.

text
String text [@property getter]

String value of the TextEdit.

vScrollSpeed
double vScrollSpeed [@property getter]
double vScrollSpeed [@property setter]

Vertical scroll sensitivity.

virtualKeyboardEnabled
bool virtualKeyboardEnabled [@property getter]
bool virtualKeyboardEnabled [@property setter]

If true, the native virtual keyboard is shown when focused on platforms that support it.

wrapEnabled
bool wrapEnabled [@property getter]
bool wrapEnabled [@property setter]

If true, enables text wrapping when it goes beyond the edge of what is visible.

Static functions

_new
TextEdit _new()

Construct a new instance of TextEdit. Note: use memnew!TextEdit instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(ToRef) as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta