Window.pkg 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. $#include "Window.h"
  2. /// %Window movement and resizing modes.
  3. enum WindowDragMode
  4. {
  5. DRAG_NONE,
  6. DRAG_MOVE,
  7. DRAG_RESIZE_TOPLEFT,
  8. DRAG_RESIZE_TOP,
  9. DRAG_RESIZE_TOPRIGHT,
  10. DRAG_RESIZE_RIGHT,
  11. DRAG_RESIZE_BOTTOMRIGHT,
  12. DRAG_RESIZE_BOTTOM,
  13. DRAG_RESIZE_BOTTOMLEFT,
  14. DRAG_RESIZE_LEFT
  15. };
  16. /// %Window %UI element that can optionally by moved or resized.
  17. class Window : public BorderImage
  18. {
  19. public:
  20. /// Construct.
  21. Window(Context* context);
  22. /// Destruct.
  23. virtual ~Window();
  24. /// Set whether can be moved.
  25. void SetMovable(bool enable);
  26. /// Set whether can be resized.
  27. void SetResizable(bool enable);
  28. /// Set resize area width at edges.
  29. void SetResizeBorder(const IntRect& rect);
  30. /// Set modal flag. When the modal flag is set, the focused window needs to be dismissed first to allow other UI elements to gain focus.
  31. void SetModal(bool modal);
  32. /// Set modal shade color.
  33. void SetModalShadeColor(const Color& color);
  34. /// Set modal frame color.
  35. void SetModalFrameColor(const Color& color);
  36. /// Set modal frame size.
  37. void SetModalFrameSize(const IntVector2& size);
  38. /// Return whether is movable.
  39. bool IsMovable() const { return movable_; }
  40. /// Return whether is resizable.
  41. bool IsResizable() const { return resizable_; }
  42. /// Return resize area width at edges.
  43. const IntRect& GetResizeBorder() const { return resizeBorder_; }
  44. /// Return modal flag.
  45. bool IsModal() const { return modal_; }
  46. /// Get modal shade color.
  47. const Color& GetModalShadeColor() const { return modalShadeColor_; }
  48. /// Get modal frame color.
  49. const Color& GetModalFrameColor() const { return modalFrameColor_; }
  50. /// Get modal frame size.
  51. const IntVector2& GetModalFrameSize() const { return modalFrameSize_; }
  52. };