aboutsummaryrefslogtreecommitdiffstats
path: root/src/menu/container.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/menu/container.cpp29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/menu/container.cpp b/src/menu/container.cpp
index 3bed894e..d39ac736 100644
--- a/src/menu/container.cpp
+++ b/src/menu/container.cpp
@@ -28,32 +28,31 @@
namespace usdx
{
- Container::Container(Control* parent)
- : DrawableControl(parent)
+ Container::Container(Container* owner)
+ : DrawableControl(owner)
{
}
Container::~Container()
{
+ controls.clear();
+ }
+
+ void Container::draw(void)
+ {
for (std::list<DrawableControl*>::iterator it =
controls.begin(); it != controls.end(); it++) {
- delete *it;
+ (*it)->repaint();
}
-
- controls.clear();
}
- void Container::repaint(void)
+ void Container::add(DrawableControl *child)
{
- if (get_visible()) {
- draw();
-
- for (std::list<DrawableControl*>::const_iterator it =
- controls.begin();
- it != controls.end(); it++) {
+ controls.push_back(child);
+ }
- (*it)->repaint();
- }
- }
+ void Container::remove(DrawableControl *child)
+ {
+ controls.remove(child);
}
};