BsEditorWidgetContainer.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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);
  10. virtual ~EditorWidgetContainer();
  11. void add(EditorWidget& widget);
  12. void remove(EditorWidget& widget);
  13. void move(EditorWidget& widget, CM::UINT32 newPosition);
  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. void _notifyWidgetDestroyed(EditorWidget* widget);
  19. boost::signal<void()> onWidgetClosed;
  20. private:
  21. GUITabbedTitleBar* mTitleBar;
  22. BS::GUIWidget* mParent;
  23. CM::INT32 mX, mY;
  24. CM::UINT32 mWidth, mHeight;
  25. CM::Vector<EditorWidget*>::type mWidgets;
  26. CM::INT32 mActiveWidget;
  27. static const CM::UINT32 TitleBarHeight;
  28. void setActiveWidget(CM::UINT32 idx);
  29. void tabActivated(CM::UINT32 idx);
  30. void tabClosed(CM::UINT32 idx);
  31. };
  32. }