aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/controls/TextBlock.h
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-02-10 19:49:06 +0800
committercrupest <crupest@outlook.com>2022-02-10 19:49:06 +0800
commitc1dbad5fdf0560983e6c832eddded6f610eae94e (patch)
tree40f22f7e6aa7ef39c49b1c007beed37130fc0b5d /include/cru/ui/controls/TextBlock.h
parentb2622f654598f82a220a98daaa84fed9ce3b92b2 (diff)
downloadcru-c1dbad5fdf0560983e6c832eddded6f610eae94e.tar.gz
cru-c1dbad5fdf0560983e6c832eddded6f610eae94e.tar.bz2
cru-c1dbad5fdf0560983e6c832eddded6f610eae94e.zip
...
Diffstat (limited to 'include/cru/ui/controls/TextBlock.h')
-rw-r--r--include/cru/ui/controls/TextBlock.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/cru/ui/controls/TextBlock.h b/include/cru/ui/controls/TextBlock.h
index feb5cfa3..dc47d00a 100644
--- a/include/cru/ui/controls/TextBlock.h
+++ b/include/cru/ui/controls/TextBlock.h
@@ -10,19 +10,19 @@ class CRU_UI_API TextBlock : public NoChildControl,
public:
static constexpr StringView kControlType = u"TextBlock";
- static TextBlock* Create();
- static TextBlock* Create(String text, bool selectable = false);
-
- protected:
- TextBlock();
-
public:
+ TextBlock();
TextBlock(const TextBlock& other) = delete;
TextBlock(TextBlock&& other) = delete;
TextBlock& operator=(const TextBlock& other) = delete;
TextBlock& operator=(TextBlock&& other) = delete;
~TextBlock() override;
+ TextBlock(String text, bool selectable = false) : TextBlock() {
+ SetText(std::move(text));
+ SetSelectable(selectable);
+ }
+
String GetControlType() const final { return kControlType.ToString(); }
render::RenderObject* GetRenderObject() const override;