aboutsummaryrefslogtreecommitdiff
path: root/CruUI/ui/controls/text_block.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-09-13 22:47:22 +0800
committercrupest <crupest@outlook.com>2018-09-13 22:47:22 +0800
commit9f6803884704e277fe49ed046344ddaa44a7fd19 (patch)
tree4b7f2c2e6db2f71e44633c3b10128243be95d2a0 /CruUI/ui/controls/text_block.cpp
parent5f35ba198582bb93e16d34c8d94ffdc8f453068d (diff)
downloadcru-9f6803884704e277fe49ed046344ddaa44a7fd19.tar.gz
cru-9f6803884704e277fe49ed046344ddaa44a7fd19.tar.bz2
cru-9f6803884704e277fe49ed046344ddaa44a7fd19.zip
...
Diffstat (limited to 'CruUI/ui/controls/text_block.cpp')
-rw-r--r--CruUI/ui/controls/text_block.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/CruUI/ui/controls/text_block.cpp b/CruUI/ui/controls/text_block.cpp
index 132bd3e7..04166f32 100644
--- a/CruUI/ui/controls/text_block.cpp
+++ b/CruUI/ui/controls/text_block.cpp
@@ -25,7 +25,14 @@ namespace cru
}
TextBlock::TextBlock(const Microsoft::WRL::ComPtr<IDWriteTextFormat>& init_text_format,
- const Microsoft::WRL::ComPtr<ID2D1Brush>& init_brush) : Control(false)
+ const Microsoft::WRL::ComPtr<ID2D1Brush>& init_brush) : Control(false),
+ window_deactivated_handler_(new events::UiEvent::EventHandler([this](events::UiEvent::ArgsType& args)
+ {
+ if (is_selecting_)
+ {
+ is_selecting_ = false;
+ }
+ }))
{
text_format_ = init_text_format;
if (init_brush == nullptr)
@@ -59,6 +66,19 @@ namespace cru
Repaint();
}
+ void TextBlock::OnAttachToWindow(Window* window)
+ {
+ window->deactivated_event.AddHandler([](auto args)
+ {
+
+ });
+ }
+
+ void TextBlock::OnDetachToWindow(Window* window)
+ {
+
+ }
+
void TextBlock::OnSizeChangedCore(events::SizeChangedEventArgs& args)
{
text_layout_->SetMaxWidth(args.GetNewSize().width);