diff options
author | crupest <crupest@outlook.com> | 2018-09-24 00:16:53 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2018-09-24 00:16:53 +0800 |
commit | 977c766e2337fea238804b8d8b97659361391ed0 (patch) | |
tree | ff3438e5b0517c52412cfa497d1d2a0ed314cf79 /CruUI/ui/controls/text_box.h | |
parent | be84ddd03d3b59c0c27aa538d5ef5129f94d511c (diff) | |
download | cru-977c766e2337fea238804b8d8b97659361391ed0.tar.gz cru-977c766e2337fea238804b8d8b97659361391ed0.tar.bz2 cru-977c766e2337fea238804b8d8b97659361391ed0.zip |
Develop basic function of textbox.
Diffstat (limited to 'CruUI/ui/controls/text_box.h')
-rw-r--r-- | CruUI/ui/controls/text_box.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/CruUI/ui/controls/text_box.h b/CruUI/ui/controls/text_box.h index 68235c67..5fe14782 100644 --- a/CruUI/ui/controls/text_box.h +++ b/CruUI/ui/controls/text_box.h @@ -7,6 +7,14 @@ namespace cru::ui::controls { class TextBox : public Control { + public: + static TextBox* Create( + const Microsoft::WRL::ComPtr<IDWriteTextFormat>& init_text_format = nullptr, + const Microsoft::WRL::ComPtr<ID2D1Brush>& init_brush = nullptr) + { + return new TextBox(init_text_format, init_brush); + } + protected: explicit TextBox( const Microsoft::WRL::ComPtr<IDWriteTextFormat>& init_text_format = nullptr, @@ -46,9 +54,11 @@ namespace cru::ui::controls void OnMouseDownCore(events::MouseButtonEventArgs& args) override final; - void OnGetFocusCore(events::FocusChangeEventArgs& args) override; + void OnGetFocusCore(events::FocusChangeEventArgs& args) override final; void OnLoseFocusCore(events::FocusChangeEventArgs& args) override final; + void OnCharCore(events::CharEventArgs& args) override final; + Size OnMeasure(const Size& available_size) override final; private: @@ -69,5 +79,6 @@ namespace cru::ui::controls TimerTask caret_timer_; ActionPtr caret_action_; + bool is_caret_show_; }; } |