diff options
author | crupest <crupest@outlook.com> | 2022-02-12 18:17:52 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-02-12 18:17:52 +0800 |
commit | b7946e28a08c945e26d39f095d2e55c952a936c4 (patch) | |
tree | 1e3df327fd8d36c88aa9840ff711545f316e3129 /src/theme_builder/components/properties/PointPropertyEditor.h | |
parent | 2fd37d41bb804a06acc8e2d341d5ce5d8370184b (diff) | |
download | cru-b7946e28a08c945e26d39f095d2e55c952a936c4.tar.gz cru-b7946e28a08c945e26d39f095d2e55c952a936c4.tar.bz2 cru-b7946e28a08c945e26d39f095d2e55c952a936c4.zip |
...
Diffstat (limited to 'src/theme_builder/components/properties/PointPropertyEditor.h')
-rw-r--r-- | src/theme_builder/components/properties/PointPropertyEditor.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/theme_builder/components/properties/PointPropertyEditor.h b/src/theme_builder/components/properties/PointPropertyEditor.h new file mode 100644 index 00000000..8588d77c --- /dev/null +++ b/src/theme_builder/components/properties/PointPropertyEditor.h @@ -0,0 +1,32 @@ +#pragma once +#include "cru/ui/components/Component.h" +#include "cru/ui/controls/FlexLayout.h" +#include "cru/ui/controls/TextBlock.h" +#include "cru/ui/controls/TextBox.h" + +namespace cru::theme_builder::components::properties { +class PointPropertyEditor : public ui::components::Component { + public: + PointPropertyEditor(); + ~PointPropertyEditor() override; + + public: + ui::Point GetPoint() const { return point_; } + void SetPoint(const ui::Point& point); + + IEvent<ui::Point>* PointChangeEvent() { return &point_change_event_; } + + private: + static String ConvertPointToString(const ui::Point& point); + + private: + ui::Point point_; + + ui::controls::FlexLayout container_; + ui::controls::TextBlock label_; + ui::controls::TextBox text_; + bool is_text_valid_; + + Event<ui::Point> point_change_event_; +}; +} // namespace cru::theme_builder::components::properties |