diff options
author | crupest <crupest@outlook.com> | 2018-09-12 23:09:13 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2018-09-12 23:09:13 +0800 |
commit | 5f75c4f4f6736ff8efa87beab715fd9a044f666c (patch) | |
tree | a67dd8d9f6af0ff7b93776c1e3bcc2816a2250dd /CruUI/ui/controls/text_block.h | |
parent | e2dab3893a8be43de0e50587c85df9e11abf87fe (diff) | |
download | cru-5f75c4f4f6736ff8efa87beab715fd9a044f666c.tar.gz cru-5f75c4f4f6736ff8efa87beab715fd9a044f666c.tar.bz2 cru-5f75c4f4f6736ff8efa87beab715fd9a044f666c.zip |
...
Never use PostMessage with hwnd as null!!!!!!!!!!!!!!!!!!!!!!!!
Diffstat (limited to 'CruUI/ui/controls/text_block.h')
-rw-r--r-- | CruUI/ui/controls/text_block.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/CruUI/ui/controls/text_block.h b/CruUI/ui/controls/text_block.h index d6d173ba..1d1166a5 100644 --- a/CruUI/ui/controls/text_block.h +++ b/CruUI/ui/controls/text_block.h @@ -102,6 +102,7 @@ namespace cru void OnMouseDownCore(events::MouseButtonEventArgs& args) override; void OnMouseMoveCore(events::MouseEventArgs& args) override; + void OnMouseUpCore(events::MouseButtonEventArgs& args) override; Size OnMeasure(const Size& available_size) override; @@ -116,15 +117,16 @@ namespace cru String text_; Microsoft::WRL::ComPtr<ID2D1Brush> brush_; + Microsoft::WRL::ComPtr<ID2D1Brush> selection_brush_; Microsoft::WRL::ComPtr<IDWriteTextFormat> text_format_; Microsoft::WRL::ComPtr<IDWriteTextLayout> text_layout_; Vector<std::shared_ptr<TextLayoutHandler>> text_layout_handlers_; - unsigned mouse_down_position_; - std::optional<TextRange> selected_range_; + unsigned mouse_down_position_ = 0; + std::optional<TextRange> selected_range_ = std::nullopt; - bool is_mouse_down_ = false; //TODO!!! + bool is_selecting_ = false; }; } } |