aboutsummaryrefslogtreecommitdiff
path: root/CruUI/ui/controls/text_block.h
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.h
parent5f35ba198582bb93e16d34c8d94ffdc8f453068d (diff)
downloadcru-9f6803884704e277fe49ed046344ddaa44a7fd19.tar.gz
cru-9f6803884704e277fe49ed046344ddaa44a7fd19.tar.bz2
cru-9f6803884704e277fe49ed046344ddaa44a7fd19.zip
...
Diffstat (limited to 'CruUI/ui/controls/text_block.h')
-rw-r--r--CruUI/ui/controls/text_block.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/CruUI/ui/controls/text_block.h b/CruUI/ui/controls/text_block.h
index c817104e..4c1f1fb1 100644
--- a/CruUI/ui/controls/text_block.h
+++ b/CruUI/ui/controls/text_block.h
@@ -27,9 +27,9 @@ namespace cru
unsigned position;
unsigned count;
- operator DWRITE_TEXT_RANGE() const
+ explicit operator DWRITE_TEXT_RANGE() const
{
- DWRITE_TEXT_RANGE result;
+ DWRITE_TEXT_RANGE result{};
result.startPosition = position;
result.length = count;
return result;
@@ -97,6 +97,9 @@ namespace cru
}
protected:
+ void OnAttachToWindow(Window* window) override;
+ void OnDetachToWindow(Window* window) override;
+
void OnSizeChangedCore(events::SizeChangedEventArgs& args) override final;
void OnDraw(ID2D1DeviceContext* device_context) override;
@@ -130,6 +133,8 @@ namespace cru
std::optional<TextRange> selected_range_ = std::nullopt;
bool is_selecting_ = false;
+
+ events::UiEvent::EventHandlerPtr window_deactivated_handler_;
};
}
}