aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/text_block.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/controls/text_block.h')
-rw-r--r--src/ui/controls/text_block.h38
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;
+ };
+ }
+ }
+}