From b94a00786454968a1cc309b01180292b114da4bd Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Wed, 22 Dec 2010 03:33:58 +0200 Subject: some work-in-progress --- src/guiPauseMenu.h | 61 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 14 deletions(-) (limited to 'src/guiPauseMenu.h') diff --git a/src/guiPauseMenu.h b/src/guiPauseMenu.h index 28ac02bc9..f26a26149 100644 --- a/src/guiPauseMenu.h +++ b/src/guiPauseMenu.h @@ -23,31 +23,64 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifndef GUIPAUSEMENU_HEADER #define GUIPAUSEMENU_HEADER -#include -using namespace irr; +#include "common_irrlicht.h" -class guiPauseMenu : public IEventReceiver +class GUIPauseMenu : public gui::IGUIElement { -private: - IrrlichtDevice *dev; - gui::IGUIEnvironment *guienv; - IEventReceiver *oldRecv; +public: + GUIPauseMenu(gui::IGUIEnvironment* env, + gui::IGUIElement* parent, s32 id, + IrrlichtDevice *dev); + ~GUIPauseMenu(); + + /* + Remove and re-add (or reposition) stuff + */ + void resizeGui(); - gui::IGUIStaticText *root; + void draw(); - bool loadMenu(); - void scaleGui(); - void scaleGui(gui::IGUIElement *node,float factorX,float factorY); + void launch() + { + setVisible(true); + Environment->setFocus(this); + } + + bool canTakeFocus(gui::IGUIElement *e) + { + return (e && (e == this || isMyChild(e))); + } + + bool OnEvent(const SEvent& event); + +private: + IrrlichtDevice *m_dev; + v2u32 m_screensize_old; +}; + +/*class GUIPauseMenu : public IEventReceiver +{ public: - guiPauseMenu(IrrlichtDevice *device,IEventReceiver *recv); + void scaleGui(); + + GUIPauseMenu(IrrlichtDevice *device,IEventReceiver *recv); + ~GUIPauseMenu(void); void setVisible(bool visible){root->setVisible(visible);}; bool isVisible(){return root->isVisible();}; bool OnEvent(const SEvent& event); - ~guiPauseMenu(void); -}; +private: + bool loadMenu(); + void scaleGui(gui::IGUIElement *node,float factorX,float factorY); + + IrrlichtDevice *dev; + gui::IGUIEnvironment *guienv; + IEventReceiver *oldRecv; + + gui::IGUIStaticText *root; +};*/ #endif -- cgit v1.2.3