Browse Source

DragAndDropManager works (without drag texture)

Marko Pintera 12 years ago
parent
commit
bda4a8924e

+ 2 - 0
BansheeEngine/BansheeEngine.vcxproj

@@ -228,6 +228,7 @@
   <ItemGroup>
   <ItemGroup>
     <ClInclude Include="Include\BsApplication.h" />
     <ClInclude Include="Include\BsApplication.h" />
     <ClInclude Include="Include\BsDebugDraw.h" />
     <ClInclude Include="Include\BsDebugDraw.h" />
+    <ClInclude Include="Include\BsDragAndDropManager.h" />
     <ClInclude Include="Include\BsEngineGUI.h" />
     <ClInclude Include="Include\BsEngineGUI.h" />
     <ClInclude Include="Include\BsGUIArea.h" />
     <ClInclude Include="Include\BsGUIArea.h" />
     <ClInclude Include="Include\BsGUIButton.h" />
     <ClInclude Include="Include\BsGUIButton.h" />
@@ -282,6 +283,7 @@
   <ItemGroup>
   <ItemGroup>
     <ClCompile Include="Source\BsApplication.cpp" />
     <ClCompile Include="Source\BsApplication.cpp" />
     <ClCompile Include="Source\BsDebugDraw.cpp" />
     <ClCompile Include="Source\BsDebugDraw.cpp" />
+    <ClCompile Include="Source\BsDragAndDropManager.cpp" />
     <ClCompile Include="Source\BsEngineGUI.cpp" />
     <ClCompile Include="Source\BsEngineGUI.cpp" />
     <ClCompile Include="Source\BsGUIArea.cpp" />
     <ClCompile Include="Source\BsGUIArea.cpp" />
     <ClCompile Include="Source\BsGUIButton.cpp" />
     <ClCompile Include="Source\BsGUIButton.cpp" />

+ 6 - 0
BansheeEngine/BansheeEngine.vcxproj.filters

@@ -192,6 +192,9 @@
     <ClInclude Include="Include\BsGUIToggleGroup.h">
     <ClInclude Include="Include\BsGUIToggleGroup.h">
       <Filter>Header Files\GUI</Filter>
       <Filter>Header Files\GUI</Filter>
     </ClInclude>
     </ClInclude>
+    <ClInclude Include="Include\BsDragAndDropManager.h">
+      <Filter>Header Files\GUI</Filter>
+    </ClInclude>
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <ClCompile Include="Source\BsGUIElement.cpp">
     <ClCompile Include="Source\BsGUIElement.cpp">
@@ -329,5 +332,8 @@
     <ClCompile Include="Source\BsGUIToggleGroup.cpp">
     <ClCompile Include="Source\BsGUIToggleGroup.cpp">
       <Filter>Source Files\GUI</Filter>
       <Filter>Source Files\GUI</Filter>
     </ClCompile>
     </ClCompile>
+    <ClCompile Include="Source\BsDragAndDropManager.cpp">
+      <Filter>Source Files\GUI</Filter>
+    </ClCompile>
   </ItemGroup>
   </ItemGroup>
 </Project>
 </Project>

+ 26 - 0
BansheeEngine/Include/BsDragAndDropManager.h

@@ -0,0 +1,26 @@
+#pragma once
+
+#include "BsPrerequisites.h"
+#include "CmModule.h"
+
+namespace BansheeEngine
+{
+	class DragAndDropManager : public CM::Module<DragAndDropManager>
+	{
+	public:
+		DragAndDropManager();
+
+		void startDrag(CM::HTexture icon, CM::UINT32 typeId, void* data, std::function<void(bool)> dropCallback);
+		bool isDragInProgress() const { return mIsDragInProgress; }
+		CM::UINT32 getDragTypeId() const { return mDragTypeId; }
+		void* getDragData() const { return mData; }
+
+		void _endDrag(bool processed);
+	private:
+		CM::HTexture mIcon;
+		CM::UINT32 mDragTypeId;
+		void* mData;
+		std::function<void(bool)> mDropCallback;
+		bool mIsDragInProgress;
+	};
+}

+ 10 - 1
BansheeEngine/Include/BsGUIMouseEvent.h

@@ -15,7 +15,9 @@ namespace BansheeEngine
 		MouseWheelScroll,
 		MouseWheelScroll,
 		MouseDrag,
 		MouseDrag,
 		MouseDragStart,
 		MouseDragStart,
-		MouseDragEnd
+		MouseDragEnd,
+		MouseDragAndDropDragged,
+		MouseDragAndDropDropped,
 	};
 	};
 
 
 	enum class GUIMouseButton
 	enum class GUIMouseButton
@@ -36,6 +38,8 @@ namespace BansheeEngine
 		float getWheelScrollAmount() const { return mWheelScrollAmount; }
 		float getWheelScrollAmount() const { return mWheelScrollAmount; }
 		bool isButtonDown(GUIMouseButton button) const { return mButtonStates[(int)button]; }
 		bool isButtonDown(GUIMouseButton button) const { return mButtonStates[(int)button]; }
 		GUIElement* getMouseOverElement() const { return mMouseOverElement; }
 		GUIElement* getMouseOverElement() const { return mMouseOverElement; }
+		CM::UINT32 getDragAndDropTypeId() const { return mDragTypeId; }
+		void* getDragAndDropData() const { return mDragData; }
 
 
 		bool isShiftDown() const { return mShift; }
 		bool isShiftDown() const { return mShift; }
 		bool isCtrlDown() const { return mCtrl; }
 		bool isCtrlDown() const { return mCtrl; }
@@ -50,6 +54,8 @@ namespace BansheeEngine
 		GUIMouseEventType mType;
 		GUIMouseEventType mType;
 		GUIMouseButton mButton;
 		GUIMouseButton mButton;
 		GUIElement* mMouseOverElement;
 		GUIElement* mMouseOverElement;
+		CM::UINT32 mDragTypeId;
+		void* mDragData;
 
 
 		bool mShift;
 		bool mShift;
 		bool mCtrl;
 		bool mCtrl;
@@ -65,5 +71,8 @@ namespace BansheeEngine
 		void setMouseDragData(GUIElement* mouseOverElement, const CM::Int2& position, const CM::Int2& dragAmount);
 		void setMouseDragData(GUIElement* mouseOverElement, const CM::Int2& position, const CM::Int2& dragAmount);
 		void setMouseDragStartData(GUIElement* mouseOverElement, const CM::Int2& position);
 		void setMouseDragStartData(GUIElement* mouseOverElement, const CM::Int2& position);
 		void setMouseDragEndData(GUIElement* mouseOverElement, const CM::Int2& position);
 		void setMouseDragEndData(GUIElement* mouseOverElement, const CM::Int2& position);
+
+		void setDragAndDropDroppedData(GUIElement* mouseOverElement, const CM::Int2& position, CM::UINT32 dragTypeId, void* dragData);
+		void setDragAndDropDraggedData(GUIElement* mouseOverElement, const CM::Int2& position, CM::UINT32 dragTypeId, void* dragData);
 	};
 	};
 }
 }

+ 1 - 0
BansheeEngine/Include/BsPrerequisites.h

@@ -55,6 +55,7 @@ namespace BansheeEngine
 	class GUIInputSelection;
 	class GUIInputSelection;
 	struct GUILayoutOptions;
 	struct GUILayoutOptions;
 	class GUIToggleGroup;
 	class GUIToggleGroup;
+	class DragAndDropManager;
 
 
 	// 2D
 	// 2D
 	class TextSprite;
 	class TextSprite;

+ 27 - 0
BansheeEngine/Source/BsDragAndDropManager.cpp

@@ -0,0 +1,27 @@
+#include "BsDragAndDropManager.h"
+
+using namespace CamelotFramework;
+
+namespace BansheeEngine
+{
+	DragAndDropManager::DragAndDropManager()
+		:mIsDragInProgress(false), mDragTypeId(0), mData(nullptr)
+	{
+
+	}
+
+	void DragAndDropManager::startDrag(CM::HTexture icon, CM::UINT32 typeId, void* data, std::function<void(bool)> dropCallback)
+	{
+		mIcon = icon;
+		mDragTypeId = typeId;
+		mData = data;
+		mDropCallback = dropCallback;
+		mIsDragInProgress = true;
+	}
+
+	void DragAndDropManager::_endDrag(bool processed)
+	{
+		if(mDropCallback != nullptr)
+			mDropCallback(processed);
+	}
+}

+ 3 - 0
BansheeEngine/Source/BsGUIInputBox.cpp

@@ -15,6 +15,7 @@
 #include "CmCursor.h"
 #include "CmCursor.h"
 #include "BsGUIInputCaret.h"
 #include "BsGUIInputCaret.h"
 #include "BsGUIInputSelection.h"
 #include "BsGUIInputSelection.h"
+#include "BsDragAndDropManager.h"
 
 
 using namespace CamelotFramework;
 using namespace CamelotFramework;
 
 
@@ -338,6 +339,8 @@ namespace BansheeEngine
 
 
 	bool GUIInputBox::mouseEvent(const GUIMouseEvent& ev)
 	bool GUIInputBox::mouseEvent(const GUIMouseEvent& ev)
 	{
 	{
+		static UINT32 dbg = 0;
+
 		if(ev.getType() == GUIMouseEventType::MouseOver)
 		if(ev.getType() == GUIMouseEventType::MouseOver)
 		{
 		{
 			if(!mHasFocus)
 			if(!mHasFocus)

+ 58 - 20
BansheeEngine/Source/BsGUIManager.cpp

@@ -19,6 +19,7 @@
 #include "CmDebug.h"
 #include "CmDebug.h"
 #include "BsGUIInputCaret.h"
 #include "BsGUIInputCaret.h"
 #include "BsGUIInputSelection.h"
 #include "BsGUIInputSelection.h"
+#include "BsDragAndDropManager.h"
 
 
 using namespace CamelotFramework;
 using namespace CamelotFramework;
 namespace BansheeEngine
 namespace BansheeEngine
@@ -63,6 +64,8 @@ namespace BansheeEngine
 		mInputCaret = cm_new<GUIInputCaret, PoolAlloc>();
 		mInputCaret = cm_new<GUIInputCaret, PoolAlloc>();
 		mInputSelection = cm_new<GUIInputSelection, PoolAlloc>();
 		mInputSelection = cm_new<GUIInputSelection, PoolAlloc>();
 
 
+		DragAndDropManager::startUp(cm_new<DragAndDropManager>());
+
 		// Need to defer this call because I want to make sure all managers are initialized first
 		// Need to defer this call because I want to make sure all managers are initialized first
 		deferredCall(std::bind(&GUIManager::updateCaretTexture, this));
 		deferredCall(std::bind(&GUIManager::updateCaretTexture, this));
 		deferredCall(std::bind(&GUIManager::updateTextSelectionTexture, this));
 		deferredCall(std::bind(&GUIManager::updateTextSelectionTexture, this));
@@ -70,6 +73,8 @@ namespace BansheeEngine
 
 
 	GUIManager::~GUIManager()
 	GUIManager::~GUIManager()
 	{
 	{
+		DragAndDropManager::shutDown();
+
 		// Make a copy of widgets, since destroying them will remove them from mWidgets and
 		// Make a copy of widgets, since destroying them will remove them from mWidgets and
 		// we can't iterate over an array thats getting modified
 		// we can't iterate over an array thats getting modified
 		Vector<WidgetInfo>::type widgetCopy = mWidgets;
 		Vector<WidgetInfo>::type widgetCopy = mWidgets;
@@ -530,7 +535,8 @@ namespace BansheeEngine
 				mKeyEvent = GUIKeyEvent(shiftDown, ctrlDown, altDown);
 				mKeyEvent = GUIKeyEvent(shiftDown, ctrlDown, altDown);
 
 
 				mKeyEvent.setKeyDownData(event.buttonCode);
 				mKeyEvent.setKeyDownData(event.buttonCode);
-				mKeyboardFocusWidget->_keyEvent(mKeyboardFocusElement, mKeyEvent);
+				if(mKeyboardFocusWidget->_keyEvent(mKeyboardFocusElement, mKeyEvent))
+					event.markAsUsed();
 			}
 			}
 		}
 		}
 
 
@@ -562,12 +568,14 @@ namespace BansheeEngine
 				Int2 localPos = getWidgetRelativePos(*mMouseOverWidget, gInput().getMousePosition());
 				Int2 localPos = getWidgetRelativePos(*mMouseOverWidget, gInput().getMousePosition());
 
 
 				mMouseEvent.setMouseDownData(mMouseOverElement, localPos, guiButton);
 				mMouseEvent.setMouseDownData(mMouseOverElement, localPos, guiButton);
-				mMouseOverWidget->_mouseEvent(mMouseOverElement, mMouseEvent);
+				if(mMouseOverWidget->_mouseEvent(mMouseOverElement, mMouseEvent))
+					event.markAsUsed();
 
 
 				// DragStart is for all intents and purposes same as mouse down but since I need a DragEnd event, I feel a separate DragStart
 				// DragStart is for all intents and purposes same as mouse down but since I need a DragEnd event, I feel a separate DragStart
 				// event was also needed to make things clearer.
 				// event was also needed to make things clearer.
 				mMouseEvent.setMouseDragStartData(mMouseOverElement, localPos);
 				mMouseEvent.setMouseDragStartData(mMouseOverElement, localPos);
-				mMouseOverWidget->_mouseEvent(mMouseOverElement, mMouseEvent);
+				if(mMouseOverWidget->_mouseEvent(mMouseOverElement, mMouseEvent))
+					event.markAsUsed();
 
 
 				mActiveElement = mMouseOverElement;
 				mActiveElement = mMouseOverElement;
 				mActiveWidget = mMouseOverWidget;
 				mActiveWidget = mMouseOverWidget;
@@ -583,10 +591,10 @@ namespace BansheeEngine
 
 
 				mKeyboardFocusElement = mMouseOverElement;
 				mKeyboardFocusElement = mMouseOverElement;
 				mKeyboardFocusWidget = mMouseOverWidget;
 				mKeyboardFocusWidget = mMouseOverWidget;
+
+				event.markAsUsed();
 			}
 			}
 		}
 		}
-		
-		event.markAsUsed();
 	}
 	}
 
 
 	void GUIManager::onButtonUp(const ButtonEvent& event)
 	void GUIManager::onButtonUp(const ButtonEvent& event)
@@ -605,7 +613,8 @@ namespace BansheeEngine
 				mKeyEvent = GUIKeyEvent(shiftDown, ctrlDown, altDown);
 				mKeyEvent = GUIKeyEvent(shiftDown, ctrlDown, altDown);
 
 
 				mKeyEvent.setKeyUpData(event.buttonCode);
 				mKeyEvent.setKeyUpData(event.buttonCode);
-				mKeyboardFocusWidget->_keyEvent(mKeyboardFocusElement, mKeyEvent);
+				if(mKeyboardFocusWidget->_keyEvent(mKeyboardFocusElement, mKeyEvent))
+					event.markAsUsed();
 			}
 			}
 		}
 		}
 
 
@@ -626,13 +635,29 @@ namespace BansheeEngine
 
 
 			GUIMouseButton guiButton = buttonToMouseButton(event.buttonCode);
 			GUIMouseButton guiButton = buttonToMouseButton(event.buttonCode);
 
 
+			if(DragAndDropManager::instance().isDragInProgress() && guiButton == GUIMouseButton::Left)
+			{
+				if(mMouseOverElement != nullptr)
+				{
+					mMouseEvent.setDragAndDropDroppedData(mMouseOverElement, localPos, DragAndDropManager::instance().getDragTypeId(), DragAndDropManager::instance().getDragData());
+					bool processed = mMouseOverWidget->_mouseEvent(mMouseOverElement, mMouseEvent);
+
+					DragAndDropManager::instance()._endDrag(processed);
+
+					if(processed)
+						event.markAsUsed();
+				}
+			}
+
 			// Send MouseUp event only if we are over the active element (we don't want to accidentally trigger other elements).
 			// Send MouseUp event only if we are over the active element (we don't want to accidentally trigger other elements).
 			// And only activate when a button that originally caused the active state is released, otherwise ignore it.
 			// And only activate when a button that originally caused the active state is released, otherwise ignore it.
 			bool acceptMouseUp = mActiveMouseButton == guiButton && (mMouseOverElement != nullptr && mActiveElement == mMouseOverElement);
 			bool acceptMouseUp = mActiveMouseButton == guiButton && (mMouseOverElement != nullptr && mActiveElement == mMouseOverElement);
 			if(acceptMouseUp)
 			if(acceptMouseUp)
 			{
 			{
 				mMouseEvent.setMouseUpData(mMouseOverElement, localPos, guiButton);
 				mMouseEvent.setMouseUpData(mMouseOverElement, localPos, guiButton);
-				mMouseOverWidget->_mouseEvent(mMouseOverElement, mMouseEvent);
+				
+				if(mMouseOverWidget->_mouseEvent(mMouseOverElement, mMouseEvent))
+					event.markAsUsed();
 			}
 			}
 
 
 			// Send DragEnd event to whichever element is active
 			// Send DragEnd event to whichever element is active
@@ -640,15 +665,14 @@ namespace BansheeEngine
 			if(acceptEndDrag)
 			if(acceptEndDrag)
 			{
 			{
 				mMouseEvent.setMouseDragEndData(mMouseOverElement, localPos);
 				mMouseEvent.setMouseDragEndData(mMouseOverElement, localPos);
-				mActiveWidget->_mouseEvent(mActiveElement, mMouseEvent);
+				if(mActiveWidget->_mouseEvent(mActiveElement, mMouseEvent))
+					event.markAsUsed();
 
 
 				mActiveElement = nullptr;
 				mActiveElement = nullptr;
 				mActiveWidget = nullptr;
 				mActiveWidget = nullptr;
 				mActiveMouseButton = GUIMouseButton::Left;
 				mActiveMouseButton = GUIMouseButton::Left;
-			}	
+			}
 		}
 		}
-
-		event.markAsUsed();
 	}
 	}
 
 
 	void GUIManager::onMouseMoved(const MouseEvent& event)
 	void GUIManager::onMouseMoved(const MouseEvent& event)
@@ -754,7 +778,8 @@ namespace BansheeEngine
 					Int2 curLocalPos = getWidgetRelativePos(*mMouseOverWidget, event.screenPos);
 					Int2 curLocalPos = getWidgetRelativePos(*mMouseOverWidget, event.screenPos);
 
 
 					mMouseEvent.setMouseOutData(topMostElement, curLocalPos);
 					mMouseEvent.setMouseOutData(topMostElement, curLocalPos);
-					mMouseOverWidget->_mouseEvent(mMouseOverElement, mMouseEvent);
+					if(mMouseOverWidget->_mouseEvent(mMouseOverElement, mMouseEvent))
+						event.markAsUsed();
 				}
 				}
 			}
 			}
 
 
@@ -764,7 +789,8 @@ namespace BansheeEngine
 				if(mActiveElement == nullptr || topMostElement == mActiveElement)
 				if(mActiveElement == nullptr || topMostElement == mActiveElement)
 				{
 				{
 					mMouseEvent.setMouseOverData(topMostElement, localPos);
 					mMouseEvent.setMouseOverData(topMostElement, localPos);
-					widgetInFocus->_mouseEvent(topMostElement, mMouseEvent);
+					if(widgetInFocus->_mouseEvent(topMostElement, mMouseEvent))
+						event.markAsUsed();
 				}
 				}
 			}
 			}
 		}
 		}
@@ -777,10 +803,22 @@ namespace BansheeEngine
 			if(mLastCursorLocalPos != curLocalPos)
 			if(mLastCursorLocalPos != curLocalPos)
 			{
 			{
 				mMouseEvent.setMouseDragData(topMostElement, curLocalPos, curLocalPos - mLastCursorLocalPos);
 				mMouseEvent.setMouseDragData(topMostElement, curLocalPos, curLocalPos - mLastCursorLocalPos);
-				mActiveWidget->_mouseEvent(mActiveElement, mMouseEvent);
+				if(mActiveWidget->_mouseEvent(mActiveElement, mMouseEvent))
+					event.markAsUsed();
 
 
 				mLastCursorLocalPos = curLocalPos;
 				mLastCursorLocalPos = curLocalPos;
 			}
 			}
+
+			// Also if drag is in progress send DragAndDrop events
+			if(DragAndDropManager::instance().isDragInProgress())
+			{
+				if(topMostElement != nullptr)
+				{
+					mMouseEvent.setDragAndDropDraggedData(topMostElement, localPos, DragAndDropManager::instance().getDragTypeId(), DragAndDropManager::instance().getDragData());
+					if(widgetInFocus->_mouseEvent(topMostElement, mMouseEvent))
+						event.markAsUsed();
+				}
+			}
 		}
 		}
 		else // Otherwise, send MouseMove events if we are hovering over any element
 		else // Otherwise, send MouseMove events if we are hovering over any element
 		{
 		{
@@ -790,7 +828,8 @@ namespace BansheeEngine
 				if(mLastCursorLocalPos != localPos)
 				if(mLastCursorLocalPos != localPos)
 				{
 				{
 					mMouseEvent.setMouseMoveData(topMostElement, localPos);
 					mMouseEvent.setMouseMoveData(topMostElement, localPos);
-					widgetInFocus->_mouseEvent(topMostElement, mMouseEvent);
+					if(widgetInFocus->_mouseEvent(topMostElement, mMouseEvent))
+						event.markAsUsed();
 
 
 					mLastCursorLocalPos = localPos;
 					mLastCursorLocalPos = localPos;
 				}
 				}
@@ -798,15 +837,14 @@ namespace BansheeEngine
 				if(Math::Abs(event.mouseWheelScrollAmount) > 0.00001f)
 				if(Math::Abs(event.mouseWheelScrollAmount) > 0.00001f)
 				{
 				{
 					mMouseEvent.setMouseWheelScrollData(topMostElement, event.mouseWheelScrollAmount);
 					mMouseEvent.setMouseWheelScrollData(topMostElement, event.mouseWheelScrollAmount);
-					widgetInFocus->_mouseEvent(topMostElement, mMouseEvent);
+					if(widgetInFocus->_mouseEvent(topMostElement, mMouseEvent))
+						event.markAsUsed();
 				}
 				}
 			}
 			}
 		}
 		}
 
 
 		mMouseOverElement = topMostElement;
 		mMouseOverElement = topMostElement;
 		mMouseOverWidget = widgetInFocus;
 		mMouseOverWidget = widgetInFocus;
-
-		event.markAsUsed();
 	}
 	}
 
 
 	void GUIManager::onTextInput(const CM::TextInputEvent& event)
 	void GUIManager::onTextInput(const CM::TextInputEvent& event)
@@ -823,8 +861,8 @@ namespace BansheeEngine
 			mKeyEvent = GUIKeyEvent(shiftDown, ctrlDown, altDown);
 			mKeyEvent = GUIKeyEvent(shiftDown, ctrlDown, altDown);
 
 
 			mKeyEvent.setTextInputData(event.textChar);
 			mKeyEvent.setTextInputData(event.textChar);
-			mKeyboardFocusWidget->_keyEvent(mKeyboardFocusElement, mKeyEvent);
-
+			if(mKeyboardFocusWidget->_keyEvent(mKeyboardFocusElement, mKeyEvent))
+				event.markAsUsed();
 		}
 		}
 	}
 	}
 
 

+ 24 - 0
BansheeEngine/Source/BsGUIMouseEvent.cpp

@@ -107,4 +107,28 @@ namespace BansheeEngine
 		mDragAmount = Int2();
 		mDragAmount = Int2();
 		mWheelScrollAmount = 0.0f;
 		mWheelScrollAmount = 0.0f;
 	}
 	}
+
+	void GUIMouseEvent::setDragAndDropDroppedData(GUIElement* mouseOverElement, const Int2& position, CM::UINT32 dragTypeId, void* dragData)
+	{
+		mType = GUIMouseEventType::MouseDragAndDropDropped;
+		mPosition = position;
+		mMouseOverElement = mouseOverElement;
+		mButton = GUIMouseButton::Left;
+		mDragAmount = Int2();
+		mWheelScrollAmount = 0.0f;
+		mDragTypeId = dragTypeId;
+		mDragData = dragData;
+	}
+
+	void GUIMouseEvent::setDragAndDropDraggedData(GUIElement* mouseOverElement, const Int2& position, CM::UINT32 dragTypeId, void* dragData)
+	{
+		mType = GUIMouseEventType::MouseDragAndDropDragged;
+		mPosition = position;
+		mMouseOverElement = mouseOverElement;
+		mButton = GUIMouseButton::Left;
+		mDragAmount = Int2();
+		mWheelScrollAmount = 0.0f;
+		mDragTypeId = dragTypeId;
+		mDragData = dragData;
+	}
 }
 }

+ 0 - 2
CamelotClient/Source/BsEditorWidgetContainer.cpp

@@ -40,9 +40,7 @@ namespace BansheeEditor
 		widget._changeParent(this);
 		widget._changeParent(this);
 
 
 		if(mActiveWidget == -1)
 		if(mActiveWidget == -1)
-		{
 			setActiveWidget((UINT32)mWidgets.size() - 1);
 			setActiveWidget((UINT32)mWidgets.size() - 1);
-		}
 		else
 		else
 			widget._disable();
 			widget._disable();
 	}
 	}

+ 0 - 21
EditorWindowDock.txt

@@ -1,24 +1,3 @@
-EditorWindow
- - Actual render window containing a window frame
- - Has a content area that is automatically managed as the window resizes
- - Optionally it has a title bar (SEPARATE from the docked title bar)
- - (Later) Optionally also a context menu
- - Used for both main and editor windows
-
-EditorWidgetContainer
- - Contains a tabbed title bar
- - Used for dealing with multiple editor widgets
- - More specific:
-   - Has add/remove/move methods that allow you to manipulate which EditorWidgets it contains.
-
-EditorWidget
- - What we have so far called EditorWindow
- - Contains a GUIArea that is managed by its parent EditorWindow or DockManager
- - This is the only user-friendly part of the Editor window system. User should never need to touch the other bits.
- - More specific
-   - Contains the window name
-   - Has open/close method (Open automatically creates an EditorWindow)
-
 DragAndDropManager
 DragAndDropManager
  - Very simple interface
  - Very simple interface
  - dragObject(icon, type, data, dropCallback) - starts item drag (data is just a void user an cast based on type)
  - dragObject(icon, type, data, dropCallback) - starts item drag (data is just a void user an cast based on type)