diff options
author | crupest <crupest@outlook.com> | 2020-03-04 21:49:05 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-03-04 21:49:05 +0800 |
commit | abf604f8c6ec89c8d7df7062fe10fd17c60d5719 (patch) | |
tree | 82347efc2bef1966c0f1562d4467b7c389366ef9 /include/cru/ui | |
parent | 79ba10135987cffc31496e8515c5372146d9b31d (diff) | |
download | cru-abf604f8c6ec89c8d7df7062fe10fd17c60d5719.tar.gz cru-abf604f8c6ec89c8d7df7062fe10fd17c60d5719.tar.bz2 cru-abf604f8c6ec89c8d7df7062fe10fd17c60d5719.zip |
...
Diffstat (limited to 'include/cru/ui')
-rw-r--r-- | include/cru/ui/controls/text_common.hpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/cru/ui/controls/text_common.hpp b/include/cru/ui/controls/text_common.hpp index 7398764f..fbef6b06 100644 --- a/include/cru/ui/controls/text_common.hpp +++ b/include/cru/ui/controls/text_common.hpp @@ -33,6 +33,9 @@ class TextControlService : public Object { ~TextControlService(); public: + bool IsEnabled() { return enable_; } + void SetEnabled(bool enable); + int GetCaretPosition() { return caret_position_; } void SetCaretPosition(int position) { caret_position_ = position; } @@ -43,16 +46,30 @@ class TextControlService : public Object { void DrawCaret(platform::graph::IPainter* painter); private: + void AbortSelection(); + void SetupCaretTimer(); void TearDownCaretTimer(); + void SetupHandlers(); + + void MouseMoveHandler(event::MouseEventArgs& args); + void MouseDownHandler(event::MouseButtonEventArgs& args); + void MouseUpHandler(event::MouseButtonEventArgs& args); + void LoseFocusHandler(event::FocusChangeEventArgs& args); + private: Control* control_; ITextControl* text_control_; std::vector<EventRevokerGuard> event_revoker_guards_; + bool enable_ = false; + bool caret_visible_ = false; int caret_position_ = 0; +#ifdef CRU_DEBUG + bool caret_timer_set_ = false; +#endif unsigned long caret_timer_tag_; // this is used for blinking of caret bool caret_show_ = true; |