Procházet zdrojové kódy

Gotten rid of foldout and component foldout GUI elements, and replaced them with a styled toggle instead

BearishSun před 10 roky
rodič
revize
f6daa0e16d

+ 0 - 4
BansheeEditor/BansheeEditor.vcxproj

@@ -295,8 +295,6 @@
     <ClInclude Include="Include\BsDropDownWindow.h" />
     <ClInclude Include="Include\BsDropDownWindow.h" />
     <ClInclude Include="Include\BsGUIFieldBase.h" />
     <ClInclude Include="Include\BsGUIFieldBase.h" />
     <ClInclude Include="Include\BsGUIFloatField.h" />
     <ClInclude Include="Include\BsGUIFloatField.h" />
-    <ClInclude Include="Include\BsGUIComponentFoldout.h" />
-    <ClInclude Include="Include\BsGUIFoldout.h" />
     <ClInclude Include="Include\BsGUIHoverHitBox.h" />
     <ClInclude Include="Include\BsGUIHoverHitBox.h" />
     <ClInclude Include="Include\BsGUIIntField.h" />
     <ClInclude Include="Include\BsGUIIntField.h" />
     <ClInclude Include="Include\BsGUIDropButton.h" />
     <ClInclude Include="Include\BsGUIDropButton.h" />
@@ -384,8 +382,6 @@
     <ClCompile Include="Source\BsGUIDockSlider.cpp" />
     <ClCompile Include="Source\BsGUIDockSlider.cpp" />
     <ClCompile Include="Source\BsGUIFieldBase.cpp" />
     <ClCompile Include="Source\BsGUIFieldBase.cpp" />
     <ClCompile Include="Source\BsGUIFloatField.cpp" />
     <ClCompile Include="Source\BsGUIFloatField.cpp" />
-    <ClCompile Include="Source\BsGUIComponentFoldout.cpp" />
-    <ClCompile Include="Source\BsGUIFoldout.cpp" />
     <ClCompile Include="Source\BsGUIHoverHitBox.cpp" />
     <ClCompile Include="Source\BsGUIHoverHitBox.cpp" />
     <ClCompile Include="Source\BsGUIIntField.cpp" />
     <ClCompile Include="Source\BsGUIIntField.cpp" />
     <ClCompile Include="Source\BsGUIMenuBar.cpp" />
     <ClCompile Include="Source\BsGUIMenuBar.cpp" />

+ 0 - 12
BansheeEditor/BansheeEditor.vcxproj.filters

@@ -123,9 +123,6 @@
     <ClInclude Include="Include\BsGUIColorField.h">
     <ClInclude Include="Include\BsGUIColorField.h">
       <Filter>Header Files</Filter>
       <Filter>Header Files</Filter>
     </ClInclude>
     </ClInclude>
-    <ClInclude Include="Include\BsGUIComponentFoldout.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Include\BsGUIDockSlider.h">
     <ClInclude Include="Include\BsGUIDockSlider.h">
       <Filter>Header Files</Filter>
       <Filter>Header Files</Filter>
     </ClInclude>
     </ClInclude>
@@ -138,9 +135,6 @@
     <ClInclude Include="Include\BsGUIFloatField.h">
     <ClInclude Include="Include\BsGUIFloatField.h">
       <Filter>Header Files</Filter>
       <Filter>Header Files</Filter>
     </ClInclude>
     </ClInclude>
-    <ClInclude Include="Include\BsGUIFoldout.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Include\BsGUIIntField.h">
     <ClInclude Include="Include\BsGUIIntField.h">
       <Filter>Header Files</Filter>
       <Filter>Header Files</Filter>
     </ClInclude>
     </ClInclude>
@@ -368,9 +362,6 @@
     <ClCompile Include="Source\BsGUIColorField.cpp">
     <ClCompile Include="Source\BsGUIColorField.cpp">
       <Filter>Source Files</Filter>
       <Filter>Source Files</Filter>
     </ClCompile>
     </ClCompile>
-    <ClCompile Include="Source\BsGUIComponentFoldout.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="Source\BsGUIDockSlider.cpp">
     <ClCompile Include="Source\BsGUIDockSlider.cpp">
       <Filter>Source Files</Filter>
       <Filter>Source Files</Filter>
     </ClCompile>
     </ClCompile>
@@ -383,9 +374,6 @@
     <ClCompile Include="Source\BsGUIFloatField.cpp">
     <ClCompile Include="Source\BsGUIFloatField.cpp">
       <Filter>Source Files</Filter>
       <Filter>Source Files</Filter>
     </ClCompile>
     </ClCompile>
-    <ClCompile Include="Source\BsGUIFoldout.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="Source\BsGUIIntField.cpp">
     <ClCompile Include="Source\BsGUIIntField.cpp">
       <Filter>Source Files</Filter>
       <Filter>Source Files</Filter>
     </ClCompile>
     </ClCompile>

+ 2 - 7
BansheeEditor/Include/BsBuiltinEditorResources.h

@@ -277,15 +277,10 @@ namespace BansheeEngine
 
 
 		static const WString FoldoutOpenNormalTex;
 		static const WString FoldoutOpenNormalTex;
 		static const WString FoldoutOpenHoverTex;
 		static const WString FoldoutOpenHoverTex;
+		static const WString FoldoutOpenActiveTex;
 		static const WString FoldoutClosedNormalTex;
 		static const WString FoldoutClosedNormalTex;
 		static const WString FoldoutClosedHoverTex;
 		static const WString FoldoutClosedHoverTex;
-
-		static const WString CmpFoldoutOpenNormalTex;
-		static const WString CmpFoldoutOpenHoverTex;
-		static const WString CmpFoldoutOpenActiveTex;
-		static const WString CmpFoldoutClosedNormalTex;
-		static const WString CmpFoldoutClosedHoverTex;
-		static const WString CmpFoldoutClosedActiveTex;
+		static const WString FoldoutClosedActiveTex;
 
 
 		static const WString InputBoxNormalTex;
 		static const WString InputBoxNormalTex;
 		static const WString InputBoxHoverTex;
 		static const WString InputBoxHoverTex;

+ 0 - 2
BansheeEditor/Include/BsEditorPrerequisites.h

@@ -39,8 +39,6 @@ namespace BansheeEngine
 	class GUIVector4Field;
 	class GUIVector4Field;
 	class GUIColorField;
 	class GUIColorField;
 	class GUIColor;
 	class GUIColor;
-	class GUIComponentFoldout;
-	class GUIFoldout;
 	class GUIStatusBar;
 	class GUIStatusBar;
 	class GUIDropButton;
 	class GUIDropButton;
 	class GUIHoverHitBox;
 	class GUIHoverHitBox;

+ 0 - 108
BansheeEditor/Include/BsGUIComponentFoldout.h

@@ -1,108 +0,0 @@
-#pragma once
-
-#include "BsEditorPrerequisites.h"
-#include "BsGUIElementContainer.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	GUI element that serves as a title for a Component object. The foldout
-	 *			displays a certain label (e.g. component name) and can be expanded or collapsed.
-	 *
-	 * @note	It's up to the caller to actually hook up what expanding or collapsing the foldout means,
-	 *			internally it just toggles a button.
-	 */
-	class BS_ED_EXPORT GUIComponentFoldout : public GUIElementContainer
-	{
-		struct PrivatelyConstruct {};
-
-	public:
-		/**
-		 * Returns type name of the GUI element used for finding GUI element styles. 
-		 */
-		static const String& getGUITypeName();
-
-		/**
-		 * Returns the style type name of the internal toggle button that triggers expand/collapse.
-		 */
-		static const String& getFoldoutButtonStyleType();
-
-		/**
-		 * Returns the style type name of the background texture.
-		 */
-		static const String& getFoldoutBgStyleType();
-
-		/**
-		 * @brief	Creates a new GUI component foldout element.
-		 *
-		 * @param	label			Label to display in the foldout title.
-		 * @param	options			Options that allow you to control how is the element positioned and sized.
-		 *							This will override any similar options set by style.
-		 * @param	styleName		Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIComponentFoldout* create(const HString& label, const GUIOptions& options, const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new GUI component foldout element.
-		 *
-		 * @param	label			Label to display in the foldout title.
-		 * @param	styleName		Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIComponentFoldout* create(const HString& label, const String& style = StringUtil::BLANK);
-
-		GUIComponentFoldout(const PrivatelyConstruct& dummy, const HString& label, const String& style, const GUIDimensions& dimensions);
-
-		/**
-		 * @brief	Returns whether the foldout is currently expanded or collapsed.
-		 */
-		bool isExpanded() const { return mIsExpanded; }
-
-		/**
-		 * @brief	Expands or collapses the foldout.
-		 */
-		void setExpanded(bool expanded);
-
-		/**
-		 * Changes the label displayed on the foldout.
-		 */
-		void setContent(const GUIContent& content);
-
-		/**
-		 * @copydoc	GUIElement::setTint
-		 */
-		virtual void setTint(const Color& color) override;
-
-		/**
-		 * @copydoc	GUIElement::_updateLayoutInternal
-		 */
-		void _updateLayoutInternal(const GUILayoutData& data) override;
-
-		/**
-		 * @copydoc	GUIElement::_getOptimalSize
-		 */
-		Vector2I _getOptimalSize() const override;
-
-		Event<void(bool)> onStateChanged;
-	protected:
-		virtual ~GUIComponentFoldout();
-
-		/**
-		 * @brief	Triggered when the foldout is expanded or collapsed.
-		 *			True means expanded, false collapsed.
-		 */
-		void toggleTriggered(bool value);
-
-		/**
-		 * @copydoc	GUIElement::styleUpdated
-		 */
-		void styleUpdated() override;
-
-		GUIToggle* mToggle;
-		GUITexture* mBackground;
-		bool mIsExpanded;
-	};
-}

+ 0 - 106
BansheeEditor/Include/BsGUIFoldout.h

@@ -1,106 +0,0 @@
-#pragma once
-
-#include "BsEditorPrerequisites.h"
-#include "BsGUIElementContainer.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Composite GUI element that contains a toggle button and a label.
-	 *			Used for handling expand/collapse operations, although it's up to
-	 *			the caller to actually handle the #onStateChanged event.
-	 */
-	class BS_ED_EXPORT GUIFoldout : public GUIElementContainer
-	{
-		struct PrivatelyConstruct {};
-
-	public:
-		/**
-		 * Returns type name of the GUI element used for finding GUI element styles. 
-		 */
-		static const String& getGUITypeName();
-
-		/**
-		 * Returns GUI style type name for the internal toggle button.
-		 */
-		static const String& getFoldoutButtonStyleType();
-
-		/**
-		 * Returns GUI style type name for the internal label.
-		 */
-		static const String& getLabelStyleType();
-
-		/**
-		 * @brief	Creates a new GUI foldout element.
-		 *
-		 * @param	label			Label to display in the foldout title.
-		 * @param	options			Options that allow you to control how is the element positioned and sized.
-		 *							This will override any similar options set by style.
-		 * @param	styleName		Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIFoldout* create(const HString& label, const GUIOptions& options, const String& style = StringUtil::BLANK);
-
-		/**
-		 * @brief	Creates a new GUI foldout element.
-		 *
-		 * @param	label			Label to display in the foldout title.
-		 * @param	styleName		Optional style to use for the element. Style will be retrieved
-		 *							from GUISkin of the GUIWidget the element is used on. If not specified
-		 *							default style is used.
-		 */
-		static GUIFoldout* create(const HString& label, const String& style = StringUtil::BLANK);
-
-		GUIFoldout(const PrivatelyConstruct& dummy, const HString& label, const String& style, const GUIDimensions& dimensions);
-
-		/**
-		 * @brief	Checks is the foldout expanded (i.e. the toggle button is active)
-		 */
-		bool isExpanded() const { return mIsExpanded; }
-
-		/**
-		 * @brief	Expands or collapses the foldout (i.e. changes the toggle button state)
-		 */
-		void setExpanded(bool expanded);
-
-		/**
-		 * Changes the label of the foldout.
-		 */
-		void setContent(const GUIContent& content);
-
-		/**
-		 * @copydoc	GUIElement::setTint
-		 */
-		virtual void setTint(const Color& color) override;
-
-		/**
-		 * @copydoc	GUIElement::_updateLayoutInternal
-		 */
-		void _updateLayoutInternal(const GUILayoutData& data) override;
-
-		/**
-		 * @copydoc	GUIElement::_getOptimalSize
-		 */
-		Vector2I _getOptimalSize() const override;
-
-		Event<void(bool)> onStateChanged; /**< Triggered when the foldout is expanded or collapsed. True means expanded, false otherwise. */
-	protected:
-		virtual ~GUIFoldout();
-
-		/**
-		 * @brief	Callback triggered when the internal toggle button is toggled.
-		 */
-		void toggleTriggered(bool value);
-
-		/**
-		 * @copydoc	GUIElement::_getOptimalSize
-		 */
-		void styleUpdated() override;
-
-		GUILabel* mLabel;
-		GUIToggle* mToggle;
-
-		bool mIsExpanded;
-	};
-}

+ 32 - 86
BansheeEditor/Source/BsBuiltinEditorResources.cpp

@@ -20,8 +20,6 @@
 #include "BsGUIVector2Field.h"
 #include "BsGUIVector2Field.h"
 #include "BsGUIVector3Field.h"
 #include "BsGUIVector3Field.h"
 #include "BsGUIVector4Field.h"
 #include "BsGUIVector4Field.h"
-#include "BsGUIComponentFoldout.h"
-#include "BsGUIFoldout.h"
 #include "BsGUIProgressBar.h"
 #include "BsGUIProgressBar.h"
 #include "BsGUISlider.h"
 #include "BsGUISlider.h"
 #include "BsGUIDropDownContent.h"
 #include "BsGUIDropDownContent.h"
@@ -139,17 +137,12 @@ namespace BansheeEngine
 	const WString BuiltinEditorResources::SliderHandleHoverTex = L"SliderHandleHover.png";
 	const WString BuiltinEditorResources::SliderHandleHoverTex = L"SliderHandleHover.png";
 	const WString BuiltinEditorResources::SliderHandleActiveTex = L"SliderHandleActive.png";
 	const WString BuiltinEditorResources::SliderHandleActiveTex = L"SliderHandleActive.png";
 
 
-	const WString BuiltinEditorResources::FoldoutOpenNormalTex = L"ExpandArrowNormalOn.png";
-	const WString BuiltinEditorResources::FoldoutOpenHoverTex = L"ExpandArrowHoverOn.png";
-	const WString BuiltinEditorResources::FoldoutClosedNormalTex = L"ExpandArrowNormalOff.png";
-	const WString BuiltinEditorResources::FoldoutClosedHoverTex = L"ExpandArrowHoverOff.png";
-
-	const WString BuiltinEditorResources::CmpFoldoutOpenNormalTex = L"ComponentExpandNormalOn.png";
-	const WString BuiltinEditorResources::CmpFoldoutOpenHoverTex = L"ComponentExpandHoverOn.png";
-	const WString BuiltinEditorResources::CmpFoldoutOpenActiveTex = L"ComponentExpandHoverOn.png";
-	const WString BuiltinEditorResources::CmpFoldoutClosedNormalTex = L"ComponentExpandNormalOff.png";
-	const WString BuiltinEditorResources::CmpFoldoutClosedHoverTex = L"ComponentExpandHoverOff.png";
-	const WString BuiltinEditorResources::CmpFoldoutClosedActiveTex = L"ComponentExpandHoverOff.png";
+	const WString BuiltinEditorResources::FoldoutOpenNormalTex = L"FoldoutNormalOn.png";
+	const WString BuiltinEditorResources::FoldoutOpenHoverTex = L"FoldoutHoverOn.png";
+	const WString BuiltinEditorResources::FoldoutOpenActiveTex = L"FoldoutHoverOn.png";
+	const WString BuiltinEditorResources::FoldoutClosedNormalTex = L"FoldoutNormalOff.png";
+	const WString BuiltinEditorResources::FoldoutClosedHoverTex = L"FoldoutHoverOff.png";
+	const WString BuiltinEditorResources::FoldoutClosedActiveTex = L"FoldoutHoverOff.png";
 
 
 	const WString BuiltinEditorResources::WindowBackgroundTex = L"WindowBackground.png";
 	const WString BuiltinEditorResources::WindowBackgroundTex = L"WindowBackground.png";
 
 
@@ -1341,85 +1334,38 @@ namespace BansheeEngine
 
 
 		skin->setStyle(GUIVector4Field::getGUITypeName(), editorVector4FieldStyle);
 		skin->setStyle(GUIVector4Field::getGUITypeName(), editorVector4FieldStyle);
 
 
-		/************************************************************************/
-		/* 							COMPONENT FOLDOUT                      		*/
-		/************************************************************************/
-		GUIElementStyle cmpFoldoutBtnStyle;
-		cmpFoldoutBtnStyle.normal.texture = getGUITexture(CmpFoldoutClosedNormalTex);
-		cmpFoldoutBtnStyle.hover.texture = getGUITexture(CmpFoldoutClosedHoverTex);
-		cmpFoldoutBtnStyle.active.texture = getGUITexture(CmpFoldoutOpenActiveTex);
-		cmpFoldoutBtnStyle.normalOn.texture = getGUITexture(CmpFoldoutOpenNormalTex);
-		cmpFoldoutBtnStyle.hoverOn.texture = getGUITexture(CmpFoldoutOpenHoverTex);
-		cmpFoldoutBtnStyle.activeOn.texture = getGUITexture(CmpFoldoutOpenActiveTex);
-		cmpFoldoutBtnStyle.normal.textColor = TextNormalColor;
-		cmpFoldoutBtnStyle.hover.textColor = TextNormalColor;
-		cmpFoldoutBtnStyle.active.textColor = TextNormalColor;
-		cmpFoldoutBtnStyle.normalOn.textColor = TextNormalColor;
-		cmpFoldoutBtnStyle.hoverOn.textColor = TextNormalColor;
-		cmpFoldoutBtnStyle.activeOn.textColor = TextNormalColor;
-		cmpFoldoutBtnStyle.fixedHeight = true;
-		cmpFoldoutBtnStyle.fixedWidth = false;
-		cmpFoldoutBtnStyle.height = 21;
-		cmpFoldoutBtnStyle.minWidth = 17;
-		cmpFoldoutBtnStyle.font = font;
-		cmpFoldoutBtnStyle.fontSize = DefaultFontSize;
-		cmpFoldoutBtnStyle.textHorzAlign = THA_Left;
-		cmpFoldoutBtnStyle.textVertAlign = TVA_Center;
-		cmpFoldoutBtnStyle.contentOffset = RectOffset(16, 0, 0, 0);
-		cmpFoldoutBtnStyle.border.left = 15;
-		cmpFoldoutBtnStyle.border.right = 2;
-		cmpFoldoutBtnStyle.border.top = 2;
-		cmpFoldoutBtnStyle.border.bottom = 4;
-
-		skin->setStyle(GUIComponentFoldout::getFoldoutButtonStyleType(), cmpFoldoutBtnStyle);
-
-		// Component foldout background
-		GUIElementStyle cmpFoldoutBgStyle;
-		cmpFoldoutBgStyle.normal.texture = getGUITexture(ButtonNormalTex);
-		cmpFoldoutBgStyle.border.left = 2;
-		cmpFoldoutBgStyle.border.right = 2;
-		cmpFoldoutBgStyle.border.top = 2;
-		cmpFoldoutBgStyle.border.bottom = 4;
-		cmpFoldoutBgStyle.fixedHeight = true;
-		cmpFoldoutBgStyle.height = 21;
-		cmpFoldoutBgStyle.minWidth = 20;
-
-		skin->setStyle(GUIComponentFoldout::getFoldoutBgStyleType(), cmpFoldoutBgStyle);
-
-		GUIElementStyle cmpFoldoutStyle;
-		cmpFoldoutStyle.fixedHeight = true;
-		cmpFoldoutStyle.height = 21;
-		cmpFoldoutStyle.minWidth = 30;
-		cmpFoldoutStyle.subStyles[GUIComponentFoldout::getFoldoutButtonStyleType()] = GUIComponentFoldout::getFoldoutButtonStyleType();
-		cmpFoldoutStyle.subStyles[GUIComponentFoldout::getFoldoutBgStyleType()] = GUIComponentFoldout::getFoldoutBgStyleType();
-
-		skin->setStyle(GUIComponentFoldout::getGUITypeName(), cmpFoldoutStyle);
-
 		/************************************************************************/
 		/************************************************************************/
 		/* 							     FOLDOUT                      		    */
 		/* 							     FOLDOUT                      		    */
 		/************************************************************************/
 		/************************************************************************/
-		GUIElementStyle foldoutBtnStyle;
-		foldoutBtnStyle.normal.texture = getGUITexture(FoldoutClosedNormalTex);
-		foldoutBtnStyle.hover.texture = getGUITexture(FoldoutClosedHoverTex);
-		foldoutBtnStyle.active.texture = foldoutBtnStyle.hover.texture;
-		foldoutBtnStyle.normalOn.texture = getGUITexture(FoldoutOpenNormalTex);
-		foldoutBtnStyle.hoverOn.texture = getGUITexture(FoldoutOpenHoverTex);
-		foldoutBtnStyle.activeOn.texture = foldoutBtnStyle.hoverOn.texture;
-		foldoutBtnStyle.fixedHeight = true;
-		foldoutBtnStyle.fixedWidth = true;
-		foldoutBtnStyle.height = 10;
-		foldoutBtnStyle.width = 10;
-
-		skin->setStyle(GUIFoldout::getFoldoutButtonStyleType(), foldoutBtnStyle);
 
 
 		GUIElementStyle foldoutStyle;
 		GUIElementStyle foldoutStyle;
+		foldoutStyle.normal.texture = getGUITexture(FoldoutClosedNormalTex);
+		foldoutStyle.hover.texture = getGUITexture(FoldoutClosedHoverTex);
+		foldoutStyle.active.texture = getGUITexture(FoldoutOpenActiveTex);
+		foldoutStyle.normalOn.texture = getGUITexture(FoldoutOpenNormalTex);
+		foldoutStyle.hoverOn.texture = getGUITexture(FoldoutOpenHoverTex);
+		foldoutStyle.activeOn.texture = getGUITexture(FoldoutOpenActiveTex);
+		foldoutStyle.normal.textColor = TextNormalColor;
+		foldoutStyle.hover.textColor = TextNormalColor;
+		foldoutStyle.active.textColor = TextNormalColor;
+		foldoutStyle.normalOn.textColor = TextNormalColor;
+		foldoutStyle.hoverOn.textColor = TextNormalColor;
+		foldoutStyle.activeOn.textColor = TextNormalColor;
 		foldoutStyle.fixedHeight = true;
 		foldoutStyle.fixedHeight = true;
-		foldoutStyle.height = 12;
-		foldoutStyle.minWidth = 30;
-		foldoutStyle.subStyles[GUIFoldout::getLabelStyleType()] = GUIFoldout::getLabelStyleType();
-		foldoutStyle.subStyles[GUIFoldout::getFoldoutButtonStyleType()] = GUIFoldout::getFoldoutButtonStyleType();
-
-		skin->setStyle(GUIFoldout::getGUITypeName(), foldoutStyle);
+		foldoutStyle.fixedWidth = false;
+		foldoutStyle.height = 21;
+		foldoutStyle.minWidth = 17;
+		foldoutStyle.font = font;
+		foldoutStyle.fontSize = DefaultFontSize;
+		foldoutStyle.textHorzAlign = THA_Left;
+		foldoutStyle.textVertAlign = TVA_Center;
+		foldoutStyle.contentOffset = RectOffset(16, 0, 0, 0);
+		foldoutStyle.border.left = 15;
+		foldoutStyle.border.right = 2;
+		foldoutStyle.border.top = 2;
+		foldoutStyle.border.bottom = 4;
+
+		skin->setStyle("Foldout", foldoutStyle);
 
 
 		/************************************************************************/
 		/************************************************************************/
 		/* 								PROGRESS BAR                      		*/
 		/* 								PROGRESS BAR                      		*/

+ 0 - 132
BansheeEditor/Source/BsGUIComponentFoldout.cpp

@@ -1,132 +0,0 @@
-#include "BsGUIComponentFoldout.h"
-#include "BsGUILayout.h"
-#include "BsGUILabel.h"
-#include "BsGUIToggle.h"
-#include "BsGUIButton.h"
-#include "BsGUITexture.h"
-#include "BsBuiltinResources.h"
-#include "BsCGUIWidget.h"
-#include "BsGUIMouseEvent.h"
-
-using namespace std::placeholders;
-
-namespace BansheeEngine
-{
-	GUIComponentFoldout::GUIComponentFoldout(const PrivatelyConstruct& dummy, const HString& label, const String& style,
-		const GUIDimensions& dimensions)
-		:GUIElementContainer(dimensions, style), mToggle(nullptr), mBackground(nullptr), mIsExpanded(false)
-	{
-		mToggle = GUIToggle::create(label, getSubStyleName(getFoldoutButtonStyleType()));
-		mBackground = GUITexture::create(getSubStyleName(getFoldoutBgStyleType()));
-
-		_registerChildElement(mToggle);
-		_registerChildElement(mBackground);
-
-		mToggle->onToggled.connect(std::bind(&GUIComponentFoldout::toggleTriggered, this, _1));
-		mBackground->_setElementDepth(2);
-	}
-
-	GUIComponentFoldout::~GUIComponentFoldout()
-	{
-
-	}
-
-	GUIComponentFoldout* GUIComponentFoldout::create(const HString& label, const GUIOptions& options,
-		const String& style)
-	{
-		const String* curStyle = &style;
-		if (*curStyle == StringUtil::BLANK)
-			curStyle = &getGUITypeName();
-
-		return bs_new<GUIComponentFoldout>(PrivatelyConstruct(), label, *curStyle, GUIDimensions::create(options));
-	}
-
-	GUIComponentFoldout* GUIComponentFoldout::create(const HString& label, const String& style)
-	{
-		const String* curStyle = &style;
-		if (*curStyle == StringUtil::BLANK)
-			curStyle = &getGUITypeName();
-
-		return bs_new<GUIComponentFoldout>(PrivatelyConstruct(), label, *curStyle, GUIDimensions::create());
-	}
-
-	void GUIComponentFoldout::setExpanded(bool expanded)
-	{
-		if(mIsExpanded != expanded)
-		{
-			mIsExpanded = expanded;
-
-			if(mIsExpanded)
-				mToggle->toggleOn();
-			else
-				mToggle->toggleOff();
-
-			if(!onStateChanged.empty())
-				onStateChanged(mIsExpanded);
-		}
-	}
-
-	void GUIComponentFoldout::setContent(const GUIContent& content)
-	{
-		mToggle->setContent(content);
-	}
-
-	void GUIComponentFoldout::setTint(const Color& color)
-	{
-		mToggle->setTint(color);
-	}
-
-	void GUIComponentFoldout::toggleTriggered(bool value)
-	{
-		mIsExpanded = value;
-
-		onStateChanged(value);
-	}
-
-	void GUIComponentFoldout::_updateLayoutInternal(const GUILayoutData& data)
-	{
-		Vector2I toggleOptSize = mToggle->_getOptimalSize();
-		{
-			INT32 yOffset = Math::roundToInt(((INT32)data.area.height - toggleOptSize.y) * 0.5f);
-
-			GUILayoutData childData = data;
-			childData.area.y += yOffset;
-			childData.area.height = toggleOptSize.y;
-
-			mToggle->_setLayoutData(childData);
-		}
-
-		mBackground->_setLayoutData(data);
-	}
-
-	Vector2I GUIComponentFoldout::_getOptimalSize() const
-	{
-		Vector2I optimalsize = mToggle->_getOptimalSize();
-
-		return optimalsize;
-	}
-
-	void GUIComponentFoldout::styleUpdated()
-	{
-		mToggle->setStyle(getSubStyleName(getFoldoutButtonStyleType()));
-		mBackground->setStyle(getSubStyleName(getFoldoutBgStyleType()));
-	}
-
-	const String& GUIComponentFoldout::getGUITypeName()
-	{
-		static String typeName = "ComponentFoldout";
-		return typeName;
-	}
-
-	const String& GUIComponentFoldout::getFoldoutButtonStyleType()
-	{
-		static String FOLDOUT_BUTTON_STYLE = "ComponentFoldoutButton";
-		return FOLDOUT_BUTTON_STYLE;		
-	}
-
-	const String& GUIComponentFoldout::getFoldoutBgStyleType()
-	{
-		static String FOLDOUT_BACKGROUND_STYLE = "ComponentFoldoutBg";
-		return FOLDOUT_BACKGROUND_STYLE;
-	}
-}

+ 0 - 151
BansheeEditor/Source/BsGUIFoldout.cpp

@@ -1,151 +0,0 @@
-#include "BsGUIFoldout.h"
-#include "BsGUILayout.h"
-#include "BsGUILabel.h"
-#include "BsGUIToggle.h"
-#include "BsGUITexture.h"
-#include "BsBuiltinResources.h"
-#include "BsCGUIWidget.h"
-#include "BsGUIMouseEvent.h"
-
-using namespace std::placeholders;
-
-namespace BansheeEngine
-{
-	GUIFoldout::GUIFoldout(const PrivatelyConstruct& dummy, const HString& label, const String& style,
-		const GUIDimensions& dimensions)
-		:GUIElementContainer(dimensions, style), mToggle(nullptr), mIsExpanded(false)
-	{
-		mLabel = GUILabel::create(label, getSubStyleName(getLabelStyleType()));
-		mToggle = GUIToggle::create(HString(L""), getSubStyleName(getFoldoutButtonStyleType()));
-
-		_registerChildElement(mLabel);
-		_registerChildElement(mToggle);
-
-		mToggle->onToggled.connect(std::bind(&GUIFoldout::toggleTriggered, this, _1));
-	}
-
-	GUIFoldout::~GUIFoldout()
-	{
-
-	}
-
-	GUIFoldout* GUIFoldout::create(const HString& label, const GUIOptions& options,
-		const String& style)
-	{
-		const String* curStyle = &style;
-		if (*curStyle == StringUtil::BLANK)
-			curStyle = &getGUITypeName();
-
-		return bs_new<GUIFoldout>(PrivatelyConstruct(), label, *curStyle, GUIDimensions::create(options));
-	}
-
-	GUIFoldout* GUIFoldout::create(const HString& label, const String& style)
-	{
-		const String* curStyle = &style;
-		if (*curStyle == StringUtil::BLANK)
-			curStyle = &getGUITypeName();
-
-		return bs_new<GUIFoldout>(PrivatelyConstruct(), label, *curStyle, GUIDimensions::create());
-	}
-
-	void GUIFoldout::setExpanded(bool expanded)
-	{
-		if (mIsExpanded != expanded)
-		{
-			mIsExpanded = expanded;
-
-			if (mIsExpanded)
-				mToggle->toggleOn();
-			else
-				mToggle->toggleOff();
-
-			if (!onStateChanged.empty())
-				onStateChanged(mIsExpanded);
-		}
-	}
-
-	void GUIFoldout::setContent(const GUIContent& content)
-	{
-		mLabel->setContent(content);
-	}
-
-	void GUIFoldout::setTint(const Color& color)
-	{
-		mLabel->setTint(color);
-		mToggle->setTint(color);
-	}
-
-	void GUIFoldout::toggleTriggered(bool value)
-	{
-		mIsExpanded = value;
-
-		onStateChanged(value);
-	}
-
-	void GUIFoldout::_updateLayoutInternal(const GUILayoutData& data)
-	{
-		UINT32 toggleOffset = 0;
-
-		{
-			Vector2I optimalSize = mToggle->_getOptimalSize();
-			INT32 yOffset = Math::roundToInt(((INT32)data.area.height - optimalSize.y) * 0.5f);
-
-			GUILayoutData childData = data;
-			childData.area.y += yOffset;
-			childData.area.width = optimalSize.x;
-			childData.area.height = optimalSize.y;
-
-			mToggle->_setLayoutData(childData);
-
-			toggleOffset = optimalSize.x + 3; // +3 = arbitrary spacing
-		}
-
-		{
-			Vector2I optimalSize = mLabel->_getOptimalSize();
-			INT32 yOffset = Math::roundToInt(((INT32)data.area.height - optimalSize.y) * 0.5f);
-
-			GUILayoutData childData = data;
-			childData.area.x += toggleOffset;
-			childData.area.y += yOffset;
-			childData.area.width = optimalSize.x;
-			childData.area.height = optimalSize.y;
-
-			mLabel->_setLayoutData(childData);
-		}
-	}
-
-	Vector2I GUIFoldout::_getOptimalSize() const
-	{
-		Vector2I optimalsize = mToggle->_getOptimalSize();
-		Vector2I labelOptimalSize = mLabel->_getOptimalSize();
-
-		optimalsize.x += labelOptimalSize.x;
-		optimalsize.y = std::max(optimalsize.y, labelOptimalSize.y);
-
-		return mDimensions.calculateSizeRange(optimalsize).optimal;
-	}
-
-	void GUIFoldout::styleUpdated()
-	{
-		mLabel->setStyle(getSubStyleName(getLabelStyleType()));
-		mToggle->setStyle(getSubStyleName(getFoldoutButtonStyleType()));
-	}
-
-	const String& GUIFoldout::getGUITypeName()
-	{
-		static String typeName = "Foldout";
-		return typeName;
-	}
-
-	const String& GUIFoldout::getFoldoutButtonStyleType()
-	{
-		static String FOLDOUT_BUTTON_STYLE = "FoldoutButton";
-		return FOLDOUT_BUTTON_STYLE;
-	}
-
-	const String& GUIFoldout::getLabelStyleType()
-	{
-		static String FOLDOUT_LABEL_STYLE = "EditorFieldLabel";
-		return FOLDOUT_LABEL_STYLE;
-	}
-}

+ 1 - 1
MBansheeEditor/EditorStyles.cs

@@ -17,7 +17,7 @@ namespace BansheeEditor
         public const string ButtonRight = "ButtonRight";
         public const string ButtonRight = "ButtonRight";
         public const string Toggle = "Toggle";
         public const string Toggle = "Toggle";
         public const string InputBox = "InputBox";
         public const string InputBox = "InputBox";
-        public const string Foldout = "ComponentFoldoutButton";
+        public const string Foldout = "Foldout";
         public const string ColorSliderHorz = "ColorSliderHorz";
         public const string ColorSliderHorz = "ColorSliderHorz";
         public const string ColorSliderVert = "ColorSliderVert";
         public const string ColorSliderVert = "ColorSliderVert";
         public const string ColorSlider2DHandle = "ColorSlider2DHandle";
         public const string ColorSlider2DHandle = "ColorSlider2DHandle";

+ 0 - 114
MBansheeEditor/GUI/GUIComponentFoldout.cs

@@ -1,114 +0,0 @@
-using System;
-using System.Runtime.CompilerServices;
-using BansheeEngine;
-
-namespace BansheeEditor
-{
-    /// <summary>
-    /// GUI element that displays a foldout button that can be expanded or collapsed.
-    /// </summary>
-    public sealed class GUIComponentFoldout : GUIElement
-    {
-        /// <summary>
-        /// Triggered when the foldout is expanded or collapsed.
-        /// </summary>
-        public event Action<bool> OnToggled;
-
-        /// <summary>
-        /// Creates a new foldout element.
-        /// </summary>
-        /// <param name="content">Content to display on the button.</param>
-        /// <param name="style">Optional style to use for the element. Style controls the look of the element, as well as 
-        ///                     default layout options. Style will be retrieved from the active GUISkin. If not specified 
-        ///                     default element style is used.</param>
-        /// <param name="options">Options that allow you to control how is the element  positioned and sized. This will 
-        ///                       override any similar options set by style.</param>
-        public GUIComponentFoldout(GUIContent content, string style, params GUIOption[] options)
-        {
-            Internal_CreateInstance(this, content, style, options);
-        }
-
-        /// <summary>
-        /// Creates a new foldout element.
-        /// </summary>
-        /// <param name="content">Content to display on the button.</param>
-        /// <param name="style">Optional style to use for the element. Style controls the look of the element, as well as 
-        ///                     default layout options. Style will be retrieved from the active GUISkin. If not specified 
-        ///                     default element style is used.</param>
-        public GUIComponentFoldout(GUIContent content, string style)
-        {
-            Internal_CreateInstance(this, content, style, new GUIOption[0]);
-        }
-
-        /// <summary>
-        /// Creates a new foldout element.
-        /// </summary>
-        /// <param name="content">Content to display on the button.</param>
-        /// <param name="options">Options that allow you to control how is the element  positioned and sized. This will 
-        ///                       override any similar options set by style.</param>
-        public GUIComponentFoldout(GUIContent content, params GUIOption[] options)
-        {
-            Internal_CreateInstance(this, content, "", options);
-        }
-
-        /// <summary>
-        /// Changes the contents displayed on the button.
-        /// </summary>
-        /// <param name="content">Content to display on the button.</param>
-        public void SetContent(GUIContent content)
-        {
-            Internal_SetContent(mCachedPtr, content);
-        }
-
-        /// <summary>
-        /// Determines is the foldout expanded or collapsed.
-        /// </summary>
-        public bool Expanded
-        {
-            get
-            {
-                bool expanded;
-                Internal_IsExpanded(mCachedPtr, out expanded);
-                return expanded;
-            }
-            set
-            {
-                Internal_SetExpanded(mCachedPtr, value);
-            }
-        }
-
-        /// <summary>
-        /// Colors the element with a specific tint.
-        /// </summary>
-        /// <param name="color">Tint to apply to the element.</param>
-        public void SetTint(Color color)
-        {
-            Internal_SetTint(mCachedPtr, color);
-        }
-
-        /// <summary>
-        /// Triggered by the runtime when the foldout button is toggled.
-        /// </summary>
-        /// <param name="expanded">True if the foldout has been expanded, false if collapsed.</param>
-        private void DoOnToggled(bool expanded)
-        {
-            if (OnToggled != null)
-                OnToggled(expanded);
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(GUIComponentFoldout instance, GUIContent content, string style, GUIOption[] options);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetContent(IntPtr nativeInstance, GUIContent content);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetExpanded(IntPtr nativeInstance, bool expanded);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_IsExpanded(IntPtr nativeInstance, out bool expanded);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetTint(IntPtr nativeInstance, Color color);
-    }
-}

+ 0 - 71
MBansheeEditor/GUI/GUIFoldout.cs

@@ -1,71 +0,0 @@
-using System;
-using System.Runtime.CompilerServices;
-using BansheeEngine;
-
-namespace BansheeEditor
-{
-    public sealed class GUIFoldout : GUIElement
-    {
-        public delegate void OnToggledDelegate(bool expanded);
-
-        public event OnToggledDelegate OnToggled;
-
-        public GUIFoldout(GUIContent content, string style, params GUIOption[] options)
-        {
-            Internal_CreateInstance(this, content, style, options);
-        }
-
-        public GUIFoldout(GUIContent content, string style)
-        {
-            Internal_CreateInstance(this, content, style, new GUIOption[0]);
-        }
-
-        public GUIFoldout(GUIContent content, params GUIOption[] options)
-        {
-            Internal_CreateInstance(this, content, "", options);
-        }
-
-        public void SetContent(GUIContent content)
-        {
-            Internal_SetContent(mCachedPtr, content);
-        }
-
-        public bool IsExpanded()
-        {
-            bool expanded;
-            Internal_IsExpanded(mCachedPtr, out expanded);
-            return expanded;
-        }
-
-        public void SetExpanded(bool expanded)
-        {
-            Internal_SetExpanded(mCachedPtr, expanded);
-        }
-
-        public void SetTint(Color color)
-        {
-            Internal_SetTint(mCachedPtr, color);
-        }
-
-        private void DoOnToggled(bool expanded)
-        {
-            if (OnToggled != null)
-                OnToggled(expanded);
-        }
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(GUIFoldout instance, GUIContent content, string style, GUIOption[] options);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetContent(IntPtr nativeInstance, GUIContent content);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetExpanded(IntPtr nativeInstance, bool expanded);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_IsExpanded(IntPtr nativeInstance, out bool expanded);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetTint(IntPtr nativeInstance, Color color);
-    }
-}

+ 2 - 2
MBansheeEditor/Inspector/InspectableArray.cs

@@ -163,8 +163,8 @@ namespace BansheeEditor
             }
             }
             else
             else
             {
             {
-                GUIFoldout guiFoldout = new GUIFoldout(title, GUIOption.FixedWidth(100));
-                guiFoldout.SetExpanded(isExpanded);
+                GUIToggle guiFoldout = new GUIToggle(title, EditorStyles.Foldout, GUIOption.FixedWidth(100));
+                guiFoldout.Value = isExpanded;
                 guiFoldout.OnToggled += OnFoldoutToggled;
                 guiFoldout.OnToggled += OnFoldoutToggled;
                 guiSizeField = new GUIIntField();
                 guiSizeField = new GUIIntField();
                 guiSizeField.SetRange(0, int.MaxValue);
                 guiSizeField.SetRange(0, int.MaxValue);

+ 2 - 2
MBansheeEditor/Inspector/InspectableList.cs

@@ -163,8 +163,8 @@ namespace BansheeEditor
             }
             }
             else
             else
             {
             {
-                GUIFoldout guiFoldout = new GUIFoldout(title, GUIOption.FixedWidth(100));
-                guiFoldout.SetExpanded(isExpanded);
+                GUIToggle guiFoldout = new GUIToggle(title, EditorStyles.Foldout, GUIOption.FixedWidth(100));
+                guiFoldout.Value = isExpanded;
                 guiFoldout.OnToggled += OnFoldoutToggled;
                 guiFoldout.OnToggled += OnFoldoutToggled;
                 guiSizeField = new GUIIntField();
                 guiSizeField = new GUIIntField();
                 guiSizeField.SetRange(0, int.MaxValue);
                 guiSizeField.SetRange(0, int.MaxValue);

+ 2 - 2
MBansheeEditor/Inspector/InspectableObject.cs

@@ -76,8 +76,8 @@ namespace BansheeEditor
             {
             {
                 guiTitleLayout = layout.AddLayoutX(index);
                 guiTitleLayout = layout.AddLayoutX(index);
 
 
-                GUIFoldout guiFoldout = new GUIFoldout(title, GUIOption.FixedWidth(100));
-                guiFoldout.SetExpanded(isExpanded);
+                GUIToggle guiFoldout = new GUIToggle(title, EditorStyles.Foldout, GUIOption.FixedWidth(100));
+                guiFoldout.Value = isExpanded;
                 guiFoldout.OnToggled += OnFoldoutToggled;
                 guiFoldout.OnToggled += OnFoldoutToggled;
                 guiTitleLayout.AddElement(guiFoldout);
                 guiTitleLayout.AddElement(guiFoldout);
 
 

+ 0 - 2
MBansheeEditor/MBansheeEditor.csproj

@@ -70,13 +70,11 @@
     <Compile Include="EditorStyles.cs" />
     <Compile Include="EditorStyles.cs" />
     <Compile Include="EditorUtility.cs" />
     <Compile Include="EditorUtility.cs" />
     <Compile Include="EditorWindow.cs" />
     <Compile Include="EditorWindow.cs" />
-    <Compile Include="GUI\GUIFoldout.cs" />
     <Compile Include="GUI\GUIGameObjectField.cs" />
     <Compile Include="GUI\GUIGameObjectField.cs" />
     <Compile Include="GUI\GUIResourceField.cs" />
     <Compile Include="GUI\GUIResourceField.cs" />
     <Compile Include="GUI\GUIVector3Field.cs" />
     <Compile Include="GUI\GUIVector3Field.cs" />
     <Compile Include="GUI\GUIColorField.cs" />
     <Compile Include="GUI\GUIColorField.cs" />
     <Compile Include="GUI\GUIFloatField.cs" />
     <Compile Include="GUI\GUIFloatField.cs" />
-    <Compile Include="GUI\GUIComponentFoldout.cs" />
     <Compile Include="GUI\GUIIntField.cs" />
     <Compile Include="GUI\GUIIntField.cs" />
     <Compile Include="GUI\GUITextField.cs" />
     <Compile Include="GUI\GUITextField.cs" />
     <Compile Include="GUI\GUIToggleField.cs" />
     <Compile Include="GUI\GUIToggleField.cs" />

+ 0 - 40
SBansheeEditor/Include/BsScriptGUIComponentFoldout.h

@@ -1,40 +0,0 @@
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptGUIElement.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for GUIComponentFoldout.
-	 */
-	class BS_SCR_BED_EXPORT ScriptGUIComponentFoldout : public TScriptGUIElement<ScriptGUIComponentFoldout>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIComponentFoldout")
-
-	private:
-		/**
-		 * @brief	Triggered when the foldout is expanded or collapsed.
-		 *
-		 * @param	instance	Managed GUIComponentFoldout instance.
-		 * @param	expanded	True if the foldout is now expanded, false otherwise.
-		 */
-		static void onToggled(MonoObject* instance, bool expanded);
-
-		ScriptGUIComponentFoldout(MonoObject* instance, GUIComponentFoldout* foldout);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoObject* content, MonoString* style, MonoArray* guiOptions);
-		static void internal_setContent(ScriptGUIComponentFoldout* nativeInstance, MonoObject* content);
-		static void internal_setExpanded(ScriptGUIComponentFoldout* nativeInstance, bool expanded);
-		static void internal_getIsExpanded(ScriptGUIComponentFoldout* nativeInstance, bool* isExpanded);
-		static void internal_setTint(ScriptGUIComponentFoldout* nativeInstance, Color color);
-
-		typedef void (__stdcall *OnToggledThunkDef) (MonoObject*, bool, MonoException**);
-
-		static OnToggledThunkDef onToggledThunk;
-	};
-}

+ 0 - 40
SBansheeEditor/Include/BsScriptGUIFoldout.h

@@ -1,40 +0,0 @@
-#pragma once
-
-#include "BsScriptEditorPrerequisites.h"
-#include "BsScriptGUIElement.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Interop class between C++ & CLR for GUIFoldout.
-	 */
-	class BS_SCR_BED_EXPORT ScriptGUIFoldout : public TScriptGUIElement<ScriptGUIFoldout>
-	{
-	public:
-		SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIFoldout")
-
-	private:
-		/**
-		 * @brief	Triggered when the foldout is expanded or collapsed.
-		 *
-		 * @param	instance	Managed GUIFoldout instance.
-		 * @param	expanded	True if the foldout is now expanded, false otherwise.
-		 */
-		static void onToggled(MonoObject* instance, bool expanded);
-
-		ScriptGUIFoldout(MonoObject* instance, GUIFoldout* foldout);
-
-		/************************************************************************/
-		/* 								CLR HOOKS						   		*/
-		/************************************************************************/
-		static void internal_createInstance(MonoObject* instance, MonoObject* content, MonoString* style, MonoArray* guiOptions);
-		static void internal_setContent(ScriptGUIFoldout* nativeInstance, MonoObject* content);
-		static void internal_setExpanded(ScriptGUIFoldout* nativeInstance, bool expanded);
-		static void internal_getIsExpanded(ScriptGUIFoldout* nativeInstance, bool* isExpanded);
-		static void internal_setTint(ScriptGUIFoldout* nativeInstance, Color color);
-
-		typedef void(__stdcall *OnToggledThunkDef) (MonoObject*, bool, MonoException**);
-
-		static OnToggledThunkDef onToggledThunk;
-	};
-}

+ 0 - 4
SBansheeEditor/SBansheeEditor.vcxproj

@@ -260,8 +260,6 @@
     <ClInclude Include="Include\BsScriptGizmos.h" />
     <ClInclude Include="Include\BsScriptGizmos.h" />
     <ClInclude Include="Include\BsScriptGUIColorField.h" />
     <ClInclude Include="Include\BsScriptGUIColorField.h" />
     <ClInclude Include="Include\BsScriptGUIFloatField.h" />
     <ClInclude Include="Include\BsScriptGUIFloatField.h" />
-    <ClInclude Include="Include\BsScriptGUIComponentFoldout.h" />
-    <ClInclude Include="Include\BsScriptGUIFoldout.h" />
     <ClInclude Include="Include\BsScriptGUIGameObjectField.h" />
     <ClInclude Include="Include\BsScriptGUIGameObjectField.h" />
     <ClInclude Include="Include\BsScriptGUIIntField.h" />
     <ClInclude Include="Include\BsScriptGUIIntField.h" />
     <ClInclude Include="Include\BsScriptGUIResourceField.h" />
     <ClInclude Include="Include\BsScriptGUIResourceField.h" />
@@ -317,8 +315,6 @@
     <ClCompile Include="Source\BsScriptGizmos.cpp" />
     <ClCompile Include="Source\BsScriptGizmos.cpp" />
     <ClCompile Include="Source\BsScriptGUIColorField.cpp" />
     <ClCompile Include="Source\BsScriptGUIColorField.cpp" />
     <ClCompile Include="Source\BsScriptGUIFloatField.cpp" />
     <ClCompile Include="Source\BsScriptGUIFloatField.cpp" />
-    <ClCompile Include="Source\BsScriptGUIComponentFoldout.cpp" />
-    <ClCompile Include="Source\BsScriptGUIFoldout.cpp" />
     <ClCompile Include="Source\BsScriptGUIGameObjectField.cpp" />
     <ClCompile Include="Source\BsScriptGUIGameObjectField.cpp" />
     <ClCompile Include="Source\BsScriptGUIIntField.cpp" />
     <ClCompile Include="Source\BsScriptGUIIntField.cpp" />
     <ClCompile Include="Source\BsScriptGUIResourceField.cpp" />
     <ClCompile Include="Source\BsScriptGUIResourceField.cpp" />

+ 0 - 12
SBansheeEditor/SBansheeEditor.vcxproj.filters

@@ -63,12 +63,6 @@
     <ClInclude Include="Include\BsEditorScriptManager.h">
     <ClInclude Include="Include\BsEditorScriptManager.h">
       <Filter>Header Files</Filter>
       <Filter>Header Files</Filter>
     </ClInclude>
     </ClInclude>
-    <ClInclude Include="Include\BsScriptGUIComponentFoldout.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\BsScriptGUIFoldout.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="Include\BsScriptGizmos.h">
     <ClInclude Include="Include\BsScriptGizmos.h">
       <Filter>Header Files</Filter>
       <Filter>Header Files</Filter>
     </ClInclude>
     </ClInclude>
@@ -230,12 +224,6 @@
     <ClCompile Include="Source\BsEditorScriptManager.cpp">
     <ClCompile Include="Source\BsEditorScriptManager.cpp">
       <Filter>Source Files</Filter>
       <Filter>Source Files</Filter>
     </ClCompile>
     </ClCompile>
-    <ClCompile Include="Source\BsScriptGUIComponentFoldout.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\BsScriptGUIFoldout.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="Source\BsScriptGizmos.cpp">
     <ClCompile Include="Source\BsScriptGizmos.cpp">
       <Filter>Source Files</Filter>
       <Filter>Source Files</Filter>
     </ClCompile>
     </ClCompile>

+ 0 - 87
SBansheeEditor/Source/BsScriptGUIComponentFoldout.cpp

@@ -1,87 +0,0 @@
-#include "BsScriptGUIComponentFoldout.h"
-#include "BsScriptMeta.h"
-#include "BsMonoField.h"
-#include "BsMonoClass.h"
-#include "BsMonoManager.h"
-#include "BsMonoMethod.h"
-#include "BsSpriteTexture.h"
-#include "BsMonoUtil.h"
-#include "BsGUILayout.h"
-#include "BsGUIComponentFoldout.h"
-#include "BsGUIOptions.h"
-#include "BsGUIContent.h"
-#include "BsScriptGUIElementStyle.h"
-#include "BsScriptGUILayout.h"
-#include "BsScriptHString.h"
-#include "BsScriptGUIContent.h"
-
-using namespace std::placeholders;
-
-namespace BansheeEngine
-{
-	ScriptGUIComponentFoldout::OnToggledThunkDef ScriptGUIComponentFoldout::onToggledThunk;
-
-	ScriptGUIComponentFoldout::ScriptGUIComponentFoldout(MonoObject* instance, GUIComponentFoldout* foldout)
-		:TScriptGUIElement(instance, foldout)
-	{
-
-	}
-
-	void ScriptGUIComponentFoldout::initRuntimeData()
-	{
-		metaData.scriptClass->addInternalCall("Internal_CreateInstance", &ScriptGUIComponentFoldout::internal_createInstance);
-		metaData.scriptClass->addInternalCall("Internal_SetContent", &ScriptGUIComponentFoldout::internal_setContent);
-		metaData.scriptClass->addInternalCall("Internal_SetExpanded", &ScriptGUIComponentFoldout::internal_setExpanded);
-		metaData.scriptClass->addInternalCall("Internal_IsExpanded", &ScriptGUIComponentFoldout::internal_getIsExpanded);
-		metaData.scriptClass->addInternalCall("Internal_SetTint", &ScriptGUIComponentFoldout::internal_setTint);
-
-		onToggledThunk = (OnToggledThunkDef)metaData.scriptClass->getMethod("DoOnToggled", 1)->getThunk();
-	}
-
-	void ScriptGUIComponentFoldout::internal_createInstance(MonoObject* instance, MonoObject* content, MonoString* style, MonoArray* guiOptions)
-	{
-		GUIOptions options;
-
-		UINT32 arrayLen = (UINT32)mono_array_length(guiOptions);
-		for(UINT32 i = 0; i < arrayLen; i++)
-			options.addOption(mono_array_get(guiOptions, GUIOption, i));
-
-		HString label = ScriptGUIContent::getText(content);
-		GUIComponentFoldout* guiFoldout = GUIComponentFoldout::create(label);
-
-		guiFoldout->onStateChanged.connect(std::bind(&ScriptGUIComponentFoldout::onToggled, instance, _1));
-
-		ScriptGUIComponentFoldout* nativeInstance = new (bs_alloc<ScriptGUIComponentFoldout>()) ScriptGUIComponentFoldout(instance, guiFoldout);
-	}
-
-	void ScriptGUIComponentFoldout::internal_setContent(ScriptGUIComponentFoldout* nativeInstance, MonoObject* content)
-	{
-		GUIContent nativeContent(ScriptGUIContent::getText(content), ScriptGUIContent::getImage(content), ScriptGUIContent::getTooltip(content));
-		
-		GUIComponentFoldout* guiFoldout = static_cast<GUIComponentFoldout*>(nativeInstance->getGUIElement());
-		guiFoldout->setContent(nativeContent);
-	}
-
-	void ScriptGUIComponentFoldout::internal_setExpanded(ScriptGUIComponentFoldout* nativeInstance, bool expanded)
-	{
-		GUIComponentFoldout* foldout = static_cast<GUIComponentFoldout*>(nativeInstance->getGUIElement());
-		foldout->setExpanded(expanded);
-	}
-
-	void ScriptGUIComponentFoldout::internal_getIsExpanded(ScriptGUIComponentFoldout* nativeInstance, bool* isExpanded)
-	{
-		GUIComponentFoldout* foldout = static_cast<GUIComponentFoldout*>(nativeInstance->getGUIElement());
-		*isExpanded = foldout->isExpanded();
-	}
-
-	void ScriptGUIComponentFoldout::internal_setTint(ScriptGUIComponentFoldout* nativeInstance, Color color)
-	{
-		GUIComponentFoldout* foldout = (GUIComponentFoldout*)nativeInstance->getGUIElement();
-		foldout->setTint(color);
-	}
-
-	void ScriptGUIComponentFoldout::onToggled(MonoObject* instance, bool expanded)
-	{
-		MonoUtil::invokeThunk(onToggledThunk, instance, expanded);
-	}
-}

+ 0 - 87
SBansheeEditor/Source/BsScriptGUIFoldout.cpp

@@ -1,87 +0,0 @@
-#include "BsScriptGUIFoldout.h"
-#include "BsScriptMeta.h"
-#include "BsMonoField.h"
-#include "BsMonoClass.h"
-#include "BsMonoManager.h"
-#include "BsMonoMethod.h"
-#include "BsSpriteTexture.h"
-#include "BsMonoUtil.h"
-#include "BsGUILayout.h"
-#include "BsGUIFoldout.h"
-#include "BsGUIOptions.h"
-#include "BsGUIContent.h"
-#include "BsScriptGUIElementStyle.h"
-#include "BsScriptGUILayout.h"
-#include "BsScriptHString.h"
-#include "BsScriptGUIContent.h"
-
-using namespace std::placeholders;
-
-namespace BansheeEngine
-{
-	ScriptGUIFoldout::OnToggledThunkDef ScriptGUIFoldout::onToggledThunk;
-
-	ScriptGUIFoldout::ScriptGUIFoldout(MonoObject* instance, GUIFoldout* foldout)
-		:TScriptGUIElement(instance, foldout)
-	{
-
-	}
-
-	void ScriptGUIFoldout::initRuntimeData()
-	{
-		metaData.scriptClass->addInternalCall("Internal_CreateInstance", &ScriptGUIFoldout::internal_createInstance);
-		metaData.scriptClass->addInternalCall("Internal_SetContent", &ScriptGUIFoldout::internal_setContent);
-		metaData.scriptClass->addInternalCall("Internal_SetExpanded", &ScriptGUIFoldout::internal_setExpanded);
-		metaData.scriptClass->addInternalCall("Internal_IsExpanded", &ScriptGUIFoldout::internal_getIsExpanded);
-		metaData.scriptClass->addInternalCall("Internal_SetTint", &ScriptGUIFoldout::internal_setTint);
-
-		onToggledThunk = (OnToggledThunkDef)metaData.scriptClass->getMethod("DoOnToggled", 1)->getThunk();
-	}
-
-	void ScriptGUIFoldout::internal_createInstance(MonoObject* instance, MonoObject* content, MonoString* style, MonoArray* guiOptions)
-	{
-		GUIOptions options;
-
-		UINT32 arrayLen = (UINT32)mono_array_length(guiOptions);
-		for (UINT32 i = 0; i < arrayLen; i++)
-			options.addOption(mono_array_get(guiOptions, GUIOption, i));
-
-		HString label = ScriptGUIContent::getText(content);
-		GUIFoldout* guiFoldout = GUIFoldout::create(label, options);
-
-		guiFoldout->onStateChanged.connect(std::bind(&ScriptGUIFoldout::onToggled, instance, _1));
-
-		ScriptGUIFoldout* nativeInstance = new (bs_alloc<ScriptGUIFoldout>()) ScriptGUIFoldout(instance, guiFoldout);
-	}
-
-	void ScriptGUIFoldout::internal_setContent(ScriptGUIFoldout* nativeInstance, MonoObject* content)
-	{
-		GUIContent nativeContent(ScriptGUIContent::getText(content), ScriptGUIContent::getImage(content), ScriptGUIContent::getTooltip(content));
-
-		GUIFoldout* guiFoldout = static_cast<GUIFoldout*>(nativeInstance->getGUIElement());
-		guiFoldout->setContent(nativeContent);
-	}
-
-	void ScriptGUIFoldout::internal_setExpanded(ScriptGUIFoldout* nativeInstance, bool expanded)
-	{
-		GUIFoldout* foldout = static_cast<GUIFoldout*>(nativeInstance->getGUIElement());
-		foldout->setExpanded(expanded);
-	}
-
-	void ScriptGUIFoldout::internal_getIsExpanded(ScriptGUIFoldout* nativeInstance, bool* isExpanded)
-	{
-		GUIFoldout* foldout = static_cast<GUIFoldout*>(nativeInstance->getGUIElement());
-		*isExpanded = foldout->isExpanded();
-	}
-
-	void ScriptGUIFoldout::internal_setTint(ScriptGUIFoldout* nativeInstance, Color color)
-	{
-		GUIFoldout* foldout = (GUIFoldout*)nativeInstance->getGUIElement();
-		foldout->setTint(color);
-	}
-
-	void ScriptGUIFoldout::onToggled(MonoObject* instance, bool expanded)
-	{
-		MonoUtil::invokeThunk(onToggledThunk, instance, expanded);
-	}
-}