From de8e5cee81cae0231e31c63928c0be580a2758a8 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Wed, 27 Jan 2010 18:58:15 +0100 Subject: make on_draw protected external classes have to call draw instead of on_draw (so that visible gets evaluated) --- src/menu/drawable.hpp | 11 ++++++----- src/menu/reflection.hpp | 5 ++++- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src/menu') 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) {}; @@ -46,11 +52,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. */ 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; -- cgit v1.2.3