From fb70fe4e1a04b6041a50da7e2e76200fb18de0f9 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Sun, 25 Dec 2011 16:14:07 +0100 Subject: menu/control: controls are now owned by other controls controls could now be owned by other controls, that are responsible for destruction of their slaves --- src/menu/control.hpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/menu/control.hpp') diff --git a/src/menu/control.hpp b/src/menu/control.hpp index d0b70d4f..f105b69c 100644 --- a/src/menu/control.hpp +++ b/src/menu/control.hpp @@ -27,20 +27,28 @@ #ifndef CONTROL_HPP #define CONTROL_HPP +#include + namespace usdx { class Control { private: - Control* parent; + Control* owner; + + protected: + std::list slaves; + + void add(Control *new_slave); + void remove(Control *slave); public: - Control(Control *parent); + Control(Control *owner); virtual ~Control(); - void set_parent(Control *parent); + void set_owner(Control *owner); - Control* get_parent(void) const; + Control* get_owner(void) const; }; }; -- cgit v1.2.3