aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2010-01-27 18:58:15 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2013-01-05 17:17:46 +0100
commitde8e5cee81cae0231e31c63928c0be580a2758a8 (patch)
tree61af6bc04a17af3532e6a41b58742c2349e71050 /src
parentd7d83a499453cc2c9ce13826030002a3a35811e4 (diff)
downloadusdx-de8e5cee81cae0231e31c63928c0be580a2758a8.tar.gz
usdx-de8e5cee81cae0231e31c63928c0be580a2758a8.tar.xz
usdx-de8e5cee81cae0231e31c63928c0be580a2758a8.zip
make on_draw protected
external classes have to call draw instead of on_draw (so that visible gets evaluated)
Diffstat (limited to 'src')
-rw-r--r--src/menu/drawable.hpp11
-rw-r--r--src/menu/reflection.hpp5
2 files changed, 10 insertions, 6 deletions
diff --git a/src/menu/drawable.hpp b/src/menu/drawable.hpp
index 9cd0913e..84f9daa0 100644
--- a/src/menu/drawable.hpp
+++ b/src/menu/drawable.hpp
@@ -37,6 +37,12 @@ namespace usdx
private:
bool visible;
+ protected:
+ /**
+ * Pure virtual method, that descendant classes have to implement.
+ */
+ virtual void on_draw(void) const = 0;
+
public:
Drawable(void);
virtual ~Drawable(void) {};
@@ -47,11 +53,6 @@ namespace usdx
void draw(void) const;
/**
- * Pure virtual method, that descendant classes have to implement.
- */
- virtual void on_draw(void) const = 0;
-
- /**
* Setter for visible.
*/
virtual void set_visible(bool value);
diff --git a/src/menu/reflection.hpp b/src/menu/reflection.hpp
index 5ff75279..4681de5f 100644
--- a/src/menu/reflection.hpp
+++ b/src/menu/reflection.hpp
@@ -35,11 +35,14 @@ namespace usdx
{
private:
float spacing;
+
+ protected:
+ virtual void on_draw(void) const;
+
public:
Reflection(float spacing);
virtual ~Reflection(void);
- virtual void on_draw(void) const;
void set_spacing(float value);
const float get_spacing(void) const;