IGUIWindow.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 __I_GUI_WINDOW_H_INCLUDED__
  5. #define __I_GUI_WINDOW_H_INCLUDED__
  6. #include "IGUIElement.h"
  7. #include "EMessageBoxFlags.h"
  8. namespace irr
  9. {
  10. namespace gui
  11. {
  12. class IGUIButton;
  13. //! Default moveable window GUI element with border, caption and close icons.
  14. /** \par This element can create the following events of type EGUI_EVENT_TYPE:
  15. \li EGET_ELEMENT_CLOSED
  16. */
  17. class IGUIWindow : public IGUIElement
  18. {
  19. public:
  20. //! constructor
  21. IGUIWindow(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
  22. : IGUIElement(EGUIET_WINDOW, environment, parent, id, rectangle) {}
  23. //! Returns pointer to the close button
  24. /** You can hide the button by calling setVisible(false) on the result. */
  25. virtual IGUIButton* getCloseButton() const = 0;
  26. //! Returns pointer to the minimize button
  27. /** You can hide the button by calling setVisible(false) on the result. */
  28. virtual IGUIButton* getMinimizeButton() const = 0;
  29. //! Returns pointer to the maximize button
  30. /** You can hide the button by calling setVisible(false) on the result. */
  31. virtual IGUIButton* getMaximizeButton() const = 0;
  32. //! Returns true if the window can be dragged with the mouse, false if not
  33. virtual bool isDraggable() const = 0;
  34. //! Sets whether the window can be dragged by the mouse
  35. virtual void setDraggable(bool draggable) = 0;
  36. //! Set if the window background will be drawn
  37. virtual void setDrawBackground(bool draw) = 0;
  38. //! Get if the window background will be drawn
  39. virtual bool getDrawBackground() const = 0;
  40. //! Set if the window titlebar will be drawn
  41. //! Note: If the background is not drawn, then the titlebar is automatically also not drawn
  42. virtual void setDrawTitlebar(bool draw) = 0;
  43. //! Get if the window titlebar will be drawn
  44. virtual bool getDrawTitlebar() const = 0;
  45. //! Returns the rectangle of the drawable area (without border and without titlebar)
  46. /** The coordinates are given relative to the top-left position of the gui element.<br>
  47. So to get absolute positions you have to add the resulting rectangle to getAbsolutePosition().UpperLeftCorner.<br>
  48. To get it relative to the parent element you have to add the resulting rectangle to getRelativePosition().UpperLeftCorner.
  49. Beware that adding a menu will not change the clientRect as menus are own gui elements, so in that case you might want to subtract
  50. the menu area additionally. */
  51. virtual core::rect<s32> getClientRect() const = 0;
  52. };
  53. } // end namespace gui
  54. } // end namespace irr
  55. #endif