TextEdit
Inherits: Control < CanvasItem < Node < Object
Category: Core
Brief Description
Multiline text editing control.
Member Functions
Signals
- breakpoint_toggled ( int row )
Emitted when a breakpoint is placed via the breakpoint gutter.
- cursor_changed ( )
Emitted when the cursor changes.
- request_completion ( )
- text_changed ( )
Emitted when the text changes.
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.
- MENU_CUT = 0
- MENU_COPY = 1
- MENU_PASTE = 2
- MENU_CLEAR = 3
- MENU_SELECT_ALL = 4
- MENU_UNDO = 5
- MENU_MAX = 6
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
void add_color_region ( String begin_key, String end_key, Color color, bool line_only=false )
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.
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.
bool cursor_is_block_mode ( ) const
Gets whether the text editor caret is in block mode.
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 cursor_set_block_mode ( bool enable )
Set the text editor caret to block mode.
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.
String get_line ( int line ) const
Return the text of a specific line.
int get_line_count ( ) const
Return the amount of total lines in the text.
PopupMenu get_menu ( ) const
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_highlight_all_occurrences_enabled ( ) const
Returns true if highlight all occurrences is enabled.
bool is_selection_active ( ) const
Return true if the selection is active.
bool is_show_line_numbers_enabled ( ) const
Returns true if line numbers are enabled.
bool is_syntax_coloring_enabled ( ) const
Return true if the syntax coloring is enabled.
void menu_option ( int arg0 )
void paste ( )
Paste the current selection.
void redo ( )
Perform redo operation.
IntArray search ( String flags, int from_line, int from_column, int to_line ) const
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_highlight_all_occurrences ( bool enable )
Set to enable highlighting all occurrences of the current selection.
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_show_line_numbers ( bool enable )
Set to enable showing line numbers.
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.
© 2014–2020 Juan Linietsky, Ariel Manzur, Godot Engine contributors
Licensed under the MIT License.
https://docs.godotengine.org/en/2.1/classes/class_textedit.html