IGUIWindow.h 2.7 KB

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