diff options
author | crupest <crupest@outlook.com> | 2018-09-10 00:09:52 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2018-09-10 00:09:52 +0800 |
commit | aa8ba64f4f580552ba14325dd3e04f38a3c9a1de (patch) | |
tree | cde762da1a0bfb24c28a8a3dfa5253ad95a5b809 /CruUI/ui/controls/text_block.h | |
parent | 74031db4b8c366531db5be8fa8d765483ab377b0 (diff) | |
download | cru-aa8ba64f4f580552ba14325dd3e04f38a3c9a1de.tar.gz cru-aa8ba64f4f580552ba14325dd3e04f38a3c9a1de.tar.bz2 cru-aa8ba64f4f580552ba14325dd3e04f38a3c9a1de.zip |
...
Diffstat (limited to 'CruUI/ui/controls/text_block.h')
-rw-r--r-- | CruUI/ui/controls/text_block.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/CruUI/ui/controls/text_block.h b/CruUI/ui/controls/text_block.h index abf77112..04347a0c 100644 --- a/CruUI/ui/controls/text_block.h +++ b/CruUI/ui/controls/text_block.h @@ -15,11 +15,22 @@ namespace cru public: using TextLayoutHandler = Action<Microsoft::WRL::ComPtr<IDWriteTextLayout>>; + 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; + } + private: explicit TextBlock( const Microsoft::WRL::ComPtr<IDWriteTextFormat>& init_text_format = nullptr, const Microsoft::WRL::ComPtr<ID2D1Brush>& init_brush = nullptr ); + public: TextBlock(const TextBlock& other) = delete; TextBlock(TextBlock&& other) = delete; TextBlock& operator=(const TextBlock& other) = delete; |