summaryrefslogtreecommitdiff
path: root/editor/code_editor.h
diff options
context:
space:
mode:
Diffstat (limited to 'editor/code_editor.h')
-rw-r--r--editor/code_editor.h34
1 files changed, 18 insertions, 16 deletions
diff --git a/editor/code_editor.h b/editor/code_editor.h
index d806be885f..e201da446e 100644
--- a/editor/code_editor.h
+++ b/editor/code_editor.h
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
+/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -34,10 +34,9 @@
#include "editor/editor_plugin.h"
#include "scene/gui/check_box.h"
#include "scene/gui/check_button.h"
+#include "scene/gui/code_edit.h"
#include "scene/gui/dialogs.h"
#include "scene/gui/line_edit.h"
-#include "scene/gui/text_edit.h"
-#include "scene/gui/tool_button.h"
#include "scene/main/timer.h"
class GotoLineDialog : public ConfirmationDialog {
@@ -46,15 +45,15 @@ class GotoLineDialog : public ConfirmationDialog {
Label *line_label;
LineEdit *line;
- TextEdit *text_editor;
+ CodeEdit *text_editor;
- virtual void ok_pressed();
+ virtual void ok_pressed() override;
public:
- void popup_find_line(TextEdit *p_edit);
+ void popup_find_line(CodeEdit *p_edit);
int get_line() const;
- void set_text_editor(TextEdit *p_text_editor);
+ void set_text_editor(CodeEdit *p_text_editor);
GotoLineDialog();
};
@@ -63,8 +62,8 @@ class FindReplaceBar : public HBoxContainer {
LineEdit *search_text;
Label *matches_label;
- ToolButton *find_prev;
- ToolButton *find_next;
+ Button *find_prev;
+ Button *find_next;
CheckBox *case_sensitive;
CheckBox *whole_words;
TextureButton *hide_button;
@@ -78,7 +77,7 @@ class FindReplaceBar : public HBoxContainer {
HBoxContainer *hbc_button_replace;
HBoxContainer *hbc_option_replace;
- TextEdit *text_edit;
+ CodeEdit *text_editor;
int result_line;
int result_col;
@@ -121,7 +120,7 @@ public:
bool is_selection_only() const;
void set_error(const String &p_label);
- void set_text_edit(TextEdit *p_text_edit);
+ void set_text_edit(CodeEdit *p_text_edit);
void popup_search(bool p_show_only = false);
void popup_replace();
@@ -138,12 +137,12 @@ typedef void (*CodeTextEditorCodeCompleteFunc)(void *p_ud, const String &p_code,
class CodeTextEditor : public VBoxContainer {
GDCLASS(CodeTextEditor, VBoxContainer);
- TextEdit *text_editor;
+ CodeEdit *text_editor;
FindReplaceBar *find_replace_bar;
HBoxContainer *status_bar;
- ToolButton *toggle_scripts_button;
- ToolButton *warning_button;
+ Button *toggle_scripts_button;
+ Button *warning_button;
Label *warning_count_label;
Label *line_and_col_txt;
@@ -175,6 +174,9 @@ class CodeTextEditor : public VBoxContainer {
void _zoom_changed();
void _reset_zoom();
+ Color completion_font_color;
+ Color completion_string_color;
+ Color completion_comment_color;
CodeTextEditorCodeCompleteFunc code_complete_func;
void *code_complete_ud;
@@ -238,7 +240,7 @@ public:
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; }
+ CodeEdit *get_text_editor() { return text_editor; }
FindReplaceBar *get_find_replace_bar() { return find_replace_bar; }
virtual void apply_code() {}
void goto_error();