From efdce672123284847bd7fb6f12ac1ec96f28f3ef Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 7 Nov 2018 21:40:04 +0800 Subject: Make all header *.hpp . --- src/ui/controls/text_block.hpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/ui/controls/text_block.hpp (limited to 'src/ui/controls/text_block.hpp') 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& init_text_format = nullptr, + const Microsoft::WRL::ComPtr& 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& init_text_format, + const Microsoft::WRL::ComPtr& 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; + }; +} -- cgit v1.2.3