aboutsummaryrefslogtreecommitdiff
path: root/src/ui/LayoutControl.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-03-24 19:14:19 +0800
committercrupest <crupest@outlook.com>2021-03-24 19:14:19 +0800
commit7f15a1ff9a2007e119798053083a0a87d042990a (patch)
treecb35c01a7eaee867376d959b96c9bbd15df939e5 /src/ui/LayoutControl.cpp
parent74956951ee663012df0c3fe4ebe29799cb2f7732 (diff)
parent7703063a5816b089483e78ccd74bb9902ccfbea8 (diff)
downloadcru-7f15a1ff9a2007e119798053083a0a87d042990a.tar.gz
cru-7f15a1ff9a2007e119798053083a0a87d042990a.tar.bz2
cru-7f15a1ff9a2007e119798053083a0a87d042990a.zip
Merge branch 'master' of https://github.com/crupest/CruUI
Diffstat (limited to 'src/ui/LayoutControl.cpp')
-rw-r--r--src/ui/LayoutControl.cpp53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/ui/LayoutControl.cpp b/src/ui/LayoutControl.cpp
deleted file mode 100644
index 4813566b..00000000
--- a/src/ui/LayoutControl.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-#include "cru/ui/LayoutControl.hpp"
-
-#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<Window*>(control)); // Can't add a window as child.
- Expects(position >= 0);
- Expects(position <=
- static_cast<Index>(
- this->children_.size())); // The position is out of range.
-
- children_.insert(this->children_.cbegin() + position, control);
-
- control->_SetParent(this);
- control->_SetDescendantUiHost(GetUiHost());
-
- OnAddChild(control, position);
-}
-
-void LayoutControl::RemoveChild(const Index position) {
- Expects(position >= 0);
- Expects(position <
- static_cast<Index>(
- 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->_SetDescendantUiHost(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