From 09e480f0c956a16751a535558b84431ea47cd38f Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 2 Sep 2018 16:25:47 +0800 Subject: ... --- CruUI/ui/controls/text_block.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 CruUI/ui/controls/text_block.h (limited to 'CruUI/ui/controls/text_block.h') diff --git a/CruUI/ui/controls/text_block.h b/CruUI/ui/controls/text_block.h new file mode 100644 index 00000000..aea4629f --- /dev/null +++ b/CruUI/ui/controls/text_block.h @@ -0,0 +1,40 @@ +#pragma once + +#include "ui/ui_base.h" +#include "ui/control.h" + +namespace cru +{ + namespace ui + { + namespace controls + { + class TextBlock : public Control + { + public: + TextBlock(); + TextBlock(const TextBlock& other) = delete; + TextBlock(TextBlock&& other) = delete; + TextBlock& operator=(const TextBlock& other) = delete; + TextBlock& operator=(TextBlock&& other) = delete; + ~TextBlock() override; + + String GetText() const + { + return text_; + } + + void SetText(const String& text); + + protected: + void OnSizeChangedCore(events::SizeChangedEventArgs& args) override final; + + private: + void OnTextChangedCore(const String& old_text, const String& new_text); + + private: + String text_; + }; + } + } +} -- cgit v1.2.3