diff options
author | reduz <reduzio@gmail.com> | 2014-04-17 10:33:53 -0300 |
---|---|---|
committer | reduz <reduzio@gmail.com> | 2014-04-17 10:33:53 -0300 |
commit | b8593c6f3fd4726584e56e684c9ebb5a8147ff0c (patch) | |
tree | 22e6598f5f3cc838485bdacfc6550efa89488be4 /scene/gui | |
parent | ec4ef2d2e794819548d731f93728266d31261d71 (diff) | |
parent | a49527540f0f6fc563e72839b766f7ba5c823170 (diff) |
Merge pull request #301 from jonyrock/editor_cursor
Text cursor in text editor
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/text_edit.cpp | 9 | ||||
-rw-r--r-- | scene/gui/text_edit.h | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 3e4c04873a..d84e9956ba 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -47,7 +47,6 @@ #define TAB_PIXELS - static bool _is_text_char(CharType c) { return (c>='a' && c<='z') || (c>='A' && c<='Z') || (c>='0' && c<='9') || c=='_'; @@ -2038,6 +2037,14 @@ void TextEdit::insert_text_at_cursor(const String& p_text) { } +Control::CursorShape TextEdit::get_cursor_shape(const Point2& p_pos) const { + if(completion_active && completion_rect.has_point(p_pos)) { + return CURSOR_ARROW; + } + return CURSOR_IBEAM; +} + + void TextEdit::set_text(String p_text){ setting_text=true; diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 5826c84c80..c3bb5823e7 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -280,6 +280,8 @@ public: SEARCH_WHOLE_WORDS=2, SEARCH_BACKWARDS=4 }; + + virtual CursorShape get_cursor_shape(const Point2& p_pos=Point2i()) const; //void delete_char(); //void delete_line(); |