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.
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¶
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.
- 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 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.
- float get_v_scroll_speed ( ) const
- 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_smooth_scroll_enabled ( ) const
- 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.
- PoolIntArray search ( String key, int flags, int from_line, int from_column ) const
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_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_smooth_scroll_enable ( bool enable )
- void set_syntax_coloring ( bool enable )
Set to enable the syntax coloring.
- void set_text ( String text )
Set the entire text.
- void set_v_scroll_speed ( float speed )
- void set_wrap ( bool enable )
Enable text wrapping when it goes beyond he edge of what is visible.
- void undo ( )
Perform undo operation.