From 5f75c4f4f6736ff8efa87beab715fd9a044f666c Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 12 Sep 2018 23:09:13 +0800 Subject: ... Never use PostMessage with hwnd as null!!!!!!!!!!!!!!!!!!!!!!!! --- CruUI/ui/controls/text_block.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'CruUI/ui/controls/text_block.h') 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 brush_; + Microsoft::WRL::ComPtr selection_brush_; Microsoft::WRL::ComPtr text_format_; Microsoft::WRL::ComPtr text_layout_; Vector> text_layout_handlers_; - unsigned mouse_down_position_; - std::optional selected_range_; + unsigned mouse_down_position_ = 0; + std::optional selected_range_ = std::nullopt; - bool is_mouse_down_ = false; //TODO!!! + bool is_selecting_ = false; }; } } -- cgit v1.2.3