+ /*
+ This should be called when the menu wants to quit.
+
+ WARNING: THIS DEALLOCATES THE MENU FROM MEMORY. Return
+ immediately if you call this from the menu itself.
+ */
+ void quitMenu()
+ {
+ allowFocusRemoval(true);
+ // This removes Environment's grab on us
+ Environment->removeFocus(this);
+ this->remove();
+ }
+
+ void removeChildren()
+ {
+ const core::list<gui::IGUIElement*> &children = getChildren();
+ core::list<gui::IGUIElement*> children_copy;
+ for(core::list<gui::IGUIElement*>::ConstIterator
+ i = children.begin(); i != children.end(); i++)
+ {
+ children_copy.push_back(*i);
+ }
+ for(core::list<gui::IGUIElement*>::Iterator
+ i = children_copy.begin();
+ i != children_copy.end(); i++)
+ {
+ (*i)->remove();
+ }
+ }
+
+ virtual void regenerateGui(v2u32 screensize) = 0;
+ virtual void drawMenu() = 0;