diff options
| author | crupest <crupest@outlook.com> | 2020-05-24 01:40:02 +0800 |
|---|---|---|
| committer | crupest <crupest@outlook.com> | 2020-05-24 01:40:02 +0800 |
| commit | d86a71f79afe0e4dac768f61d6bff690567aca5b (patch) | |
| tree | 4957e9a64c77680deb07201fbd879bf036616dae /src/ui/content_control.cpp | |
| parent | f3a8fd608a9776ef0a5f547da918a32cf6074060 (diff) | |
| download | cru-d86a71f79afe0e4dac768f61d6bff690567aca5b.tar.gz cru-d86a71f79afe0e4dac768f61d6bff690567aca5b.tar.bz2 cru-d86a71f79afe0e4dac768f61d6bff690567aca5b.zip | |
...
Diffstat (limited to 'src/ui/content_control.cpp')
| -rw-r--r-- | src/ui/content_control.cpp | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/src/ui/content_control.cpp b/src/ui/content_control.cpp deleted file mode 100644 index eb13f4cb..00000000 --- a/src/ui/content_control.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "cru/ui/content_control.hpp" - -#include "cru/ui/window.hpp" - -namespace cru::ui { -ContentControl::ContentControl() - : child_vector_{nullptr}, child_(child_vector_[0]) {} - -ContentControl::~ContentControl() { delete child_; } - -void ContentControl::SetChild(Control* child) { - Expects(!dynamic_cast<Window*>(child)); // Can't add a window as child. - if (child == child_) return; - - const auto host = GetUiHost(); - const auto old_child = child_; - child_ = child; - if (old_child) { - old_child->_SetParent(nullptr); - old_child->_SetDescendantUiHost(nullptr); - } - if (child) { - child->_SetParent(this); - child->_SetDescendantUiHost(host); - } - OnChildChanged(old_child, child); -} - -void ContentControl::OnChildChanged(Control* old_child, Control* new_child) { - CRU_UNUSED(old_child) - CRU_UNUSED(new_child) -} -} // namespace cru::ui |
