aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/text_block.hpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2018-11-07 21:40:04 +0800
committercrupest <crupest@outlook.com>2018-11-07 21:40:04 +0800
commitefdce672123284847bd7fb6f12ac1ec96f28f3ef (patch)
tree298e6313e9a48c5867b2355242b78d3cd23fdc61 /src/ui/controls/text_block.hpp
parent634dab6ad2c9e4675beacfb77ac02b2d43cab132 (diff)
downloadcru-efdce672123284847bd7fb6f12ac1ec96f28f3ef.tar.gz
cru-efdce672123284847bd7fb6f12ac1ec96f28f3ef.tar.bz2
cru-efdce672123284847bd7fb6f12ac1ec96f28f3ef.zip
Make all header *.hpp .
Diffstat (limited to 'src/ui/controls/text_block.hpp')
-rw-r--r--src/ui/controls/text_block.hpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/ui/controls/text_block.hpp b/src/ui/controls/text_block.hpp
new file mode 100644
index 00000000..b2b4aaf9
--- /dev/null
+++ b/src/ui/controls/text_block.hpp
@@ -0,0 +1,38 @@
+#pragma once
+
+#include "text_control.hpp"
+
+namespace cru::ui::controls
+{
+ class TextBlock : public TextControl
+ {
+ public:
+ static constexpr auto control_type = L"TextBlock";
+
+ static TextBlock* Create(
+ const String& text = L"",
+ const Microsoft::WRL::ComPtr<IDWriteTextFormat>& init_text_format = nullptr,
+ const Microsoft::WRL::ComPtr<ID2D1Brush>& init_brush = nullptr)
+ {
+ const auto text_block = new TextBlock(init_text_format, init_brush);
+ text_block->SetText(text);
+ return text_block;
+ }
+
+ using TextControl::SetSelectable; // Make this public.
+
+ protected:
+ TextBlock(
+ const Microsoft::WRL::ComPtr<IDWriteTextFormat>& init_text_format,
+ const Microsoft::WRL::ComPtr<ID2D1Brush>& init_brush
+ );
+ public:
+ TextBlock(const TextBlock& other) = delete;
+ TextBlock(TextBlock&& other) = delete;
+ TextBlock& operator=(const TextBlock& other) = delete;
+ TextBlock& operator=(TextBlock&& other) = delete;
+ ~TextBlock() override = default;
+
+ StringView GetControlType() const override final;
+ };
+}