TextEdit¶
Inherits: Control < CanvasItem < Node < Object
Category: Core
Brief Description¶
Multiline text editing control.
Member Functions¶
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.
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.
- bool cursor_get_blink_enabled ( ) const
Gets whether the text editor caret is blinking.
- float cursor_get_blink_speed ( ) const
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.
- void cursor_set_blink_enabled ( bool enable )
Set the text editor caret to blink.
- void cursor_set_blink_speed ( float blink_speed )
Set the text editor caret blink speed. Cannot be less then or equal to 0.
- 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.
- String get_text ( )
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.
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.