From e0e9997a5e92ce2a31f0ff4d139109be4434105b Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Wed, 11 Apr 2012 21:19:48 +0200 Subject: menu: generalized frame_background to background background could now be a background for all DrawableControl instances each subclass should call the parents draw() during executing the draw() method for background painting TODO: background should know the size of the control to only draw the background there --- src/menu/drawable_control.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/menu/drawable_control.hpp') diff --git a/src/menu/drawable_control.hpp b/src/menu/drawable_control.hpp index 261f0514..fa1fdd4d 100644 --- a/src/menu/drawable_control.hpp +++ b/src/menu/drawable_control.hpp @@ -35,6 +35,7 @@ #include "control.hpp" #include "utils/point.hpp" #include "utils/dimension.hpp" +#include "background.hpp" namespace usdx { @@ -50,9 +51,12 @@ namespace usdx bool clipping_required; + Background* background; + boost::mutex position_mutex; boost::mutex size_mutex; boost::mutex clipping_required_mutex; + boost::mutex background_mutex; protected: Container* parent; @@ -71,6 +75,8 @@ namespace usdx bool get_clipping_required(void) const; void set_clipping_required(const bool); + virtual void draw(void); + public: DrawableControl(Container*); virtual ~DrawableControl(); @@ -92,6 +98,9 @@ namespace usdx int get_height(void) const; void remove_parent(void); + + void set_background(Background*); + const Background* get_background(void) const; }; }; -- cgit v1.2.3