Przeglądaj źródła

Fixed render target properties so they are updated properly
Ensured that editor widget containers have a parent window assigned even when part of a dock manager

Marko Pintera 11 lat temu
rodzic
commit
291d0bb7bd

+ 5 - 0
BansheeCore/Include/BsRenderTarget.h

@@ -103,6 +103,11 @@ namespace BansheeEngine
 		 */
 		 */
 		bool requiresTextureFlipping() const { return mRequiresTextureFlipping; }
 		bool requiresTextureFlipping() const { return mRequiresTextureFlipping; }
 
 
+		/**
+		 * @brief	Copies all data from the provided object to this object.
+		 */
+		virtual void copyFrom(const RenderTargetProperties& other);
+
 	protected:
 	protected:
 		friend class RenderTargetCore;
 		friend class RenderTargetCore;
 		friend class RenderTarget;
 		friend class RenderTarget;

+ 5 - 0
BansheeCore/Include/BsRenderTexture.h

@@ -23,6 +23,11 @@ namespace BansheeEngine
 	public:
 	public:
 		virtual ~RenderTextureProperties() { }
 		virtual ~RenderTextureProperties() { }
 
 
+		/**
+		 * @copydoc	RenderTargetProperties::copyFrom
+		 */
+		virtual void copyFrom(const RenderTargetProperties& other);
+
 	private:
 	private:
 		friend class RenderTextureCore;
 		friend class RenderTextureCore;
 		friend class RenderTexture;
 		friend class RenderTexture;

+ 5 - 0
BansheeCore/Include/BsRenderWindow.h

@@ -90,6 +90,11 @@ namespace BansheeEngine
 		 */
 		 */
 		bool isHidden() const { return mHidden; }
 		bool isHidden() const { return mHidden; }
 
 
+		/**
+		 * @copydoc	RenderTargetProperties::copyFrom
+		 */
+		virtual void copyFrom(const RenderTargetProperties& other);
+
 	protected:
 	protected:
 		friend class RenderWindowCore;
 		friend class RenderWindowCore;
 		friend class RenderWindow;
 		friend class RenderWindow;

+ 5 - 0
BansheeCore/Source/BsRenderTarget.cpp

@@ -7,6 +7,11 @@
 
 
 namespace BansheeEngine 
 namespace BansheeEngine 
 {
 {
+	void RenderTargetProperties::copyFrom(const RenderTargetProperties& other)
+	{
+		*this = other;
+	}
+
 	RenderTargetCore::RenderTargetCore(RenderTarget* parent, RenderTargetProperties* properties)
 	RenderTargetCore::RenderTargetCore(RenderTarget* parent, RenderTargetProperties* properties)
 		:mProperties(properties), mParent(parent)
 		:mProperties(properties), mParent(parent)
 	{
 	{

+ 4 - 2
BansheeCore/Source/BsRenderTargetManager.cpp

@@ -1,6 +1,8 @@
 #include "BsRenderTargetManager.h"
 #include "BsRenderTargetManager.h"
 #include "BsRenderTarget.h"
 #include "BsRenderTarget.h"
 
 
+#include "BsRenderWindow.h"
+
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
 	RenderTargetManager::~RenderTargetManager()
 	RenderTargetManager::~RenderTargetManager()
@@ -44,7 +46,7 @@ namespace BansheeEngine
 
 
 			if (rt->getCore()->_isCoreDirty())
 			if (rt->getCore()->_isCoreDirty())
 			{
 			{
-				*rtData.properties = rt->getCore()->getProperties();
+				rtData.properties->copyFrom(rt->getCore()->getProperties());
 				rtData.dirty = true;
 				rtData.dirty = true;
 
 
 				rt->getCore()->_markCoreClean();
 				rt->getCore()->_markCoreClean();
@@ -63,7 +65,7 @@ namespace BansheeEngine
 
 
 			if (rtData.dirty)
 			if (rtData.dirty)
 			{
 			{
-				*rt->mProperties = *rtData.properties;
+				rt->mProperties->copyFrom(*rtData.properties);
 
 
 				rtData.dirty = false;
 				rtData.dirty = false;
 			}
 			}

+ 7 - 0
BansheeCore/Source/BsRenderTexture.cpp

@@ -8,6 +8,13 @@
 
 
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
+	void RenderTextureProperties::copyFrom(const RenderTargetProperties& other)
+	{
+		const RenderTextureProperties& windowProps = static_cast<const RenderTextureProperties&>(other);
+
+		*this = windowProps;
+	}
+
 	RenderTextureCore::RenderTextureCore(RenderTexture* parent, RenderTextureProperties* properties, const RENDER_SURFACE_DESC& colorSurfaceDesc,
 	RenderTextureCore::RenderTextureCore(RenderTexture* parent, RenderTextureProperties* properties, const RENDER_SURFACE_DESC& colorSurfaceDesc,
 		const RENDER_SURFACE_DESC& depthStencilSurfaceDesc)
 		const RENDER_SURFACE_DESC& depthStencilSurfaceDesc)
 		:RenderTargetCore(parent, properties), mColorSurface(nullptr), mDepthStencilSurface(nullptr)
 		:RenderTargetCore(parent, properties), mColorSurface(nullptr), mDepthStencilSurface(nullptr)

+ 7 - 0
BansheeCore/Source/BsRenderWindow.cpp

@@ -6,6 +6,13 @@
 
 
 namespace BansheeEngine 
 namespace BansheeEngine 
 {
 {
+	void RenderWindowProperties::copyFrom(const RenderTargetProperties& other)
+	{
+		const RenderWindowProperties& windowProps = static_cast<const RenderWindowProperties&>(other);
+
+		*this = windowProps;
+	}
+
 	RenderWindowCore::RenderWindowCore(RenderWindow* parent, RenderWindowProperties* properties)
 	RenderWindowCore::RenderWindowCore(RenderWindow* parent, RenderWindowProperties* properties)
 		:RenderTargetCore(parent, properties)
 		:RenderTargetCore(parent, properties)
 	{
 	{

+ 4 - 4
BansheeEditor/Include/BsDockManager.h

@@ -22,7 +22,7 @@ namespace BansheeEngine
 			~DockContainer();
 			~DockContainer();
 
 
 			void setArea(INT32 x, INT32 y, UINT32 width, UINT32 height);
 			void setArea(INT32 x, INT32 y, UINT32 width, UINT32 height);
-			void makeLeaf(GUIWidget* widgetParent, RenderWindow* parentWindow);
+			void makeLeaf(GUIWidget* widgetParent, EditorWindowBase* parentWindow);
 			void makeLeaf(EditorWidgetContainer* existingContainer);
 			void makeLeaf(EditorWidgetContainer* existingContainer);
 			void splitContainer(bool horizontal, bool newChildIsFirst, float splitPosition = 0.5f);
 			void splitContainer(bool horizontal, bool newChildIsFirst, float splitPosition = 0.5f);
 			void makeSplit(GUIWidget* widgetParent, DockManager::DockContainer* first, DockManager::DockContainer* second, bool horizontal, float splitPosition);
 			void makeSplit(GUIWidget* widgetParent, DockManager::DockContainer* first, DockManager::DockContainer* second, bool horizontal, float splitPosition);
@@ -78,7 +78,7 @@ namespace BansheeEngine
 			None
 			None
 		};
 		};
 	public:
 	public:
-		static DockManager* create(RenderWindow* parentWindow);
+		static DockManager* create(EditorWindowBase* parentWindow);
 
 
 		/**
 		/**
 		 * @brief	Internal method. Called once every frame.
 		 * @brief	Internal method. Called once every frame.
@@ -101,12 +101,12 @@ namespace BansheeEngine
 		void updateClippedBounds();
 		void updateClippedBounds();
 
 
 	private:
 	private:
-		DockManager(RenderWindow* parentWindow, const GUILayoutOptions& layoutOptions);
+		DockManager(EditorWindowBase* parentWindow, const GUILayoutOptions& layoutOptions);
 
 
 		static const Color TINT_COLOR;
 		static const Color TINT_COLOR;
 		static const Color HIGHLIGHT_COLOR;
 		static const Color HIGHLIGHT_COLOR;
 
 
-		RenderWindow* mParentWindow;
+		EditorWindowBase* mParentWindow;
 		DockContainer mRootContainer;
 		DockContainer mRootContainer;
 		Rect2I mArea;
 		Rect2I mArea;
 
 

+ 3 - 3
BansheeEditor/Include/BsEditorWidgetContainer.h

@@ -8,7 +8,7 @@ namespace BansheeEngine
 	class BS_ED_EXPORT EditorWidgetContainer
 	class BS_ED_EXPORT EditorWidgetContainer
 	{
 	{
 	public:
 	public:
-		EditorWidgetContainer(GUIWidget* parent, RenderWindow* renderWindow, EditorWindow* parentEditorWindow);
+		EditorWidgetContainer(GUIWidget* parent, EditorWindowBase* parentEditorWindow);
 		virtual ~EditorWidgetContainer();
 		virtual ~EditorWidgetContainer();
 
 
 		void add(EditorWidgetBase& widget);
 		void add(EditorWidgetBase& widget);
@@ -23,7 +23,7 @@ namespace BansheeEngine
 		EditorWidgetBase* getWidget(UINT32 idx) const;
 		EditorWidgetBase* getWidget(UINT32 idx) const;
 		EditorWidgetBase* getActiveWidget() const;
 		EditorWidgetBase* getActiveWidget() const;
 		GUIWidget& getParentWidget() const { return *mParent; }
 		GUIWidget& getParentWidget() const { return *mParent; }
-		EditorWindow* getParentWindow() const { return mParentWindow; }
+		EditorWindowBase* getParentWindow() const { return mParentWindow; }
 
 
 		Rect2I getContentBounds() const;
 		Rect2I getContentBounds() const;
 		Vector<Rect2I> getDraggableAreas() const;
 		Vector<Rect2I> getDraggableAreas() const;
@@ -34,7 +34,7 @@ namespace BansheeEngine
 
 
 		Event<void()> onWidgetClosed;
 		Event<void()> onWidgetClosed;
 	private:
 	private:
-		EditorWindow* mParentWindow;
+		EditorWindowBase* mParentWindow;
 		GUITabbedTitleBar* mTitleBar;
 		GUITabbedTitleBar* mTitleBar;
 		GUIArea* mTitleBarArea;
 		GUIArea* mTitleBarArea;
 		GUIWidget* mParent;
 		GUIWidget* mParent;

+ 5 - 0
BansheeEditor/Include/BsEditorWindowBase.h

@@ -22,6 +22,11 @@ namespace BansheeEngine
 		virtual void close();
 		virtual void close();
 		void hide();
 		void hide();
 
 
+		/**
+		 * @brief	Return true if this is the main editor window.
+		 */
+		virtual bool isMain() const { return false; }
+
 		/**
 		/**
 		 * @brief	Called once every frame. Internal method.
 		 * @brief	Called once every frame. Internal method.
 		 */
 		 */

+ 3 - 5
BansheeEditor/Include/BsGUITabbedTitleBar.h

@@ -12,11 +12,10 @@ namespace BansheeEngine
 	public:
 	public:
 		static const String& getGUITypeName();
 		static const String& getGUITypeName();
 
 
-		static GUITabbedTitleBar* create(RenderWindow* parentWindow,
-			const String& backgroundStyle = StringUtil::BLANK, const String& tabBtnStyle = StringUtil::BLANK, 
+		static GUITabbedTitleBar* create(const String& backgroundStyle = StringUtil::BLANK, const String& tabBtnStyle = StringUtil::BLANK, 
 			const String& minBtnStyle = StringUtil::BLANK, const String& closeBtnStyle = StringUtil::BLANK);
 			const String& minBtnStyle = StringUtil::BLANK, const String& closeBtnStyle = StringUtil::BLANK);
 
 
-		static GUITabbedTitleBar* create(RenderWindow* parentWindow, const GUILayoutOptions& layoutOptions, 
+		static GUITabbedTitleBar* create(const GUILayoutOptions& layoutOptions, 
 			const String& backgroundStyle = StringUtil::BLANK, const String& tabBtnStyle = StringUtil::BLANK, 
 			const String& backgroundStyle = StringUtil::BLANK, const String& tabBtnStyle = StringUtil::BLANK, 
 			const String& minBtnStyle = StringUtil::BLANK, const String& closeBtnStyle = StringUtil::BLANK);
 			const String& minBtnStyle = StringUtil::BLANK, const String& closeBtnStyle = StringUtil::BLANK);
 
 
@@ -53,7 +52,6 @@ namespace BansheeEngine
 		GUIButton* mMinBtn;
 		GUIButton* mMinBtn;
 		GUIButton* mCloseBtn;
 		GUIButton* mCloseBtn;
 		GUIToggleGroupPtr mTabToggleGroup;
 		GUIToggleGroupPtr mTabToggleGroup;
-		RenderWindow* mParentWindow;
 
 
 		EditorWidgetBase* mTempDraggedWidget;
 		EditorWidgetBase* mTempDraggedWidget;
 		UINT32 mTempDraggedTabIdx;
 		UINT32 mTempDraggedTabIdx;
@@ -68,7 +66,7 @@ namespace BansheeEngine
 		String mMinimizeBtnStyle;
 		String mMinimizeBtnStyle;
 		String mTabBtnStyle;
 		String mTabBtnStyle;
 
 
-		GUITabbedTitleBar(RenderWindow* parentWindow, const String& backgroundStyle, const String& tabBtnStyle, 
+		GUITabbedTitleBar(const String& backgroundStyle, const String& tabBtnStyle, 
 			const String& minBtnStyle, const String& closeBtnStyle, const GUILayoutOptions& layoutOptions);
 			const String& minBtnStyle, const String& closeBtnStyle, const GUILayoutOptions& layoutOptions);
 
 
 		virtual bool mouseEvent(const GUIMouseEvent& ev);
 		virtual bool mouseEvent(const GUIMouseEvent& ev);

+ 5 - 0
BansheeEditor/Include/BsMainEditorWindow.h

@@ -12,6 +12,11 @@ namespace BansheeEngine
 
 
 		void update();
 		void update();
 
 
+		/**
+		 * @copydoc	EditorWindowBase::isMain
+		 */
+		virtual bool isMain() const { return true; }
+
 		DockManager& getDockManager() const { return *mDockManager; }
 		DockManager& getDockManager() const { return *mDockManager; }
 
 
 		static MainEditorWindow* create(const RenderWindowPtr& renderWindow);
 		static MainEditorWindow* create(const RenderWindowPtr& renderWindow);

+ 7 - 6
BansheeEditor/Source/BsDockManager.cpp

@@ -22,6 +22,7 @@
 #include "BsGUISkin.h"
 #include "BsGUISkin.h"
 #include "BsBuiltinResources.h"
 #include "BsBuiltinResources.h"
 #include "BsDockManagerLayout.h"
 #include "BsDockManagerLayout.h"
+#include "BsEditorWindow.h"
 
 
 #include "BsGUISkin.h"
 #include "BsGUISkin.h"
 #include "BsGUIButton.h"
 #include "BsGUIButton.h"
@@ -132,10 +133,10 @@ namespace BansheeEngine
 		}
 		}
 	}
 	}
 
 
-	void DockManager::DockContainer::makeLeaf(GUIWidget* widgetParent, RenderWindow* parentWindow)
+	void DockManager::DockContainer::makeLeaf(GUIWidget* widgetParent, EditorWindowBase* parentWindow)
 	{
 	{
 		mIsLeaf = true;
 		mIsLeaf = true;
-		mWidgets = bs_new<EditorWidgetContainer>(widgetParent, parentWindow, nullptr);
+		mWidgets = bs_new<EditorWidgetContainer>(widgetParent, parentWindow);
 
 
 		mWidgets->onWidgetClosed.connect(std::bind(&DockManager::DockContainer::widgetRemoved, this));
 		mWidgets->onWidgetClosed.connect(std::bind(&DockManager::DockContainer::widgetRemoved, this));
 
 
@@ -407,9 +408,9 @@ namespace BansheeEngine
 		}
 		}
 	}
 	}
 
 
-	DockManager::DockManager(RenderWindow* parentWindow, const GUILayoutOptions& layoutOptions)
-		:GUIElementContainer(layoutOptions), mParentWindow(parentWindow), mMouseOverContainer(nullptr), mHighlightedDropLoc(DockLocation::None),
-		mShowOverlay(false), mRootContainer(this)
+	DockManager::DockManager(EditorWindowBase* parentWindow, const GUILayoutOptions& layoutOptions)
+		:GUIElementContainer(layoutOptions), mMouseOverContainer(nullptr), mHighlightedDropLoc(DockLocation::None),
+		mShowOverlay(false), mRootContainer(this), mParentWindow(parentWindow)
 	{
 	{
 		mTopDropPolygon = bs_newN<Vector2>(4);
 		mTopDropPolygon = bs_newN<Vector2>(4);
 		mBotDropPolygon = bs_newN<Vector2>(4);
 		mBotDropPolygon = bs_newN<Vector2>(4);
@@ -431,7 +432,7 @@ namespace BansheeEngine
 		bs_deleteN(mRightDropPolygon, 4);
 		bs_deleteN(mRightDropPolygon, 4);
 	}
 	}
 
 
-	DockManager* DockManager::create(RenderWindow* parentWindow)
+	DockManager* DockManager::create(EditorWindowBase* parentWindow)
 	{
 	{
 		return new (bs_alloc<DockManager, PoolAlloc>()) DockManager(parentWindow, GUILayoutOptions::create());
 		return new (bs_alloc<DockManager, PoolAlloc>()) DockManager(parentWindow, GUILayoutOptions::create());
 	}
 	}

+ 2 - 2
BansheeEditor/Source/BsEditorWidget.cpp

@@ -66,7 +66,7 @@ namespace BansheeEngine
 
 
 	Vector2I EditorWidgetBase::screenToWidgetPos(const Vector2I& screenPos) const
 	Vector2I EditorWidgetBase::screenToWidgetPos(const Vector2I& screenPos) const
 	{
 	{
-		EditorWindow* parentEditorWindow = mParent->getParentWindow();
+		EditorWindowBase* parentEditorWindow = mParent->getParentWindow();
 		RenderWindowPtr parentRenderWindow = parentEditorWindow->_getRenderWindow();
 		RenderWindowPtr parentRenderWindow = parentEditorWindow->_getRenderWindow();
 
 
 		Vector2I windowPos = parentRenderWindow->screenToWindowPos(screenPos);
 		Vector2I windowPos = parentRenderWindow->screenToWindowPos(screenPos);
@@ -78,7 +78,7 @@ namespace BansheeEngine
 
 
 	Vector2I EditorWidgetBase::widgetToScreenPos(const Vector2I& widgetPos) const
 	Vector2I EditorWidgetBase::widgetToScreenPos(const Vector2I& widgetPos) const
 	{
 	{
-		EditorWindow* parentEditorWindow = mParent->getParentWindow();
+		EditorWindowBase* parentEditorWindow = mParent->getParentWindow();
 		RenderWindowPtr parentRenderWindow = parentEditorWindow->_getRenderWindow();
 		RenderWindowPtr parentRenderWindow = parentEditorWindow->_getRenderWindow();
 
 
 		Vector2I windowPos = widgetPos;
 		Vector2I windowPos = widgetPos;

+ 2 - 2
BansheeEditor/Source/BsEditorWidgetContainer.cpp

@@ -16,13 +16,13 @@ namespace BansheeEngine
 {
 {
 	const UINT32 EditorWidgetContainer::TitleBarHeight = 13;
 	const UINT32 EditorWidgetContainer::TitleBarHeight = 13;
 
 
-	EditorWidgetContainer::EditorWidgetContainer(GUIWidget* parent, RenderWindow* renderWindow, EditorWindow* parentEditorWindow)
+	EditorWidgetContainer::EditorWidgetContainer(GUIWidget* parent, EditorWindowBase* parentEditorWindow)
 		:mParent(parent), mX(0), mY(0), mWidth(0), mHeight(0), mTitleBar(nullptr), mActiveWidget(-1),
 		:mParent(parent), mX(0), mY(0), mWidth(0), mHeight(0), mTitleBar(nullptr), mActiveWidget(-1),
 		mTitleBarArea(nullptr), mParentWindow(parentEditorWindow)
 		mTitleBarArea(nullptr), mParentWindow(parentEditorWindow)
 	{
 	{
 		mTitleBarArea = GUIArea::create(*parent, 0, 0, 0, 0, 9900);
 		mTitleBarArea = GUIArea::create(*parent, 0, 0, 0, 0, 9900);
 
 
-		mTitleBar = GUITabbedTitleBar::create(renderWindow);
+		mTitleBar = GUITabbedTitleBar::create();
 		mTitleBar->onTabActivated.connect(std::bind(&EditorWidgetContainer::tabActivated, this, _1));
 		mTitleBar->onTabActivated.connect(std::bind(&EditorWidgetContainer::tabActivated, this, _1));
 		mTitleBar->onTabClosed.connect(std::bind(&EditorWidgetContainer::tabClosed, this, _1));
 		mTitleBar->onTabClosed.connect(std::bind(&EditorWidgetContainer::tabClosed, this, _1));
 		mTitleBar->onTabDraggedOff.connect(std::bind(&EditorWidgetContainer::tabDraggedOff, this, _1));
 		mTitleBar->onTabDraggedOff.connect(std::bind(&EditorWidgetContainer::tabDraggedOff, this, _1));

+ 3 - 10
BansheeEditor/Source/BsEditorWidgetManager.cpp

@@ -152,8 +152,8 @@ namespace BansheeEngine
 
 
 			entry.widgetNames = GetWidgetNamesInContainer(widgetContainer);
 			entry.widgetNames = GetWidgetNamesInContainer(widgetContainer);
 
 
-			EditorWindow* parentWindow = widgetContainer->getParentWindow();
-			entry.isDocked = parentWindow == nullptr;
+			EditorWindowBase* parentWindow = widgetContainer->getParentWindow();
+			entry.isDocked = parentWindow->isMain(); // Assumed widget is docked if part of main window
 			
 			
 			if(!entry.isDocked)
 			if(!entry.isDocked)
 			{
 			{
@@ -218,14 +218,7 @@ namespace BansheeEngine
 		{
 		{
 			EditorWidgetBase* widget = widgetData.second;
 			EditorWidgetBase* widget = widgetData.second;
 			EditorWidgetContainer* parentContainer = widget->_getParent();
 			EditorWidgetContainer* parentContainer = widget->_getParent();
-			EditorWindow* parentWindow = parentContainer->getParentWindow();
-
-			if (parentWindow == nullptr)
-			{
-				widget->_setHasFocus(false);
-				continue;
-			}
-
+			EditorWindowBase* parentWindow = parentContainer->getParentWindow();
 			RenderWindowPtr parentRenderWindow = parentWindow->_getRenderWindow();
 			RenderWindowPtr parentRenderWindow = parentWindow->_getRenderWindow();
 			const RenderWindowProperties& props = parentRenderWindow->getProperties();
 			const RenderWindowProperties& props = parentRenderWindow->getProperties();
 
 

+ 1 - 1
BansheeEditor/Source/BsEditorWindow.cpp

@@ -6,7 +6,7 @@
 namespace BansheeEngine
 namespace BansheeEngine
 {
 {
 	EditorWindow::EditorWindow()
 	EditorWindow::EditorWindow()
-		:EditorWindowBase(), mWidgets(bs_new<EditorWidgetContainer>(mGUI.get(), mRenderWindow.get(), this))
+		:EditorWindowBase(), mWidgets(bs_new<EditorWidgetContainer>(mGUI.get(), this))
 	{
 	{
 		updateSize();
 		updateSize();
 		
 		

+ 8 - 8
BansheeEditor/Source/BsGUITabbedTitleBar.cpp

@@ -21,9 +21,9 @@ namespace BansheeEngine
 	const UINT32 GUITabbedTitleBar::TAB_SPACING = 20;
 	const UINT32 GUITabbedTitleBar::TAB_SPACING = 20;
 	const UINT32 GUITabbedTitleBar::OPTION_BTN_SPACING = 3;
 	const UINT32 GUITabbedTitleBar::OPTION_BTN_SPACING = 3;
 
 
-	GUITabbedTitleBar::GUITabbedTitleBar(RenderWindow* parentWindow, const String& backgroundStyle, const String& tabBtnStyle, 
+	GUITabbedTitleBar::GUITabbedTitleBar(const String& backgroundStyle, const String& tabBtnStyle, 
 		const String& minBtnStyle, const String& closeBtnStyle, const GUILayoutOptions& layoutOptions)
 		const String& minBtnStyle, const String& closeBtnStyle, const GUILayoutOptions& layoutOptions)
-		:GUIElementContainer(layoutOptions), mParentWindow(parentWindow), mMinBtn(nullptr), 
+		:GUIElementContainer(layoutOptions), mMinBtn(nullptr), 
 		mCloseBtn(nullptr), mBackgroundImage(nullptr), mUniqueTabIdx(0), mActiveTabIdx(0),
 		mCloseBtn(nullptr), mBackgroundImage(nullptr), mUniqueTabIdx(0), mActiveTabIdx(0),
 		mDragInProgress(false), mDraggedBtn(nullptr), mDragBtnOffset(0), mInitialDragOffset(0), mBackgroundStyle(backgroundStyle),
 		mDragInProgress(false), mDraggedBtn(nullptr), mDragBtnOffset(0), mInitialDragOffset(0), mBackgroundStyle(backgroundStyle),
 		mTabBtnStyle(tabBtnStyle), mMinimizeBtnStyle(minBtnStyle), mCloseBtnStyle(closeBtnStyle), mTempDraggedWidget(nullptr),
 		mTabBtnStyle(tabBtnStyle), mMinimizeBtnStyle(minBtnStyle), mCloseBtnStyle(closeBtnStyle), mTempDraggedWidget(nullptr),
@@ -60,17 +60,17 @@ namespace BansheeEngine
 
 
 	}
 	}
 
 
-	GUITabbedTitleBar* GUITabbedTitleBar::create(RenderWindow* parentWindow, const String& backgroundStyle, 
-		const String& tabBtnStyle, const String& minBtnStyle, const String& closeBtnStyle)
+	GUITabbedTitleBar* GUITabbedTitleBar::create(const String& backgroundStyle, const String& tabBtnStyle, 
+		const String& minBtnStyle, const String& closeBtnStyle)
 	{
 	{
-		return new (bs_alloc<GUITabbedTitleBar, PoolAlloc>()) GUITabbedTitleBar(parentWindow, backgroundStyle, tabBtnStyle, 
+		return new (bs_alloc<GUITabbedTitleBar, PoolAlloc>()) GUITabbedTitleBar(backgroundStyle, tabBtnStyle, 
 			minBtnStyle, closeBtnStyle, GUILayoutOptions::create());
 			minBtnStyle, closeBtnStyle, GUILayoutOptions::create());
 	}
 	}
 
 
-	GUITabbedTitleBar* GUITabbedTitleBar::create(RenderWindow* parentWindow, const GUILayoutOptions& layoutOptions, 
-		const String& backgroundStyle, const String& tabBtnStyle, const String& minBtnStyle, const String& closeBtnStyle)
+	GUITabbedTitleBar* GUITabbedTitleBar::create(const GUILayoutOptions& layoutOptions, const String& backgroundStyle, 
+		const String& tabBtnStyle, const String& minBtnStyle, const String& closeBtnStyle)
 	{
 	{
-		return new (bs_alloc<GUITabbedTitleBar, PoolAlloc>()) GUITabbedTitleBar(parentWindow, backgroundStyle, tabBtnStyle, 
+		return new (bs_alloc<GUITabbedTitleBar, PoolAlloc>()) GUITabbedTitleBar(backgroundStyle, tabBtnStyle, 
 			minBtnStyle, closeBtnStyle, layoutOptions);
 			minBtnStyle, closeBtnStyle, layoutOptions);
 	}
 	}
 
 

+ 1 - 1
BansheeEditor/Source/BsMainEditorWindow.cpp

@@ -33,7 +33,7 @@ namespace BansheeEngine
 		:EditorWindowBase(renderWindow), mDockManager(nullptr), 
 		:EditorWindowBase(renderWindow), mDockManager(nullptr), 
 		mMenuBar(bs_new<GUIMenuBar>(mGUI.get(), mRenderWindow.get()))
 		mMenuBar(bs_new<GUIMenuBar>(mGUI.get(), mRenderWindow.get()))
 	{
 	{
-		mDockManager = DockManager::create(mRenderWindow.get());
+		mDockManager = DockManager::create(this);
 
 
 		GUIArea* dockArea = GUIArea::createStretchedXY(*mGUI.get(), 0, 0, 0, 0);
 		GUIArea* dockArea = GUIArea::createStretchedXY(*mGUI.get(), 0, 0, 0, 0);
 		dockArea->getLayout().addElement(mDockManager);
 		dockArea->getLayout().addElement(mDockManager);