From d86a71f79afe0e4dac768f61d6bff690567aca5b Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 24 May 2020 01:40:02 +0800 Subject: ... --- include/cru/ui/LayoutControl.hpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 include/cru/ui/LayoutControl.hpp (limited to 'include/cru/ui/LayoutControl.hpp') diff --git a/include/cru/ui/LayoutControl.hpp b/include/cru/ui/LayoutControl.hpp new file mode 100644 index 00000000..7997b37e --- /dev/null +++ b/include/cru/ui/LayoutControl.hpp @@ -0,0 +1,31 @@ +#pragma once +#include "Control.hpp" + +namespace cru::ui { +class LayoutControl : public Control { + protected: + LayoutControl() = default; + + public: + LayoutControl(const LayoutControl& other) = delete; + LayoutControl(LayoutControl&& other) = delete; + LayoutControl& operator=(const LayoutControl& other) = delete; + LayoutControl& operator=(LayoutControl&& other) = delete; + ~LayoutControl() override; + + const std::vector& GetChildren() const override final { + return children_; + } + + void AddChild(Control* control, Index position); + + void RemoveChild(Index position); + + protected: + virtual void OnAddChild(Control* child, Index position); + virtual void OnRemoveChild(Control* child, Index position); + + private: + std::vector children_; +}; +} // namespace cru::ui -- cgit v1.2.3