Просмотр исходного кода

Editor checkin before I start work on Camelot2D/GUI

Marko Pintera 12 лет назад
Родитель
Сommit
a02ad7f0b8

+ 20 - 0
CamelotEditor/CamelotEditor.vcxproj

@@ -163,6 +163,7 @@
     <ClCompile Include="GeneratedFiles\moc_CmQtNewProject.cpp" />
     <ClCompile Include="GeneratedFiles\moc_CmQtProjectSelection.cpp" />
     <ClCompile Include="GeneratedFiles\moc_CmQtSceneWidget.cpp" />
+    <ClCompile Include="GeneratedFiles\moc_CmQtTabButton.cpp" />
     <ClCompile Include="GeneratedFiles\qrc_CmEditor.cpp">
       <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
       </PrecompiledHeader>
@@ -188,6 +189,7 @@
     <ClCompile Include="Source\CmQtHierarchyWidget.cpp" />
     <ClCompile Include="Source\CmQtNewProject.cpp" />
     <ClCompile Include="Source\CmQtProjectSelection.cpp" />
+    <ClCompile Include="Source\CmQtTabButton.cpp" />
     <ClCompile Include="Source\CmSceneWidgetFactory.cpp" />
     <ClCompile Include="Source\CmWindowDockManager.cpp" />
     <ClCompile Include="Source\main.cpp" />
@@ -352,6 +354,24 @@
       <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\GeneratedFiles\moc_%(Filename).cpp</Outputs>
       <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
     </CustomBuild>
+    <CustomBuild Include="Include\CmQtTabButton.h">
+      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">"$(QTDIR)\bin\moc.exe"  "%(FullPath)" -o ".\GeneratedFiles\moc_%(Filename).cpp"  -DQT_NO_KEYWORDS -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL  "-I.\GeneratedFiles" "-I.\Include" "-I.\Dependencies\Include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\CamelotCore\Include" "-I.\..\CamelotUtility\Include" "-I.\..\Dependencies\Include"</Command>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Moc%27ing %(Filename)...</Message>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\GeneratedFiles\moc_%(Filename).cpp</Outputs>
+      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">"$(QTDIR)\bin\moc.exe"  "%(FullPath)" -o ".\GeneratedFiles\moc_%(Filename).cpp"  -DQT_NO_KEYWORDS -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL  "-I.\GeneratedFiles" "-I.\Include" "-I.\Dependencies\Include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\CamelotCore\Include" "-I.\..\CamelotUtility\Include" "-I.\..\Dependencies\Include"</Command>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Moc%27ing %(Filename)...</Message>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\moc_%(Filename).cpp</Outputs>
+      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">"$(QTDIR)\bin\moc.exe"  "%(FullPath)" -o ".\GeneratedFiles\moc_%(Filename).cpp"  -DQT_NO_KEYWORDS -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL  "-I.\GeneratedFiles" "-I.\Include" "-I.\Dependencies\Include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\CamelotCore\Include" "-I.\..\CamelotUtility\Include" "-I.\..\Dependencies\Include"</Command>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Moc%27ing %(Filename)...</Message>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\GeneratedFiles\moc_%(Filename).cpp</Outputs>
+      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">"$(QTDIR)\bin\moc.exe"  "%(FullPath)" -o ".\GeneratedFiles\moc_%(Filename).cpp"  -DQT_NO_KEYWORDS -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_DLL  "-I.\GeneratedFiles" "-I.\Include" "-I.\Dependencies\Include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I.\..\CamelotCore\Include" "-I.\..\CamelotUtility\Include" "-I.\..\Dependencies\Include"</Command>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Moc%27ing %(Filename)...</Message>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\GeneratedFiles\moc_%(Filename).cpp</Outputs>
+      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(QTDIR)\bin\moc.exe;%(FullPath)</AdditionalInputs>
+    </CustomBuild>
     <ClInclude Include="Include\CmSceneWidgetFactory.h" />
     <ClInclude Include="Include\CmWindowDockManager.h" />
     <CustomBuild Include="Include\CmQtNewProject.h">

+ 9 - 0
CamelotEditor/CamelotEditor.vcxproj.filters

@@ -117,6 +117,12 @@
     <ClCompile Include="GeneratedFiles\moc_CmQtDynamicTabBar.cpp">
       <Filter>Generated Files</Filter>
     </ClCompile>
+    <ClCompile Include="Source\CmQtTabButton.cpp">
+      <Filter>Source Files\Qt</Filter>
+    </ClCompile>
+    <ClCompile Include="GeneratedFiles\moc_CmQtTabButton.cpp">
+      <Filter>Generated Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <CustomBuild Include="CmEditor.qrc">
@@ -149,6 +155,9 @@
     <CustomBuild Include="Include\CmQtDynamicTabBar.h">
       <Filter>Header Files\Qt</Filter>
     </CustomBuild>
+    <CustomBuild Include="Include\CmQtTabButton.h">
+      <Filter>Header Files\Qt</Filter>
+    </CustomBuild>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="Include\CmEditorPrefs.h">

+ 1 - 0
CamelotEditor/Include/CmEditorPrerequisites.h

@@ -16,6 +16,7 @@ namespace CamelotEditor
 	class QtEditorWindow;
 	class QtEditorWidget;
 	class QtDynamicTabBar;
+	class QtTabButton;
 }
 
 // Qt

+ 2 - 1
CamelotEditor/Include/CmEditorWindowManager.h

@@ -27,6 +27,8 @@ namespace CamelotEditor
 		void openWidget(const QString& name, QtEditorWindow* parent = nullptr);
 		boost::function<void()> getOpenCallback(const QString& name);
 
+		QtEditorWindow* openWindow(INT32 forcedId = -1);
+
 		QtEditorWindow* getOpenWindow(INT32 id) const;
 		QtEditorWindow* getWindowAtPosition(const QPoint& globalPos, vector<UINT32>::type windowsToIgnore = vector<UINT32>::type()) const;
 
@@ -43,7 +45,6 @@ namespace CamelotEditor
 
 		EditorWidgetFactory* getFactory(const QString& name) const;
 
-		QtEditorWindow* openWindow(INT32 forcedId = -1);
 		void widgetClosed(QtEditorWidget* window);
 		void windowClosed(QtEditorWindow* window);
 	};

+ 3 - 2
CamelotEditor/Include/CmQtDynamicTabBar.h

@@ -29,15 +29,16 @@ namespace CamelotEditor
 		void paintEvent(QPaintEvent *event);
 
 		boost::signal<void(UINT32)> onTabSelected;
-
+		boost::signal<void(UINT32)> onTabDraggedOff;
 	private:
 		QHBoxLayout* mHLayout;
-		vector<QPushButton*>::type mTabs;
+		vector<QtTabButton*>::type mTabs;
 		bool dbg;
 
 		void setupUi();
 		void updateTabs();
 
 		void tabSelected(UINT32 idx);
+		void tabDraggedOff(UINT32 idx);
 	};
 }

+ 2 - 0
CamelotEditor/Include/CmQtEditor.h

@@ -39,6 +39,8 @@ namespace CamelotEditor
 		void moveEvent(QMoveEvent* event);
 		void resizeEvent(QResizeEvent* event);
 
+		bool eventFilter(QObject* object, QEvent* event);
+
 		void openProject();
 		void saveProject();
 		void exitEditor();

+ 3 - 1
CamelotEditor/Include/CmQtEditorWidget.h

@@ -11,11 +11,12 @@ namespace CamelotEditor
 		Q_OBJECT
 
 	public:
-		QtEditorWidget(QWidget* parent, const QString& name, const QString& title);
+		QtEditorWidget(QWidget* parent, const QString& name, const QString& title, const QSize& defaultSize);
 		virtual ~QtEditorWidget() { }
 
 		const QString& getName() const { return mName; }
 		const QString& getTitle() const { return mTitle; }
+		const QSize& getDefaultSize() const { return mDefaultSize; }
 
 		QtEditorWindow* getParentWindow() const { return mParentWindow; }
 
@@ -27,6 +28,7 @@ namespace CamelotEditor
 		
 		QString mName;
 		QString mTitle;
+		QSize mDefaultSize;
 
 		QtEditorWindow* mParentWindow;
 

+ 4 - 0
CamelotEditor/Include/CmQtEditorWindow.h

@@ -64,6 +64,7 @@ namespace CamelotEditor
 		QWidget* mTitleBar;
 		QtDynamicTabBar* mTabBar;
 		QPushButton* mBtnClose;
+		QPushButton* mBtnUndock;
 		QWidget* mCentralWidget;
 		QStackedWidget* mStackedWidget;
 		QTimer* mTimer;
@@ -87,6 +88,8 @@ namespace CamelotEditor
 		ResizeMode getResizeMode(QPoint mousePos);
 		bool isOverResizeArea(QPoint mousePos);
 
+		void resizeCentered(const QSize& size);
+
 		/**
 		 * @brief	Query if 'mousePos' is over the area that can be used for dragging the window around.
 		 *
@@ -103,5 +106,6 @@ namespace CamelotEditor
 	private Q_SLOTS:
 		void timerUpdate();
 		void closeWidget();
+		void undockWidget();
 	};
 }

+ 31 - 0
CamelotEditor/Include/CmQtTabButton.h

@@ -0,0 +1,31 @@
+#pragma once
+
+#include "CmEditorPrerequisites.h"
+#include <QtWidgets/QPushButton>
+#include <boost/signal.hpp>
+
+namespace CamelotEditor
+{
+	class QtTabButton : public QPushButton
+	{
+		Q_OBJECT
+
+	public:
+		QtTabButton(QWidget* parent);
+		virtual ~QtTabButton();
+
+		void mousePressEvent(QMouseEvent* event);
+		void mouseReleaseEvent(QMouseEvent* event);
+		void mouseMoveEvent(QMouseEvent* event);
+
+		boost::signal<void()> onDragged;
+		boost::signal<void()> onSelected;
+	private:
+		QPoint mMouseMoveStartPos;
+		bool mMouseDragging;
+
+		void setupUi();
+
+		void buttonClicked();
+	};
+}

+ 1 - 1
CamelotEditor/Source/CmEditorPrefs.cpp

@@ -142,7 +142,7 @@ namespace CamelotEditor
 		desc.activeWidget = node.child("ChildWidgets").attribute("activeWidgetIdx").as_uint();
 
 		xml_node childWidgets = node.child("ChildWidgets");
-		for (xml_node childWidget = childWidgets.child("ChildWidget"); childWidget; childWidget = childWidgets.next_sibling("ChildWidget"))
+		for (xml_node childWidget = childWidgets.child("ChildWidget"); childWidget; childWidget = childWidget.next_sibling("ChildWidget"))
 		{
 			desc.childWidgetNames.push_back(childWidget.attribute("name").as_string());
 		}

+ 18 - 5
CamelotEditor/Source/CmQtDynamicTabBar.cpp

@@ -1,5 +1,6 @@
 #include "CmQtDynamicTabBar.h"
 #include "CmException.h"
+#include "CmQtTabButton.h"
 #include <QtWidgets/QPushButton>
 #include <QtWidgets/QHBoxLayout>
 #include <QtGui/QPainter>
@@ -14,7 +15,7 @@ namespace CamelotEditor
 
 	void QtDynamicTabBar::addTab(const QString& name)
 	{
-		QPushButton* newBtn = new QPushButton(this);
+		QtTabButton* newBtn = new QtTabButton(this);
 		newBtn->setMaximumWidth(100);
 		newBtn->setText(name);
 
@@ -28,7 +29,7 @@ namespace CamelotEditor
 		if(idx > (UINT32)mTabs.size())
 			CM_EXCEPT(InvalidParametersException, "Index out of range: " + toString(idx) +". Valid range: 0 .. " + toString((UINT32)mTabs.size()));
 
-		QPushButton* newBtn = new QPushButton(this);
+		QtTabButton* newBtn = new QtTabButton(this);
 		newBtn->setMaximumWidth(100);
 		newBtn->setText(name);
 
@@ -42,7 +43,10 @@ namespace CamelotEditor
 		if(idx >= (UINT32)mTabs.size())
 			CM_EXCEPT(InvalidParametersException, "Index out of range: " + toString(idx) +". Valid range: 0 .. " + toString((UINT32)mTabs.size()));
 
-		mTabs.erase(mTabs.begin() + idx);
+		auto iter = mTabs.begin() + idx;
+		delete *iter;
+
+		mTabs.erase(iter);
 
 		updateTabs();
 	}
@@ -150,8 +154,12 @@ namespace CamelotEditor
 		UINT32 idx = 0;
 		for(auto iter = mTabs.begin(); iter != mTabs.end(); ++iter)
 		{
-			(*iter)->disconnect();
-			/*connect(*iter, &QPushButton::clicked, std::bind(this, &QtDynamicTabBar::tabSelected, idx));*/
+			(*iter)->onSelected.disconnect_all_slots();
+			(*iter)->onSelected.connect(boost::bind(&QtDynamicTabBar::tabSelected, this, idx));
+
+			(*iter)->onDragged.disconnect_all_slots();
+			(*iter)->onDragged.connect(boost::bind(&QtDynamicTabBar::tabDraggedOff, this, idx));
+
 			mHLayout->addWidget(*iter);
 
 			idx++;
@@ -164,4 +172,9 @@ namespace CamelotEditor
 	{
 		onTabSelected(idx);
 	}
+
+	void QtDynamicTabBar::tabDraggedOff(UINT32 idx)
+	{
+		onTabDraggedOff(idx);
+	}
 }

+ 7 - 0
CamelotEditor/Source/CmQtEditor.cpp

@@ -161,6 +161,13 @@ namespace CamelotEditor
 		QWidget::resizeEvent(event);
 	}
 
+	bool QtEditor::eventFilter(QObject* object, QEvent* event)
+	{
+
+
+		return false;
+	}
+
 	void QtEditor::openProject()
 	{
 		CM_EXCEPT(NotImplementedException, "Not implemented");

+ 2 - 2
CamelotEditor/Source/CmQtEditorWidget.cpp

@@ -2,8 +2,8 @@
 
 namespace CamelotEditor
 {
-	QtEditorWidget::QtEditorWidget(QWidget* parent, const QString& name, const QString& title)
-		:QWidget(parent), mName(name), mTitle(title)
+	QtEditorWidget::QtEditorWidget(QWidget* parent, const QString& name, const QString& title, const QSize& defaultSize)
+		:QWidget(parent), mName(name), mTitle(title), mDefaultSize(defaultSize)
 	{
 
 	}

+ 41 - 4
CamelotEditor/Source/CmQtEditorWindow.cpp

@@ -15,6 +15,8 @@
 #include "CmQtDynamicTabBar.h"
 #include "CmWindowDockManager.h"
 #include "CmEditorWindowManager.h"
+#include "CmQtEditor.h"
+#include "CmEditorApplication.h"
 
 namespace CamelotEditor
 {
@@ -40,12 +42,15 @@ namespace CamelotEditor
 		mTitleBar->setMouseTracking(true);
 
 		mTabBar = new QtDynamicTabBar(this);
+		mTabBar->setMouseTracking(true);
 		
 		mBtnClose = new QPushButton(this);
+		mBtnUndock = new QPushButton(this);
 		
 		QHBoxLayout* titleLayout = new QHBoxLayout(this);
 		titleLayout->setMargin(0);
 		titleLayout->addWidget(mTabBar, 1);
+		titleLayout->addWidget(mBtnUndock);
 		titleLayout->addWidget(mBtnClose);
 		mTitleBar->setLayout(titleLayout);
 
@@ -77,6 +82,7 @@ namespace CamelotEditor
 	void QtEditorWindow::setupSignals()
 	{
 		connect(mBtnClose, SIGNAL(clicked()), this, SLOT(closeWidget()));
+		connect(mBtnUndock, SIGNAL(clicked()), this, SLOT(undockWidget()));
 		connect(mTimer, SIGNAL(timeout()), this, SLOT(timerUpdate()));
 		
 		mTabBar->onTabSelected.connect(boost::bind(&QtEditorWindow::setActiveWidget, this, _1));
@@ -84,6 +90,7 @@ namespace CamelotEditor
 
 	void QtEditorWindow::retranslateUi()
 	{
+		mBtnUndock->setText(tr("Undock"));
 		mBtnClose->setText(tr("Close"));
 	}
 
@@ -108,6 +115,9 @@ namespace CamelotEditor
 		{
 			setWindowFlags(Qt::Tool | Qt::FramelessWindowHint);
 			mIsDocked = false;
+
+			QtEditorWidget* activeWidget = getWidget(mActiveWidgetIdx);
+			resizeCentered(activeWidget->getDefaultSize());
 		}
 	}
 
@@ -120,6 +130,13 @@ namespace CamelotEditor
 		}
 	}
 
+	void QtEditorWindow::resizeCentered(const QSize& size)
+	{
+		int newX = x() + width() / 2 - size.width() / 2;
+
+		setGeometry(newX, y(), size.width(), size.height());
+	}
+
 	WindowLayoutDesc QtEditorWindow::getLayoutDesc() const
 	{
 		WindowLayoutDesc desc;
@@ -222,9 +239,12 @@ namespace CamelotEditor
 		if(iterFind != mEditorWidgets.end())
 			CM_EXCEPT(InvalidParametersException, "Specified widget already exists in this window.");
 
-		widget->setParentWindow(this);
+		widget->setParent(this);
 		mEditorWidgets.push_back(widget);
 		mTabBar->addTab(widget->getName());
+
+		if(getNumWidgets() == 1)
+			resizeCentered(widget->getDefaultSize());
 	}
 
 	void QtEditorWindow::insertWidget(UINT32 idx, QtEditorWidget* widget)
@@ -238,9 +258,12 @@ namespace CamelotEditor
 		if(idx > (UINT32)mEditorWidgets.size())
 			idx = (UINT32)mEditorWidgets.size();
 
-		widget->setParentWindow(this);
+		widget->setParent(this);
 		mEditorWidgets.insert(mEditorWidgets.begin() + idx, widget);
 		mTabBar->insertTab(idx, widget->getName());
+
+		if(getNumWidgets() == 1)
+			resizeCentered(widget->getDefaultSize());
 	}
 
 	void QtEditorWindow::removeWidget(UINT32 idx)
@@ -249,7 +272,7 @@ namespace CamelotEditor
 			CM_EXCEPT(InvalidParametersException, "Index out of range: " + toString(idx) +". Valid range: 0 .. " + toString((UINT32)mEditorWidgets.size()));
 
 		mEditorWidgets.erase(mEditorWidgets.begin() + idx);
-		mTabBar->removeTab(idx);
+		mTabBar->removeTab(idx);		
 	}
 
 	QtEditorWidget* QtEditorWindow::getWidget(UINT32 idx) const
@@ -476,7 +499,21 @@ namespace CamelotEditor
 		activeWidget->closeWidget();
 
 		if(getNumWidgets() == 0)
-			closeWindow();		
+			closeWindow();
+	}
+
+	void QtEditorWindow::undockWidget()
+	{
+		QtEditorWidget* widget = getWidget(mActiveWidgetIdx);
+
+		removeWidget(mActiveWidgetIdx);
+
+		QtEditorWindow* newWindow = gEditorWindowManager().openWindow();
+		newWindow->addWidget(widget);
+		newWindow->resizeCentered(widget->getDefaultSize());
+
+		if(getNumWidgets() == 0)
+			closeWindow();
 	}
 
 	QtEditorWindow::ResizeMode QtEditorWindow::getResizeMode(QPoint mousePos)

+ 2 - 2
CamelotEditor/Source/CmQtHierarchyWidget.cpp

@@ -3,9 +3,9 @@
 namespace CamelotEditor
 {
 	QtHierarchyWidget::QtHierarchyWidget(QWidget* parent)
-		:QtEditorWidget(parent, "Hierarchy", tr("Hierarchy"))
+		:QtEditorWidget(parent, "Hierarchy", tr("Hierarchy"), QSize(200, 300))
 	{
-
+		resize(getDefaultSize());
 	}
 
 	QtHierarchyWidget::~QtHierarchyWidget() { }

+ 2 - 2
CamelotEditor/Source/CmQtSceneWidget.cpp

@@ -4,9 +4,9 @@
 namespace CamelotEditor
 {
 	QtSceneWidget::QtSceneWidget(QWidget* parent)
-		:QtEditorWidget(parent, "Scene", tr("Scene"))
+		:QtEditorWidget(parent, "Scene", tr("Scene"), QSize(200, 300))
 	{
-
+		resize(getDefaultSize());
 	}
 
 	QtSceneWidget::~QtSceneWidget() { }

+ 49 - 0
CamelotEditor/Source/CmQtTabButton.cpp

@@ -0,0 +1,49 @@
+#include "CmQtTabButton.h"
+#include <QtGui/QMouseEvent>
+
+namespace CamelotEditor
+{
+	QtTabButton::QtTabButton(QWidget* parent)
+		:QPushButton(parent), mMouseDragging(false)
+	{
+		setupUi();
+	}
+
+	QtTabButton::~QtTabButton()
+	{
+
+	}
+
+	void QtTabButton::setupUi()
+	{
+		connect(this, &QPushButton::clicked, this, &QtTabButton::buttonClicked);
+	}
+
+	void QtTabButton::mousePressEvent(QMouseEvent* event)
+	{
+		mMouseDragging = true;
+		mMouseMoveStartPos = event->pos();
+	}
+
+	void QtTabButton::mouseReleaseEvent(QMouseEvent* event)
+	{
+		mMouseDragging = false;
+	}
+
+	void QtTabButton::mouseMoveEvent(QMouseEvent* event)
+	{
+		if(mMouseDragging)
+		{
+			QPoint diff = mMouseMoveStartPos - event->pos();
+
+			// We currently handle undocking differently so this is not used
+			//if(diff.manhattanLength() > 4)
+			//	onDragged();
+		}
+	}	
+
+	void QtTabButton::buttonClicked()
+	{
+		onSelected();
+	}
+}

+ 1 - 0
CamelotEngine.sln

@@ -37,6 +37,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
 		Dependencies.txt = Dependencies.txt
 		HighLevelTODO.txt = HighLevelTODO.txt
 		TODO.txt = TODO.txt
+		TODO_2D_GUI.txt = TODO_2D_GUI.txt
 		TODODoc.txt = TODODoc.txt
 		TODOEditor.txt = TODOEditor.txt
 	EndProjectSection

+ 4 - 1
TODOEditor.txt

@@ -44,4 +44,7 @@ When restoring windows what happens why I try to restore an unloaded plugin?
  If not it checks if we're mousing over DynamicTabBar (in any open window)
    If we are it gets the polygons from DynamicTabBar and renders them
    Also gets the current polygon and highlights it
-   Upon mouse release it find exactly at what index the mouse was released and adds the widget to the tab bar
+   Upon mouse release it find exactly at what index the mouse was released and adds the widget to the tab bar
+
+   getWindowAtPosition doesn't consider if two or more windows are overlapping. It should return the front most
+Dragging window around occludes possible dock points. I need to make the window less visible while dragging.

+ 80 - 0
TODO_2D_GUI.txt

@@ -0,0 +1,80 @@
+Custom C# GUI:
+
+Advantages
+ Qt makes it impossible to create a proper docking system but I can't find top-most window
+ In general such simple operations are proving problematic
+ I will need to build a system working with C# anyway at one point
+ Qt is possibly slow (example is the Console and List widget)
+ C# is much easier to write
+
+Disadvantages
+ I need to implement Camelot2D and CamelotGUI system
+   - These systems need to be designed properly and I will likely need to re-design some of engine systems if I find them lacking and they haven't been properly tested
+ Multiplatform management of windows might be problematic (However it might get handled by Mono decently?)
+ I will need to create a C# interface for the system (Need to do this anyway)
+ I need many controls I wouldn't need for a game 
+ 
+
+
+Camelot2D
+ - Check out Ogre and possibly Torque to see how they implement it
+ - Support for sprites
+ - Support for text
+ - Optimized rendering?
+  - Allow to place sprites into pages, which then get texture atlased
+  - Before rendering dynamically batch the mesh so number of 2D draw calls is reduced
+ - Animated sprites?
+
+CamelotGUI
+ - Label
+ - Text field
+  - Int field, float field?
+ - Text area
+ - Scroll area (Vert/Horz)
+ - Button
+ - Checkbox
+ - Radio button
+ - Tree view
+ - List view
+
+ - Allow Unity-like layout based system, only with callbacks
+
+ - All controls must be fully skinnable
+
+
+ --------------------------------
+
+ CamelotGUI
+  - Traditional UI with buttons, lists, text fields, etc.
+  - Easy to use for desiging the editor and debugging
+  - See the UML diagram (GUIClassDiagram.violet) for description
+
+ Camelot2D
+  - System meant for 2D games and proper in-game UIs
+  - Proper support for all kinds of animation
+  - Together with helpful controls for rendering text, input boxes, etc.
+
+  Maybe it would be better to somewhat combine these two after all, to avoid re-doing a lot of code?
+   - All UI elements can reference a GUITexture instead of a texture. GUITextures can be pre-processed into a texture atlas before use
+     so that UI can be easily dynamically batched. 
+   - This way both GUI types can use GameObjects for rendering and share the same types
+   - Rendering is handled by some parent GUI class, not individual elements. So that the GUI can be properly batched
+   - Need layers that will allow me to filter GameObjects for rendering camera per camera
+   - Need a flag that will hide Editor elements in Hierarchy, and also prevent saving them with scene.
+   - CamelotCore should in no way depend on CamelotGUI or Camelot2D (if I decide to split them into two classes)
+
+Start just with Camelot2D
+ - Text rendering
+ - Sprite rendering (+ batching and similar)
+
+Then CamelotGUI providing basic controls like Labels, Buttons, TextFields
+
+Then CamelotEditor providing its own implementation of CamelotGUI
+
+
+FIRST STEP:
+ - Camelot2D, Freetype and fonts. See Ogre::Font
+
+  Support both ttf and image fonts? Image fonts would get loaded from an texture + .xml file and could be used made
+   - Fonts should always be defined through an image + FontDesc
+   - Freetype importer would just generate the image and FontDesc automatically?