From 7e490e72139fbfe12535c71b27228dd82ef0250b Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Thu, 23 Dec 2010 17:09:49 +0200 Subject: work-in-progress gui system updating + some settings system updating --- src/modalMenu.h | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'src/modalMenu.h') diff --git a/src/modalMenu.h b/src/modalMenu.h index 3706d86dc..e2e8b29f6 100644 --- a/src/modalMenu.h +++ b/src/modalMenu.h @@ -22,7 +22,11 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "common_irrlicht.h" -//TODO: Change GUIElement private +/* + Remember to drop() the menu after creating, so that it can + remove itself when it wants to. +*/ + class GUIModalMenu : public gui::IGUIElement { public: @@ -50,18 +54,6 @@ public: return (e && (e == this || isMyChild(e))) || m_allow_focus_removal; } - void quitMenu() - { - m_allow_focus_removal = true; - // This removes Environment's grab on us - Environment->removeFocus(this); - this->remove(); - } - - virtual void regenerateGui(v2u32 screensize) = 0; - - virtual void drawMenu() = 0; - void draw() { if(!IsVisible) @@ -78,10 +70,25 @@ public: drawMenu(); } + /* + This should be called when the menu wants to quit + */ + void quitMenu() + { + m_allow_focus_removal = true; + // This removes Environment's grab on us + Environment->removeFocus(this); + this->remove(); + } + + virtual void regenerateGui(v2u32 screensize) = 0; + virtual void drawMenu() = 0; virtual bool OnEvent(const SEvent& event) { return false; }; private: int *m_active_menu_count; + // This might be necessary to expose to the implementation if it + // wants to launch other menus bool m_allow_focus_removal; v2u32 m_screensize_old; }; -- cgit v1.2.3