diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2011-12-25 16:14:07 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-05 17:17:50 +0100 |
commit | fb70fe4e1a04b6041a50da7e2e76200fb18de0f9 (patch) | |
tree | 04da9da4fa8594f610bfb0f09bf5f5e900231c13 /src/menu/control.hpp | |
parent | c129094a1604f96b4a3a0ca58226e38a2a1b7cdb (diff) | |
download | usdx-fb70fe4e1a04b6041a50da7e2e76200fb18de0f9.tar.gz usdx-fb70fe4e1a04b6041a50da7e2e76200fb18de0f9.tar.xz usdx-fb70fe4e1a04b6041a50da7e2e76200fb18de0f9.zip |
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
Diffstat (limited to 'src/menu/control.hpp')
-rw-r--r-- | src/menu/control.hpp | 16 |
1 files changed, 12 insertions, 4 deletions
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 <list> + namespace usdx { class Control { private: - Control* parent; + Control* owner; + + protected: + std::list<Control*> 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; }; }; |