BsEditorWindowBase.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsEvent.h"
  4. namespace BansheeEngine
  5. {
  6. class 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. protected:
  31. EditorWindowBase();
  32. EditorWindowBase(const RenderWindowPtr& renderWindow);
  33. RenderWindowPtr mRenderWindow;
  34. HSceneObject mSceneObject;
  35. HGUIWidget mGUI;
  36. HCamera mCamera;
  37. GameObjectHandle<WindowFrameWidget> mWindowFrame;
  38. bool mOwnsRenderWindow;
  39. void construct(const RenderWindowPtr& renderWindow);
  40. virtual void initialize();
  41. virtual void resized() { }
  42. private:
  43. HEvent mResizedConn;
  44. };
  45. }