diff options
Diffstat (limited to 'editor/code_editor.h')
-rw-r--r-- | editor/code_editor.h | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/editor/code_editor.h b/editor/code_editor.h index 2a3bb1ba76..2d233c61c6 100644 --- a/editor/code_editor.h +++ b/editor/code_editor.h @@ -36,6 +36,7 @@ #include "scene/gui/check_button.h" #include "scene/gui/dialogs.h" #include "scene/gui/line_edit.h" +#include "scene/gui/link_button.h" #include "scene/gui/text_edit.h" #include "scene/gui/tool_button.h" #include "scene/main/timer.h" @@ -142,10 +143,12 @@ class CodeTextEditor : public VBoxContainer { TextEdit *text_editor; FindReplaceBar *find_replace_bar; HBoxContainer *status_bar; + Label *warning_label; + Label *warning_count_label; Label *line_nb; Label *col_nb; - Label *zoom_nb; + Label *font_size_nb; Label *info; Timer *idle; Timer *code_complete_timer; @@ -155,7 +158,9 @@ class CodeTextEditor : public VBoxContainer { int font_resize_val; real_t font_size; - Label *error; + LinkButton *error; + int error_line; + int error_column; void _on_settings_change(); @@ -169,6 +174,7 @@ class CodeTextEditor : public VBoxContainer { void _zoom_out(); void _zoom_changed(); void _reset_zoom(); + void _error_pressed(); CodeTextEditorCodeCompleteFunc code_complete_func; void *code_complete_ud; @@ -186,11 +192,37 @@ protected: static void _bind_methods(); public: + void trim_trailing_whitespace(); + + void convert_indent_to_spaces(); + void convert_indent_to_tabs(); + + enum CaseStyle { + UPPER, + LOWER, + CAPITALIZE, + }; + void convert_case(CaseStyle p_case); + + void move_lines_up(); + void move_lines_down(); + void delete_lines(); + void clone_lines_down(); + + void goto_line(int p_line); + void goto_line_selection(int p_line, int p_begin, int p_end); + + Variant get_edit_state(); + void set_edit_state(const Variant &p_state); + void update_editor_settings(); void set_error(const String &p_error); + void set_error_pos(int p_line, int p_column); void update_line_and_column() { _line_col_changed(); } TextEdit *get_text_edit() { return text_editor; } FindReplaceBar *get_find_replace_bar() { return find_replace_bar; } + Label *get_warning_label() const { return warning_label; } + Label *get_warning_count_label() const { return warning_count_label; } virtual void apply_code() {} void set_code_complete_func(CodeTextEditorCodeCompleteFunc p_code_complete_func, void *p_ud); |