diff options
Diffstat (limited to 'editor/code_editor.h')
-rw-r--r-- | editor/code_editor.h | 76 |
1 files changed, 39 insertions, 37 deletions
diff --git a/editor/code_editor.h b/editor/code_editor.h index aebdfe57c0..d52f57860c 100644 --- a/editor/code_editor.h +++ b/editor/code_editor.h @@ -43,10 +43,10 @@ class GotoLineDialog : public ConfirmationDialog { GDCLASS(GotoLineDialog, ConfirmationDialog); - Label *line_label; - LineEdit *line; + Label *line_label = nullptr; + LineEdit *line = nullptr; - CodeEdit *text_editor; + CodeEdit *text_editor = nullptr; virtual void ok_pressed() override; @@ -62,32 +62,32 @@ class CodeTextEditor; class FindReplaceBar : public HBoxContainer { GDCLASS(FindReplaceBar, HBoxContainer); - LineEdit *search_text; - Label *matches_label; - Button *find_prev; - Button *find_next; - CheckBox *case_sensitive; - CheckBox *whole_words; - TextureButton *hide_button; + LineEdit *search_text = nullptr; + Label *matches_label = nullptr; + Button *find_prev = nullptr; + Button *find_next = nullptr; + CheckBox *case_sensitive = nullptr; + CheckBox *whole_words = nullptr; + TextureButton *hide_button = nullptr; - LineEdit *replace_text; - Button *replace; - Button *replace_all; - CheckBox *selection_only; + LineEdit *replace_text = nullptr; + Button *replace = nullptr; + Button *replace_all = nullptr; + CheckBox *selection_only = nullptr; - VBoxContainer *vbc_lineedit; - HBoxContainer *hbc_button_replace; - HBoxContainer *hbc_option_replace; + VBoxContainer *vbc_lineedit = nullptr; + HBoxContainer *hbc_button_replace = nullptr; + HBoxContainer *hbc_option_replace = nullptr; CodeTextEditor *base_text_editor = nullptr; - CodeEdit *text_editor; + CodeEdit *text_editor = nullptr; int result_line; int result_col; int results_count; - bool replace_all_mode; - bool preserve_cursor; + bool replace_all_mode = false; + bool preserve_cursor = false; void _get_search_from(int &r_line, int &r_col); void _update_results_count(); @@ -134,30 +134,30 @@ public: FindReplaceBar(); }; -typedef void (*CodeTextEditorCodeCompleteFunc)(void *p_ud, const String &p_code, List<ScriptCodeCompletionOption> *r_options, bool &r_forced); +typedef void (*CodeTextEditorCodeCompleteFunc)(void *p_ud, const String &p_code, List<ScriptLanguage::CodeCompletionOption> *r_options, bool &r_forced); class CodeTextEditor : public VBoxContainer { GDCLASS(CodeTextEditor, VBoxContainer); - CodeEdit *text_editor; + CodeEdit *text_editor = nullptr; FindReplaceBar *find_replace_bar = nullptr; - HBoxContainer *status_bar; + HBoxContainer *status_bar = nullptr; - Button *toggle_scripts_button; - Button *error_button; - Button *warning_button; + Button *toggle_scripts_button = nullptr; + Button *error_button = nullptr; + Button *warning_button = nullptr; - Label *line_and_col_txt; + Label *line_and_col_txt = nullptr; - Label *info; - Timer *idle; - Timer *code_complete_timer; + Label *info = nullptr; + Timer *idle = nullptr; + Timer *code_complete_timer = nullptr; - Timer *font_resize_timer; + Timer *font_resize_timer = nullptr; int font_resize_val; real_t font_size; - Label *error; + Label *error = nullptr; int error_line; int error_column; @@ -166,7 +166,7 @@ class CodeTextEditor : public VBoxContainer { void _update_text_editor_theme(); void _complete_request(); - Ref<Texture2D> _get_completion_icon(const ScriptCodeCompletionOption &p_option); + Ref<Texture2D> _get_completion_icon(const ScriptLanguage::CodeCompletionOption &p_option); void _font_resize_timeout(); bool _add_font_size(int p_delta); @@ -181,7 +181,7 @@ class CodeTextEditor : public VBoxContainer { Color completion_string_color; Color completion_comment_color; CodeTextEditorCodeCompleteFunc code_complete_func; - void *code_complete_ud; + void *code_complete_ud = nullptr; void _error_button_pressed(); void _warning_button_pressed(); @@ -189,13 +189,15 @@ class CodeTextEditor : public VBoxContainer { void _set_show_warnings_panel(bool p_show); void _error_pressed(const Ref<InputEvent> &p_event); + void _update_status_bar_theme(); + void _delete_line(int p_line); void _toggle_scripts_pressed(); protected: virtual void _load_theme_settings() {} virtual void _validate_script() {} - virtual void _code_complete_script(const String &p_code, List<ScriptCodeCompletionOption> *r_options) {} + virtual void _code_complete_script(const String &p_code, List<ScriptLanguage::CodeCompletionOption> *r_options) {} void _text_changed_idle_timeout(); void _code_complete_timer_timeout(); @@ -204,8 +206,8 @@ protected: void _notification(int); static void _bind_methods(); - bool is_warnings_panel_opened; - bool is_errors_panel_opened; + bool is_warnings_panel_opened = false; + bool is_errors_panel_opened = false; public: void trim_trailing_whitespace(); |