From 52594324b302f6e9da10ac01fe803196371bb2d9 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 29 Oct 2020 00:01:26 +0800 Subject: ... --- src/ui/LayoutControl.cpp | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) (limited to 'src/ui/LayoutControl.cpp') diff --git a/src/ui/LayoutControl.cpp b/src/ui/LayoutControl.cpp index 05fcdc4a..351026f9 100644 --- a/src/ui/LayoutControl.cpp +++ b/src/ui/LayoutControl.cpp @@ -3,51 +3,4 @@ #include "cru/ui/Window.hpp" namespace cru::ui { -LayoutControl::~LayoutControl() { - for (const auto child : children_) delete child; -} - -void LayoutControl::AddChild(Control* control, const Index position) { - Expects(control->GetParent() == - nullptr); // The control already has a parent. - Expects(!dynamic_cast(control)); // Can't add a window as child. - Expects(position >= 0); - Expects(position <= - static_cast( - this->children_.size())); // The position is out of range. - - children_.insert(this->children_.cbegin() + position, control); - - control->_SetParent(this); - control->_SetDescendantWindowHost(GetWindowHost()); - - OnAddChild(control, position); -} - -void LayoutControl::RemoveChild(const Index position) { - Expects(position >= 0); - Expects(position < - static_cast( - this->children_.size())); // The position is out of range. - - const auto i = children_.cbegin() + position; - const auto child = *i; - - children_.erase(i); - - child->_SetParent(nullptr); - child->_SetDescendantWindowHost(nullptr); - - OnRemoveChild(child, position); -} - -void LayoutControl::OnAddChild(Control* child, const Index position) { - CRU_UNUSED(child) - CRU_UNUSED(position) -} - -void LayoutControl::OnRemoveChild(Control* child, const Index position) { - CRU_UNUSED(child) - CRU_UNUSED(position) -} } // namespace cru::ui -- cgit v1.2.3