BsEditorWidgetContainer.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include <boost/signal.hpp>
  4. namespace BansheeEditor
  5. {
  6. class EditorWidgetContainer
  7. {
  8. public:
  9. EditorWidgetContainer(BS::GUIWidget* parent, CM::RenderWindow* renderWindow);
  10. virtual ~EditorWidgetContainer();
  11. void add(EditorWidget& widget);
  12. void remove(EditorWidget& widget);
  13. void insert(CM::UINT32 idx, EditorWidget& widget);
  14. void setSize(CM::UINT32 width, CM::UINT32 height);
  15. void setPosition(CM::INT32 x, CM::INT32 y);
  16. CM::UINT32 getNumWidgets() const { return (CM::UINT32)mWidgets.size(); }
  17. BS::GUIWidget& getParentWidget() const { return *mParent; }
  18. CM::RectI getContentBounds() const;
  19. void _notifyWidgetDestroyed(EditorWidget* widget);
  20. boost::signal<void()> onWidgetClosed;
  21. private:
  22. GUITabbedTitleBar* mTitleBar;
  23. BS::GUIArea* mTitleBarArea;
  24. BS::GUIWidget* mParent;
  25. CM::INT32 mX, mY;
  26. CM::UINT32 mWidth, mHeight;
  27. CM::UnorderedMap<CM::UINT32, EditorWidget*>::type mWidgets;
  28. CM::INT32 mActiveWidget;
  29. static const CM::UINT32 TitleBarHeight;
  30. void setActiveWidget(CM::UINT32 idx);
  31. void tabActivated(CM::UINT32 idx);
  32. void tabClosed(CM::UINT32 idx);
  33. void tabDraggedOff(CM::UINT32 idx);
  34. void tabDraggedOn(CM::UINT32 idx);
  35. static void tabDroppedCallback(bool wasDragProcessed);
  36. };
  37. }