BsModalWindow.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsEditorWindowBase.h"
  4. namespace BansheeEngine
  5. {
  6. class BS_ED_EXPORT ModalWindow : public EditorWindowBase
  7. {
  8. public:
  9. virtual ~ModalWindow();
  10. virtual void update();
  11. virtual void close();
  12. void setTitle(const HString& title);
  13. /**
  14. * Converts screen pointer coordinates into coordinates relative to the window contents GUI panel.
  15. */
  16. Vector2I screenToWindowPos(const Vector2I& screenPos) const;
  17. /**
  18. * Converts pointer coordinates relative to the window contents GUI panel into screen coordinates.
  19. */
  20. Vector2I windowToScreenPos(const Vector2I& windowPos) const;
  21. protected:
  22. friend class EditorWindowManager;
  23. ModalWindow(const HString& title, bool hasCloseButton = false);
  24. Rect2I getContentArea() const;
  25. virtual void resized();
  26. private:
  27. void updateSize();
  28. UINT32 getTitleBarHeight() const;
  29. GUIPanel* mTitleBarPanel;
  30. GUIPanel* mTitleBarBgPanel;
  31. GUILabel* mTitle;
  32. GUIButton* mCloseButton;
  33. GUITexture* mTitleBarBg;
  34. protected:
  35. GUIPanel* mContents;
  36. };
  37. }