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.h35
1 files changed, 21 insertions, 14 deletions
diff --git a/editor/code_editor.h b/editor/code_editor.h
index 2d233c61c6..e3dbfe1ce0 100644
--- a/editor/code_editor.h
+++ b/editor/code_editor.h
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2019 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 */
@@ -36,7 +36,6 @@
#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"
@@ -64,7 +63,6 @@ class FindReplaceBar : public HBoxContainer {
GDCLASS(FindReplaceBar, HBoxContainer);
- MarginContainer *container;
LineEdit *search_text;
ToolButton *find_prev;
ToolButton *find_next;
@@ -77,7 +75,6 @@ class FindReplaceBar : public HBoxContainer {
Button *replace_all;
CheckBox *selection_only;
- HBoxContainer *hbc;
VBoxContainer *vbc_lineedit;
HBoxContainer *hbc_button_replace;
HBoxContainer *hbc_option_replace;
@@ -143,22 +140,21 @@ class CodeTextEditor : public VBoxContainer {
TextEdit *text_editor;
FindReplaceBar *find_replace_bar;
HBoxContainer *status_bar;
- Label *warning_label;
+
+ ToolButton *warning_button;
Label *warning_count_label;
- Label *line_nb;
- Label *col_nb;
- Label *font_size_nb;
+ Label *line_and_col_txt;
+
Label *info;
Timer *idle;
Timer *code_complete_timer;
- bool enable_complete_timer;
Timer *font_resize_timer;
int font_resize_val;
real_t font_size;
- LinkButton *error;
+ Label *error;
int error_line;
int error_column;
@@ -174,11 +170,15 @@ class CodeTextEditor : public VBoxContainer {
void _zoom_out();
void _zoom_changed();
void _reset_zoom();
- void _error_pressed();
CodeTextEditorCodeCompleteFunc code_complete_func;
void *code_complete_ud;
+ void _warning_label_gui_input(const Ref<InputEvent> &p_event);
+ void _warning_button_pressed();
+ void _set_show_warnings_panel(bool p_show);
+ void _error_pressed(const Ref<InputEvent> &p_event);
+
protected:
virtual void _load_theme_settings() {}
virtual void _validate_script() {}
@@ -191,6 +191,8 @@ protected:
void _notification(int);
static void _bind_methods();
+ bool is_warnings_panel_opened;
+
public:
void trim_trailing_whitespace();
@@ -209,21 +211,26 @@ public:
void delete_lines();
void clone_lines_down();
+ /// Toggle inline comment on currently selected lines, or on current line if nothing is selected,
+ /// by adding or removing comment delimiter
+ void toggle_inline_comment(const String &delimiter);
+
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 set_warning_nb(int p_warning_nb);
+
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 goto_error();
void set_code_complete_func(CodeTextEditorCodeCompleteFunc p_code_complete_func, void *p_ud);