Add ui::container_impl::clear
This commit is contained in:
parent
6c4c0d8305
commit
65a924dc69
2 changed files with 11 additions and 0 deletions
|
|
@ -28,6 +28,8 @@ namespace psemek::ui
|
||||||
std::shared_ptr<element> remove(element * c);
|
std::shared_ptr<element> remove(element * c);
|
||||||
std::shared_ptr<element> remove(std::size_t index);
|
std::shared_ptr<element> remove(std::size_t index);
|
||||||
|
|
||||||
|
void clear();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
element * parent_;
|
element * parent_;
|
||||||
std::vector<std::shared_ptr<element>> children_;
|
std::vector<std::shared_ptr<element>> children_;
|
||||||
|
|
|
||||||
|
|
@ -82,4 +82,13 @@ namespace psemek::ui
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void container_impl::clear()
|
||||||
|
{
|
||||||
|
for (std::size_t i = 0; i < children_.size(); ++i)
|
||||||
|
remove(i);
|
||||||
|
|
||||||
|
children_.clear();
|
||||||
|
children_range_.clear();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue