diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2012-03-22 22:39:19 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-13 22:40:45 +0100 |
commit | ce83bbe3db755828faea0490ede53f8889ba0254 (patch) | |
tree | a59f99c0e31fbbc0d8b5500710e55af2f40b17e7 /src/menu/drawable_control.hpp | |
parent | 3d6a2c963c24212a0650f6dce5c1a47899f0e387 (diff) | |
download | usdx-ce83bbe3db755828faea0490ede53f8889ba0254.tar.gz usdx-ce83bbe3db755828faea0490ede53f8889ba0254.tar.xz usdx-ce83bbe3db755828faea0490ede53f8889ba0254.zip |
menu/drawable_control: added size to controls and clip drawing if requested
if requested (set_clipping_required) DrawableControl will use
ClippingHelper to setup glScissor befor drawing the content. container
will request clipping by default
Diffstat (limited to '')
-rw-r--r-- | src/menu/drawable_control.hpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/menu/drawable_control.hpp b/src/menu/drawable_control.hpp index e954f291..64bd5a24 100644 --- a/src/menu/drawable_control.hpp +++ b/src/menu/drawable_control.hpp @@ -34,6 +34,7 @@ #include "drawable.hpp" #include "control.hpp" #include "utils/point.hpp" +#include "utils/dimension.hpp" namespace usdx { @@ -45,8 +46,14 @@ namespace usdx static log4cpp::Category& log; Point<int> position; + Dimension<int> size; + + bool clipping_required; boost::mutex position_mutex; + boost::mutex size_mutex; + boost::mutex clipping_required_mutex; + protected: Container* parent; @@ -61,6 +68,9 @@ namespace usdx }; DrawableControl(Container*, const ContainerHelper&); + bool get_clipping_required(void) const; + void set_clipping_required(const bool); + public: DrawableControl(Container*); virtual ~DrawableControl(); @@ -73,6 +83,13 @@ namespace usdx const Point<int>& get_position(void) const; int get_left(void) const; int get_top(void) const; + + void set_size(const Dimension<int>& size); + void set_size(int width, int height); + + const Dimension<int>& get_size(void) const; + int get_width(void) const; + int get_height(void) const; }; }; |