CGUIModalScreen.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // Copyright (C) 2002-2012 Nikolaus Gebhardt
  2. // This file is part of the "Irrlicht Engine".
  3. // For conditions of distribution and use, see copyright notice in irrlicht.h
  4. #ifndef __C_GUI_MODAL_SCREEN_H_INCLUDED__
  5. #define __C_GUI_MODAL_SCREEN_H_INCLUDED__
  6. #include "IrrCompileConfig.h"
  7. #ifdef _IRR_COMPILE_WITH_GUI_
  8. #include "IGUIElement.h"
  9. namespace irr
  10. {
  11. namespace gui
  12. {
  13. class CGUIModalScreen : public IGUIElement
  14. {
  15. public:
  16. //! constructor
  17. CGUIModalScreen(IGUIEnvironment* environment, IGUIElement* parent, s32 id);
  18. //! called if an event happened.
  19. virtual bool OnEvent(const SEvent& event);
  20. //! Removes a child.
  21. virtual void removeChild(IGUIElement* child);
  22. //! Adds a child
  23. virtual void addChild(IGUIElement* child);
  24. //! draws the element and its children
  25. virtual void draw();
  26. //! Updates the absolute position.
  27. virtual void updateAbsolutePosition();
  28. //! Modalscreen is not a typical element, but rather acts like a state for it's children.
  29. //! isVisible is overriden to give this a useful behavior, so that a modal will no longer
  30. //! be active when its parent is invisible or all its children are invisible.
  31. virtual bool isVisible() const;
  32. //! Modals are infinite so every point is inside
  33. virtual bool isPointInside(const core::position2d<s32>& point) const;
  34. //! Writes attributes of the element.
  35. virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
  36. //! Reads attributes of the element
  37. virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
  38. protected:
  39. virtual bool canTakeFocus(IGUIElement* target) const;
  40. private:
  41. u32 MouseDownTime;
  42. };
  43. } // end namespace gui
  44. } // end namespace irr
  45. #endif // _IRR_COMPILE_WITH_GUI_
  46. #endif