From ad313097ebcb2a0c02c956fdf74a6610c3f7c9a8 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 2 Aug 2016 19:11:05 -0300 Subject: WIP visual scripting, not working yet but you can check out stuff --- tools/editor/code_editor.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'tools/editor/code_editor.h') diff --git a/tools/editor/code_editor.h b/tools/editor/code_editor.h index 7983c46f7a..f6c3ac7564 100644 --- a/tools/editor/code_editor.h +++ b/tools/editor/code_editor.h @@ -189,6 +189,8 @@ public: }; +typedef void (*CodeTextEditorCodeCompleteFunc)(void* p_ud,const String& p_code, List* r_options); + class CodeTextEditor : public VBoxContainer { OBJ_TYPE(CodeTextEditor,VBoxContainer); @@ -218,13 +220,16 @@ class CodeTextEditor : public VBoxContainer { void _zoom_out(); void _reset_zoom(); + + CodeTextEditorCodeCompleteFunc code_complete_func; + void *code_complete_ud; + protected: - void set_error(const String& p_error); virtual void _load_theme_settings() {} - virtual void _validate_script()=0; - virtual void _code_complete_script(const String& p_code, List* r_options) {}; + virtual void _validate_script() {} + virtual void _code_complete_script(const String& p_code, List* r_options) {} void _text_changed_idle_timeout(); void _code_complete_timer_timeout(); @@ -235,10 +240,16 @@ protected: public: + void set_error(const String& p_error); + void update_line_and_column() { _line_col_changed(); } TextEdit *get_text_edit() { return text_editor; } FindReplaceBar *get_find_replace_bar() { return find_replace_bar; } virtual void apply_code() {} + + void set_code_complete_func(CodeTextEditorCodeCompleteFunc p_code_complete_func, void * p_ud); + + CodeTextEditor(); }; -- cgit v1.2.3