BsEditorWindowBase.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsEvent.h"
  4. namespace BansheeEngine
  5. {
  6. class BS_ED_EXPORT EditorWindowBase
  7. {
  8. public:
  9. virtual ~EditorWindowBase();
  10. virtual void setPosition(INT32 x, INT32 y);
  11. virtual void setSize(UINT32 width, UINT32 height);
  12. INT32 getLeft() const;
  13. INT32 getTop() const;
  14. UINT32 getWidth() const;
  15. UINT32 getHeight() const;
  16. virtual void close();
  17. void hide();
  18. /**
  19. * @brief Return true if this is the main editor window.
  20. */
  21. virtual bool isMain() const { return false; }
  22. /**
  23. * @brief Called once every frame. Internal method.
  24. */
  25. virtual void update() { }
  26. /**
  27. * @brief Returns the render window that this editor window is being rendered to.
  28. */
  29. RenderWindowPtr getRenderWindow() const { return mRenderWindow; }
  30. /**
  31. * @brief Returns the GUI widget used for displaying all GUI contents in the window.
  32. */
  33. HGUIWidget getGUIWidget() const { return mGUI; }
  34. protected:
  35. EditorWindowBase(bool isModal = false);
  36. EditorWindowBase(const RenderWindowPtr& renderWindow);
  37. RenderWindowPtr mRenderWindow;
  38. HSceneObject mSceneObject;
  39. HGUIWidget mGUI;
  40. HCamera mCamera;
  41. GameObjectHandle<WindowFrameWidget> mWindowFrame;
  42. bool mOwnsRenderWindow;
  43. bool mIsModal;
  44. void construct(const RenderWindowPtr& renderWindow);
  45. virtual void initialize();
  46. virtual void resized() { }
  47. private:
  48. HEvent mResizedConn;
  49. };
  50. }