From 21385d9ecbc74425a599f8a5953bd2ec7fdd1b68 Mon Sep 17 00:00:00 2001 From: Paulb23 Date: Mon, 11 Jul 2016 15:11:35 +0100 Subject: [PATCH] Expose show line numbers --- scene/gui/text_edit.cpp | 11 ++++++++++- scene/gui/text_edit.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index a010fff2bce..ebf11b76847 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -4319,6 +4319,10 @@ void TextEdit::set_show_line_numbers(bool p_show) { update(); } +bool TextEdit::is_show_line_numbers_enabled() const { + return line_numbers; +} + void TextEdit::set_draw_breakpoint_gutter(bool p_draw) { draw_breakpoint_gutter = p_draw; update(); @@ -4433,6 +4437,9 @@ void TextEdit::_bind_methods() { ObjectTypeDB::bind_method(_MD("redo"),&TextEdit::redo); ObjectTypeDB::bind_method(_MD("clear_undo_history"),&TextEdit::clear_undo_history); + ObjectTypeDB::bind_method(_MD("set_show_line_numbers", "enable"), &TextEdit::set_show_line_numbers); + ObjectTypeDB::bind_method(_MD("is_show_line_numbers_enabled"), &TextEdit::is_show_line_numbers_enabled); + ObjectTypeDB::bind_method(_MD("set_syntax_coloring","enable"),&TextEdit::set_syntax_coloring); ObjectTypeDB::bind_method(_MD("is_syntax_coloring_enabled"),&TextEdit::is_syntax_coloring_enabled); @@ -4445,7 +4452,9 @@ void TextEdit::_bind_methods() { ObjectTypeDB::bind_method(_MD("menu_option"),&TextEdit::menu_option); ObjectTypeDB::bind_method(_MD("get_menu:PopupMenu"),&TextEdit::get_menu); - ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret/caret_blink"), _SCS("cursor_set_blink_enabled"), _SCS("cursor_get_blink_enabled"));; + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "show_line_numbers"), _SCS("set_show_line_numbers"), _SCS("is_show_line_numbers_enabled")); + + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "caret/caret_blink"), _SCS("cursor_set_blink_enabled"), _SCS("cursor_get_blink_enabled")); ADD_PROPERTYNZ(PropertyInfo(Variant::REAL, "caret/caret_blink_speed",PROPERTY_HINT_RANGE,"0.1,10,0.1"), _SCS("cursor_set_blink_speed"),_SCS("cursor_get_blink_speed") ); ADD_SIGNAL(MethodInfo("cursor_changed")); diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index fe977eba60e..55612a5e278 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -469,6 +469,7 @@ public: void menu_option(int p_option); void set_show_line_numbers(bool p_show); + bool is_show_line_numbers_enabled() const; void set_draw_breakpoint_gutter(bool p_draw); bool is_drawing_breakpoint_gutter() const;