From 962dc18ee4827b464764ec3708be3d00a9143971 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 21 Mar 2019 22:22:02 +0800 Subject: ... --- src/ui/no_child_control.hpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/ui/no_child_control.hpp (limited to 'src/ui/no_child_control.hpp') diff --git a/src/ui/no_child_control.hpp b/src/ui/no_child_control.hpp new file mode 100644 index 00000000..26b5546f --- /dev/null +++ b/src/ui/no_child_control.hpp @@ -0,0 +1,26 @@ +#pragma once +#include "pre.hpp" + +#include "control.hpp" + +namespace cru::ui { +class NoChildControl : public Control { + private: + static const std::vector empty_control_vector; + + protected: + NoChildControl() = default; + + public: + NoChildControl(const NoChildControl& other) = delete; + NoChildControl(NoChildControl&& other) = delete; + NoChildControl& operator=(const NoChildControl& other) = delete; + NoChildControl& operator=(NoChildControl&& other) = delete; + ~NoChildControl() override = default; + + protected: + const std::vector& GetChildren() const override final { + return empty_control_vector; + } +}; +} // namespace cru::ui -- cgit v1.2.3