BsEditorWindowBase.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. void construct(const RenderWindowPtr& renderWindow);
  44. virtual void initialize();
  45. virtual void resized() { }
  46. private:
  47. HEvent mResizedConn;
  48. };
  49. }