CGUIMessageBox.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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_MESSAGE_BOX_H_INCLUDED__
  5. #define __C_GUI_MESSAGE_BOX_H_INCLUDED__
  6. #include "IrrCompileConfig.h"
  7. #ifdef _IRR_COMPILE_WITH_GUI_
  8. #include "CGUIWindow.h"
  9. #include "IGUIStaticText.h"
  10. #include "IGUIImage.h"
  11. #include "irrArray.h"
  12. namespace irr
  13. {
  14. namespace gui
  15. {
  16. class CGUIMessageBox : public CGUIWindow
  17. {
  18. public:
  19. //! constructor
  20. CGUIMessageBox(IGUIEnvironment* environment, const wchar_t* caption,
  21. const wchar_t* text, s32 flag,
  22. IGUIElement* parent, s32 id, core::rect<s32> rectangle, video::ITexture* image=0);
  23. //! destructor
  24. virtual ~CGUIMessageBox();
  25. //! called if an event happened.
  26. virtual bool OnEvent(const SEvent& event);
  27. //! Writes attributes of the element.
  28. virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options) const;
  29. //! Reads attributes of the element
  30. virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
  31. private:
  32. void refreshControls();
  33. void setButton(IGUIButton*& button, bool isAvailable, const core::rect<s32> & btnRect, const wchar_t * text, IGUIElement*& focusMe);
  34. IGUIButton* OkButton;
  35. IGUIButton* CancelButton;
  36. IGUIButton* YesButton;
  37. IGUIButton* NoButton;
  38. IGUIStaticText* StaticText;
  39. IGUIImage * Icon;
  40. video::ITexture * IconTexture;
  41. s32 Flags;
  42. core::stringw MessageText;
  43. bool Pressed;
  44. };
  45. } // end namespace gui
  46. } // end namespace irr
  47. #endif // _IRR_COMPILE_WITH_GUI_
  48. #endif