TextEdit

Inherits: Control < CanvasItem < Node < Object

Category: Core

Brief Description

Multiline text editing control.

Member Functions

void add_color_region ( String begin_key, String end_key, Color color, bool line_only=false )
void add_keyword_color ( String keyword, Color color )
void clear_colors ( )
void clear_undo_history ( )
void copy ( )
bool cursor_get_blink_enabled ( ) const
float cursor_get_blink_speed ( ) const
int cursor_get_column ( ) const
int cursor_get_line ( ) const
void cursor_set_blink_enabled ( bool enable )
void cursor_set_blink_speed ( float blink_speed )
void cursor_set_column ( int column, bool adjust_viewport=false )
void cursor_set_line ( int line, bool adjust_viewport=false )
void cut ( )
String get_line ( int line ) const
int get_line_count ( ) const
int get_selection_from_column ( ) const
int get_selection_from_line ( ) const
String get_selection_text ( ) const
int get_selection_to_column ( ) const
int get_selection_to_line ( ) const
String get_text ( )
String get_word_under_cursor ( ) const
void insert_text_at_cursor ( String text )
bool is_selection_active ( ) const
bool is_syntax_coloring_enabled ( ) const
void paste ( )
void redo ( )
IntArray search ( String flags, int from_line, int from_column, int to_line ) const
void select ( int from_line, int from_column, int to_line, int to_column )
void select_all ( )
void set_custom_bg_color ( Color color )
void set_max_chars ( int amount )
void set_readonly ( bool enable )
void set_symbol_color ( Color color )
void set_syntax_coloring ( bool enable )
void set_text ( String text )
void set_wrap ( bool enable )
void undo ( )

Signals

  • cursor_changed ( )
  • request_completion ( )
  • text_changed ( )

Numeric Constants

  • SEARCH_MATCH_CASE = 1 — Match case when searching.
  • SEARCH_WHOLE_WORDS = 2 — Match whole words when searching.
  • SEARCH_BACKWARDS = 4 — Search from end to beginning.

Description

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.

Member Function Description

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

  • void add_keyword_color ( String keyword, Color color )

Add a keyword and its color.

  • void clear_colors ( )

Clear all the syntax coloring information.

  • void clear_undo_history ( )

Clear the undo history.

  • void copy ( )

Copy the current selection.

Gets whether the text editor caret is blinking.

Gets the text editor caret blink speed.

  • int cursor_get_column ( ) const

Return the column the editing cursor is at.

  • int cursor_get_line ( ) const

Return the line the editing cursor is at.

Set the text editor caret to blink.

Set the text editor caret blink speed. Cannot be less then or equal to 0.

  • void cursor_set_column ( int column, bool adjust_viewport=false )
  • void cursor_set_line ( int line, bool adjust_viewport=false )
  • void cut ( )

Cut the current selection.

Return the text of a specific line.

  • int get_line_count ( ) const

Return the amount of total lines in the text.

  • int get_selection_from_column ( ) const

Return the selection begin column.

  • int get_selection_from_line ( ) const

Return the selection begin line.

  • String get_selection_text ( ) const

Return the text inside the selection.

  • int get_selection_to_column ( ) const

Return the selection end column.

  • int get_selection_to_line ( ) const

Return the selection end line.

Return the whole text.

  • String get_word_under_cursor ( ) const
  • void insert_text_at_cursor ( String text )

Insert a given text at the cursor position.

  • bool is_selection_active ( ) const

Return true if the selection is active.

  • bool is_syntax_coloring_enabled ( ) const

Return true if the syntax coloring is enabled.

  • void paste ( )

Paste the current selection.

  • void redo ( )

Perform redo operation.

Perform a search inside the text. Search flags can be specified in the SEARCH_* enum.

  • void select ( int from_line, int from_column, int to_line, int to_column )

Perform selection, from line/column to line/column.

  • void select_all ( )

Select all the text.

  • void set_custom_bg_color ( Color color )

Set a custom background color. A background color with alpha==0 disables this.

  • void set_max_chars ( int amount )

Set the maximum amount of characters editable.

  • void set_readonly ( bool enable )

Set the text editor as read-only. Text can be displayed but not edited.

  • void set_symbol_color ( Color color )

Set the color for symbols.

  • void set_syntax_coloring ( bool enable )

Set to enable the syntax coloring.

  • void set_text ( String text )

Set the entire text.

  • void set_wrap ( bool enable )

Enable text wrapping when it goes beyond he edge of what is visible.

  • void undo ( )

Perform undo operation.