Merge pull request #12862 from YeldhamDev/text_property

Made text in TextEdit a property
This commit is contained in:
Rémi Verschelde 2017-11-12 21:15:29 +01:00 committed by GitHub
commit 81fb6e474f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -465,6 +465,9 @@
</method> </method>
</methods> </methods>
<members> <members>
<member name="text" type="String" setter="set_text" getter="get_text">
String value of the [TextEdit].
</member>
<member name="readonly" type="bool" setter="set_readonly" getter="is_readonly"> <member name="readonly" type="bool" setter="set_readonly" getter="is_readonly">
If [code]true[/code] read-only mode is enabled. Existing text cannot be modified and new text cannot be added. If [code]true[/code] read-only mode is enabled. Existing text cannot be modified and new text cannot be added.
</member> </member>

View file

@ -4971,6 +4971,7 @@ void TextEdit::_bind_methods() {
ClassDB::bind_method(D_METHOD("menu_option", "option"), &TextEdit::menu_option); ClassDB::bind_method(D_METHOD("menu_option", "option"), &TextEdit::menu_option);
ClassDB::bind_method(D_METHOD("get_menu"), &TextEdit::get_menu); ClassDB::bind_method(D_METHOD("get_menu"), &TextEdit::get_menu);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "text", PROPERTY_HINT_MULTILINE_TEXT), "set_text", "get_text");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "readonly"), "set_readonly", "is_readonly"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "readonly"), "set_readonly", "is_readonly");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "highlight_current_line"), "set_highlight_current_line", "is_highlight_current_line_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "highlight_current_line"), "set_highlight_current_line", "is_highlight_current_line_enabled");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "syntax_highlighting"), "set_syntax_coloring", "is_syntax_coloring_enabled"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "syntax_highlighting"), "set_syntax_coloring", "is_syntax_coloring_enabled");