BsEditorWindow.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsEditorPrerequisites.h"
  5. #include "EditorWindow/BsEditorWindowBase.h"
  6. namespace bs
  7. {
  8. /** @addtogroup EditorWindow
  9. * @{
  10. */
  11. /** A draggable and resizeable window that has a single widget container you may use for docking editor widgets in. */
  12. class BS_ED_EXPORT EditorWindow : public EditorWindowBase
  13. {
  14. public:
  15. virtual ~EditorWindow();
  16. /** Returns the widget container for this window. */
  17. EditorWidgetContainer& widgets() const { return *mWidgets; }
  18. /** @copydoc EditorWindowBase::update */
  19. void update() override;
  20. /** Creates a new empty editor window. */
  21. static EditorWindow* create();
  22. protected:
  23. friend class EditorWindowManager;
  24. EditorWindow();
  25. /** @copydoc EditorWindowBase::resized */
  26. void resized() override;
  27. private:
  28. EditorWidgetContainer* mWidgets;
  29. /**
  30. * Updates the sizes of the child widget container and OS non-client areas (like drag and resize). Call when window
  31. * size changes.
  32. */
  33. void updateSize();
  34. /** Called when a widget is added to the widget container. */
  35. void widgetAdded();
  36. /** Called when a widget is removed from the widget container. */
  37. void widgetRemoved();
  38. /** Triggered when the maximize button on the title bar is clicked. */
  39. void maximizeClicked();
  40. /**
  41. * A callback that triggers when a drag and drop operation originated from this window ends.
  42. *
  43. * @note
  44. * This is a workaround to get around the problem that closing the window when the drag operation starts (for
  45. * example if the last widget is dragged from the window) will cause the application to lose mouse capture and will
  46. * not receive mouse events. Therefore we delay the window closing until the drag ends.
  47. */
  48. void closeWindowDelayed();
  49. };
  50. /** @} */
  51. }