diff options
author | crupest <crupest@outlook.com> | 2018-09-25 13:37:33 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2018-09-25 13:37:33 +0800 |
commit | ccbc293c0158d4450c0db344474193f17925403f (patch) | |
tree | 1ecde3132b3299ab2f272f541a76bced67f983b1 /src/ui/controls/text_block.h | |
parent | 184c3b2b39d3fa34f9349a7d7fbebe49bc62f7fc (diff) | |
parent | ea4b0966d8eb5a8e76dfbe4d833a07a4797a3284 (diff) | |
download | cru-ccbc293c0158d4450c0db344474193f17925403f.tar.gz cru-ccbc293c0158d4450c0db344474193f17925403f.tar.bz2 cru-ccbc293c0158d4450c0db344474193f17925403f.zip |
Merge branch 'master' into issue4-dev
Diffstat (limited to 'src/ui/controls/text_block.h')
-rw-r--r-- | src/ui/controls/text_block.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/ui/controls/text_block.h b/src/ui/controls/text_block.h new file mode 100644 index 00000000..c307fd2f --- /dev/null +++ b/src/ui/controls/text_block.h @@ -0,0 +1,38 @@ +#pragma once + +#include "text_control.h" + +namespace cru +{ + namespace ui + { + namespace controls + { + class TextBlock : public TextControl + { + public: + 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; + } + + 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; + }; + } + } +} |