Browse Source

GuiInspector with Profiles

This code updates the GuiInspector to have adjustable profiles instead of hard-coded profiles. It also allows various features of the inspector to be controlled in script when it is set up. The inspector itself has been changed to use a grid so that it can take better advantage of horizontal space. The label now defaults to directly above the control for each field. This can be changed as well in script. Not everything is perfect. More changes to come...
Peter Robinson 4 years ago
parent
commit
9addb69008

+ 6 - 11
editor/AssetAdmin/AssetAdmin.cs

@@ -25,6 +25,8 @@ function AssetAdmin::create(%this)
 	exec("./AssetDictionary.cs");
 	exec("./AssetDictionary.cs");
 	exec("./AssetWindow.cs");
 	exec("./AssetWindow.cs");
 	exec("./AssetDictionaryButton.cs");
 	exec("./AssetDictionaryButton.cs");
+	exec("./AssetInspector.cs");
+	exec("./AssetInput/AssetInput.cs");
 
 
 	%this.guiPage = EditorCore.RegisterEditor("Asset Manager", %this);
 	%this.guiPage = EditorCore.RegisterEditor("Asset Manager", %this);
 	%this.guiPage.add(%this.buildAssetWindow());
 	%this.guiPage.add(%this.buildAssetWindow());
@@ -93,25 +95,18 @@ function AssetAdmin::buildDictionary(%this, %title, %type)
 
 
 function AssetAdmin::buildInspector(%this)
 function AssetAdmin::buildInspector(%this)
 {
 {
-	%this.insScroller = new GuiScrollCtrl()
+	%this.inspector = new GuiControl()
 	{
 	{
+		class = "AssetInspector";
 		HorizSizing="width";
 		HorizSizing="width";
 		VertSizing="top";
 		VertSizing="top";
 		Position="0 444";
 		Position="0 444";
 		Extent="700 324";
 		Extent="700 324";
 		MinExtent="350 222";
 		MinExtent="350 222";
-		hScrollBar="alwaysOn";
-		vScrollBar="alwaysOn";
-		constantThumbHeight="0";
-		showArrowButtons="1";
-		scrollBarThickness="14";
 	};
 	};
-	ThemeManager.setProfile(%this.insScroller, "scrollingPanelProfile");
-	ThemeManager.setProfile(%this.insScroller, "scrollingPanelThumbProfile", ThumbProfile);
-	ThemeManager.setProfile(%this.insScroller, "scrollingPanelTrackProfile", TrackProfile);
-	ThemeManager.setProfile(%this.insScroller, "scrollingPanelArrowProfile", ArrowProfile);
+	ThemeManager.setProfile(%this.inspector, "overlayProfile");
 
 
-	return %this.insScroller;
+	return %this.inspector;
 }
 }
 
 
 function AssetAdmin::buildAssetWindow(%this)
 function AssetAdmin::buildAssetWindow(%this)

+ 1 - 1
editor/AssetAdmin/AssetDictionary.cs

@@ -59,7 +59,7 @@ function AssetDictionary::load(%this)
 				AssetID = %assetID;
 				AssetID = %assetID;
 				Type = %this.Type;
 				Type = %this.Type;
 			};
 			};
-			ThemeManager.setProfile(%button, "buttonProfile");
+			ThemeManager.setProfile(%button, "itemSelectProfile");
 			ThemeManager.setProfile(%button, "tipProfile", "TooltipProfile");
 			ThemeManager.setProfile(%button, "tipProfile", "TooltipProfile");
 			%this.grid.add(%button);
 			%this.grid.add(%button);
 		}
 		}

+ 5 - 13
editor/AssetAdmin/AssetDictionaryButton.cs

@@ -60,19 +60,7 @@ function AssetDictionaryButton::loadAnimationAsset(%this, %assetID)
 
 
 function AssetDictionaryButton::getIconExtent(%this, %size)
 function AssetDictionaryButton::getIconExtent(%this, %size)
 {
 {
-	%x = getWord(%size, 0);
-	%y = getWord(%size, 1);
-	%ratio = %x / %y;
-	%extent = "50 50";
-	if(%x > %y)
-	{
-		%extent = "50" SPC (50/%ratio);
-	}
-	else if(%x < %y)
-	{
-		%extent = (50*%ratio) SPC "50";
-	}
-	return %extent;
+	return "50 50";
 }
 }
 
 
 function AssetDictionaryButton::buildIcon(%this, %extent)
 function AssetDictionaryButton::buildIcon(%this, %extent)
@@ -85,6 +73,8 @@ function AssetDictionaryButton::buildIcon(%this, %extent)
 		Extent = %extent;
 		Extent = %extent;
 		minExtent=%extent;
 		minExtent=%extent;
 		Position = "0 0";
 		Position = "0 0";
+		constrainProportions = "1";
+		fullSize = "1";
 	};
 	};
 	ThemeManager.setProfile(%texture, "spriteProfile");
 	ThemeManager.setProfile(%texture, "spriteProfile");
 	return %texture;
 	return %texture;
@@ -95,10 +85,12 @@ function AssetDictionaryButton::onClick(%this)
 	if(isObject(%this.AnimationAsset) && %this.AnimationAssetID !$= "")
 	if(isObject(%this.AnimationAsset) && %this.AnimationAssetID !$= "")
 	{
 	{
 		AssetAdmin.AssetWindow.displayAnimationAsset(%this.imageAsset, %this.AnimationAsset, %this.AnimationAssetID);
 		AssetAdmin.AssetWindow.displayAnimationAsset(%this.imageAsset, %this.AnimationAsset, %this.AnimationAssetID);
+		AssetAdmin.inspector.loadAnimationAsset(%this.AnimationAsset, %this.AnimationAssetID);
 	}
 	}
 	else if(isObject(%this.ImageAsset) && %this.ImageAssetID !$= "")
 	else if(isObject(%this.ImageAsset) && %this.ImageAssetID !$= "")
 	{
 	{
 		AssetAdmin.AssetWindow.displayImageAsset(%this.ImageAsset, %this.ImageAssetID);
 		AssetAdmin.AssetWindow.displayImageAsset(%this.ImageAsset, %this.ImageAssetID);
+		AssetAdmin.inspector.loadImageAsset(%this.ImageAsset, %this.ImageAssetID);
 	}
 	}
 }
 }
 
 

+ 95 - 0
editor/AssetAdmin/AssetInspector.cs

@@ -0,0 +1,95 @@
+//-----------------------------------------------------------------------------
+// Copyright (c) 2013 GarageGames, LLC
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//-----------------------------------------------------------------------------
+
+function AssetInspector::onAdd(%this)
+{
+	%this.titlebar = new GuiControl()
+	{
+		HorizSizing="width";
+		VertSizing="top";
+		Position="0 0";
+		Extent="700 34";
+		MinExtent="350 34";
+		Text = "Image Asset";
+	};
+	ThemeManager.setProfile(%this.titlebar, "panelProfile");
+	%this.add(%this.titlebar);
+
+	%this.insScroller = new GuiScrollCtrl()
+	{
+		HorizSizing="width";
+		VertSizing="top";
+		Position="0 34";
+		Extent="700 290";
+		MinExtent="350 145";
+		hScrollBar="alwaysOff";
+		vScrollBar="alwaysOn";
+		constantThumbHeight="0";
+		showArrowButtons="1";
+		scrollBarThickness="14";
+	};
+	ThemeManager.setProfile(%this.insScroller, "scrollingPanelProfile");
+	ThemeManager.setProfile(%this.insScroller, "scrollingPanelThumbProfile", "ThumbProfile");
+	ThemeManager.setProfile(%this.insScroller, "scrollingPanelTrackProfile", "TrackProfile");
+	ThemeManager.setProfile(%this.insScroller, "scrollingPanelArrowProfile", "ArrowProfile");
+	%this.add(%this.insScroller);
+
+	%this.inspector = new GuiInspector()
+	{
+		HorizSizing="width";
+		VertSizing="height";
+		Position="0 0";
+		Extent="686 290";
+		MinExtent="343 145";
+		FieldCellSize="300 40";
+		ControlOffset="10 18";
+		ConstantThumbHeight=false;
+		ScrollBarThickness=12;
+		ShowArrowButtons=true;
+	};
+	ThemeManager.setProfile(%this.inspector, "emptyProfile");
+	ThemeManager.setProfile(%this.inspector, "panelProfile", "GroupPanelProfile");
+	ThemeManager.setProfile(%this.inspector, "emptyProfile", "GroupGridProfile");
+	ThemeManager.setProfile(%this.inspector, "labelProfile", "LabelProfile");
+	ThemeManager.setProfile(%this.inspector, "textEditProfile", "textEditProfile");
+	ThemeManager.setProfile(%this.inspector, "dropDownProfile", "dropDownProfile");
+	ThemeManager.setProfile(%this.inspector, "dropDownItemProfile", "dropDownItemProfile");
+	ThemeManager.setProfile(%this.inspector, "emptyProfile", "backgroundProfile");
+	ThemeManager.setProfile(%this.inspector, "scrollingPanelProfile", "ScrollProfile");
+	ThemeManager.setProfile(%this.inspector, "scrollingPanelThumbProfile", "ThumbProfile");
+	ThemeManager.setProfile(%this.inspector, "scrollingPanelTrackProfile", "TrackProfile");
+	ThemeManager.setProfile(%this.inspector, "scrollingPanelArrowProfile", "ArrowProfile");
+	ThemeManager.setProfile(%this.inspector, "checkboxProfile", "checkboxProfile");
+	ThemeManager.setProfile(%this.inspector, "buttonProfile", "buttonProfile");
+	%this.insScroller.add(%this.inspector);
+	$ins = %this.inspector;
+}
+
+function AssetInspector::loadImageAsset(%this, %imageAsset, %assetID)
+{
+	%this.inspector.inspect(%imageAsset);
+}
+
+function AssetInspector::loadAnimationAsset(%this, %animationAsset, %assetID)
+{
+	%this.inspector.inspect(%animationAsset);
+}

+ 311 - 2
editor/EditorCore/Themes/BaseTheme/BaseTheme.cs

@@ -48,12 +48,15 @@ function BaseTheme::onAdd(%this)
 	%this.makeTipProfile();
 	%this.makeTipProfile();
 	%this.makeGeneralProfiles();
 	%this.makeGeneralProfiles();
 	%this.makePanelProfile();
 	%this.makePanelProfile();
+	%this.makeItemSelectProfile();
 	%this.makeButtonProfile();
 	%this.makeButtonProfile();
+	%this.makeCheckboxProfile();
 	%this.makeTabProfile();
 	%this.makeTabProfile();
 	%this.makeTextEditProfile();
 	%this.makeTextEditProfile();
 	%this.makeScrollProfile();
 	%this.makeScrollProfile();
 	%this.makeConsoleProfile();
 	%this.makeConsoleProfile();
 	%this.makeMenuProfile();
 	%this.makeMenuProfile();
+	%this.makeDropDownProfile();
 }
 }
 
 
 function BaseTheme::init(%this)
 function BaseTheme::init(%this)
@@ -267,7 +270,7 @@ function BaseTheme::makePanelProfile(%this)
 	};
 	};
 }
 }
 
 
-function BaseTheme::makeButtonProfile(%this)
+function BaseTheme::makeItemSelectProfile(%this)
 {
 {
 	%buttonBorderV = new GuiBorderProfile()
 	%buttonBorderV = new GuiBorderProfile()
 	{
 	{
@@ -309,7 +312,7 @@ function BaseTheme::makeButtonProfile(%this)
 		underfill = false;
 		underfill = false;
 	};
 	};
 
 
-	%this.buttonProfile = new GuiControlProfile()
+	%this.itemSelectProfile = new GuiControlProfile()
 	{
 	{
 		fillColor = %this.color2;
 		fillColor = %this.color2;
 		fillColorHL = %this.adjustValue(%this.color2, 10);
 		fillColorHL = %this.adjustValue(%this.color2, 10);
@@ -331,6 +334,164 @@ function BaseTheme::makeButtonProfile(%this)
 	};
 	};
 }
 }
 
 
+function BaseTheme::makeButtonProfile(%this)
+{
+	%borderLightH = new GuiBorderProfile()
+	{
+		padding = 4;
+		paddingHL = 4;
+		paddingSL = 4;
+		paddingNA = 4;
+
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "255 255 255 80";
+		borderColorHL = "255 255 255 80";
+		borderColorSL = "0 0 0 80";
+		borderColorNA = "255 255 255 80";
+
+		underfill = true;
+	};
+
+	%borderLightV = new GuiBorderProfile()
+	{
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "255 255 255 80";
+		borderColorHL = "255 255 255 80";
+		borderColorSL = "0 0 0 80";
+		borderColorNA = "255 255 255 80";
+
+		underfill = true;
+	};
+
+	%borderDarkH = new GuiBorderProfile()
+	{
+		padding = 4;
+		paddingHL = 4;
+		paddingSL = 4;
+		paddingNA = 4;
+
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "0 0 0 80";
+		borderColorHL = "0 0 0 80";
+		borderColorSL = "255 255 255 80";
+		borderColorNA = "0 0 0 80";
+
+		underfill = true;
+	};
+
+	%borderDarkV = new GuiBorderProfile()
+	{
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "0 0 0 80";
+		borderColorHL = "0 0 0 80";
+		borderColorSL = "255 255 255 80";
+		borderColorNA = "0 0 0 80";
+
+		underfill = true;
+	};
+
+	%this.buttonProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color4;
+		fillColorHL = %this.adjustValue(%this.color4, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.setAlpha(%this.color4, 80);
+
+		fontType = %this.font[2];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color1;
+		fontColorHL = %this.adjustValue(%this.color1, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.setAlpha(%this.color1, 100);
+		align = center;
+		vAlign = middle;
+
+		borderLeft = %borderLightH;
+		borderRight = %borderDarkH;
+		borderTop = %borderLightV;
+		borderBottom = %borderDarkV;
+
+		canKeyFocus = true;
+		tab = true;
+	};
+}
+
+function BaseTheme::makeCheckboxProfile(%this)
+{
+	%borderLight = new GuiBorderProfile()
+	{
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "255 255 255 80";
+		borderColorHL = "255 255 255 80";
+		borderColorSL = "0 0 0 80";
+		borderColorNA = "255 255 255 0";
+
+		underfill = true;
+	};
+
+	%borderDark = new GuiBorderProfile()
+	{
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "0 0 0 80";
+		borderColorHL = "0 0 0 80";
+		borderColorSL = "255 255 255 80";
+		borderColorNA = "0 0 0 0";
+
+		underfill = true;
+	};
+
+	%this.checkboxProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color4;
+		fillColorHL = %this.adjustValue(%this.color4, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.setAlpha(%this.color4, 80);
+
+		fontType = %this.font[2];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color4;
+		fontColorHL = %this.color5;
+		fontColorSL = %this.color4;
+		fontColorNA = %this.setAlpha(%this.color4, 100);
+		align = left;
+		vAlign = middle;
+
+		borderLeft = %borderLight;
+		borderRight = %borderDark;
+		borderTop = %borderLight;
+		borderBottom = %borderDark;
+
+		canKeyFocus = true;
+		tab = true;
+	};
+}
+
 function BaseTheme::makeTabProfile(%this)
 function BaseTheme::makeTabProfile(%this)
 {
 {
 	%tabBorderTop = new GuiBorderProfile()
 	%tabBorderTop = new GuiBorderProfile()
@@ -644,6 +805,7 @@ function BaseTheme::makeTextEditProfile(%this)
 		tab = false;
 		tab = false;
 		canKeyFocus = true;
 		canKeyFocus = true;
 		returnTab = true;
 		returnTab = true;
+		useInput = true;
 	};
 	};
 }
 }
 
 
@@ -935,6 +1097,153 @@ function BaseTheme::makeMenuProfile(%this)
 	};
 	};
 }
 }
 
 
+function BaseTheme::makeDropDownProfile(%this)
+{
+	%borderLightH = new GuiBorderProfile()
+	{
+		padding = 4;
+		paddingHL = 4;
+		paddingSL = 4;
+		paddingNA = 4;
+
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "255 255 255 80";
+		borderColorHL = "255 255 255 80";
+		borderColorSL = "0 0 0 80";
+		borderColorNA = "255 255 255 80";
+
+		underfill = true;
+	};
+
+	%borderLightV = new GuiBorderProfile()
+	{
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "255 255 255 80";
+		borderColorHL = "255 255 255 80";
+		borderColorSL = "0 0 0 80";
+		borderColorNA = "255 255 255 80";
+
+		underfill = true;
+	};
+
+	%borderDarkH = new GuiBorderProfile()
+	{
+		padding = 4;
+		paddingHL = 4;
+		paddingSL = 4;
+		paddingNA = 4;
+
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "0 0 0 80";
+		borderColorHL = "0 0 0 80";
+		borderColorSL = "255 255 255 80";
+		borderColorNA = "0 0 0 80";
+
+		underfill = true;
+	};
+
+	%borderDarkV = new GuiBorderProfile()
+	{
+		border = %this.borderSize;
+		borderHL = %this.borderSize;
+		borderSL = %this.borderSize;
+		borderNA = %this.borderSize;
+
+		borderColor = "0 0 0 80";
+		borderColorHL = "0 0 0 80";
+		borderColorSL = "255 255 255 80";
+		borderColorNA = "0 0 0 80";
+
+		underfill = true;
+	};
+
+	%this.DropDownProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color4;
+		fillColorHL = %this.adjustValue(%this.color4, 10);
+		fillColorSL = %this.color5;
+		fillColorNA = %this.setAlpha(%this.color4, 80);
+
+		fontType = %this.font[1];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color1;
+		fontColorHL = %this.adjustValue(%this.color1, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.setAlpha(%this.color1, 100);
+		align = left;
+		vAlign = middle;
+
+		borderLeft = %borderLightH;
+		borderRight = %borderDarkH;
+		borderTop = %borderLightV;
+		borderBottom = %borderDarkV;
+
+		canKeyFocus = true;
+		tab = true;
+	};
+
+	%borderItem = new GuiBorderProfile()
+	{
+		margin = 1;
+		marginHL = 1;
+		marginSL = 0;
+		marginNA = 1;
+
+		padding = 3;
+		paddingHL = 3;
+		paddingSL = 4;
+		paddingNA = 3;
+
+		border = 1;
+		borderHL = 1;
+		borderSL = 1;
+		borderNA = 1;
+
+		borderColor = %this.setAlpha(%this.color4, 80);
+		borderColorHL = %this.setAlpha(%this.color4, 80);
+		borderColorSL = %this.setAlpha(%this.color4, 150);
+		borderColorNA = %this.setAlpha(%this.color4, 40);
+
+		underfill = true;
+	};
+
+	%this.DropDownItemProfile = new GuiControlProfile()
+	{
+		fillColor = %this.color1;
+	    fillColorHL = AdjustColorValue(%this.color1, 10);
+	    fillColorSL = %this.color5;
+	    fillColorNA = SetColorAlpha(%this.color1, 100);
+
+		fontType = %this.font[1];
+		fontDirectory = %this.fontDirectory;
+		fontSize = %this.fontSize;
+		fontColor = %this.color4;
+		fontColorHL = %this.adjustValue(%this.color4, 10);
+		fontColorSL = %this.color1;
+		fontColorNA = %this.setAlpha(%this.color4, 100);
+		align = left;
+		vAlign = middle;
+
+		borderDefault = %borderItem;
+
+		tab = false;
+		canKeyFocus = true;
+	};
+}
+
 //Positive values are brighter, negative are darker
 //Positive values are brighter, negative are darker
 function BaseTheme::adjustValue(%this, %color, %percent)
 function BaseTheme::adjustValue(%this, %color, %percent)
 {
 {

+ 7 - 1
engine/source/gui/buttons/guiDropDownCtrl.cc

@@ -265,6 +265,7 @@ void GuiDropDownCtrl::openDropDown()
 	mScroll->mShowArrowButtons = mShowArrowButtons;
 	mScroll->mShowArrowButtons = mShowArrowButtons;
 
 
 	//Set the size of the scroll control.
 	//Set the size of the scroll control.
+	mListBox->updateSize();
 	S32 width = mClamp(mListBox->mBounds.extent.x, mBounds.extent.x, mBounds.extent.x * 2);
 	S32 width = mClamp(mListBox->mBounds.extent.x, mBounds.extent.x, mBounds.extent.x * 2);
 	S32 height = mClamp(mListBox->mBounds.extent.y, 10, mMaxHeight);
 	S32 height = mClamp(mListBox->mBounds.extent.y, 10, mMaxHeight);
 
 
@@ -309,7 +310,12 @@ void GuiDropDownCtrl::closeDropDown()
 	if(!mIsOpen)
 	if(!mIsOpen)
 		return;
 		return;
 
 
-	getRoot()->popDialogControl(mBackground);
+	GuiCanvas *root = mBackground->getRoot();
+	if (!root)
+	{
+		return;
+	}
+	root->popDialogControl(mBackground);
 
 
 	mIsOpen = false;
 	mIsOpen = false;
 
 

+ 3 - 0
engine/source/gui/buttons/guiDropDownCtrl.h

@@ -106,6 +106,9 @@ public:
    void setControlThumbProfile(GuiControlProfile* prof);
    void setControlThumbProfile(GuiControlProfile* prof);
    void setControlTrackProfile(GuiControlProfile* prof);
    void setControlTrackProfile(GuiControlProfile* prof);
    void setControlArrowProfile(GuiControlProfile* prof);
    void setControlArrowProfile(GuiControlProfile* prof);
+   void setConstantThumbHeight(bool isConstant) { mUseConstantHeightThumb = isConstant; }
+   void setShowArrowButtons(bool show) { mShowArrowButtons = show; }
+   void setScrollBarThickness(S32 thickness) { mScrollBarThickness = thickness; }
 
 
    inline GuiListBoxCtrl* getList() { return mListBox; }
    inline GuiListBoxCtrl* getList() { return mListBox; }
 
 

+ 12 - 1
engine/source/gui/containers/guiExpandCtrl.cc

@@ -86,7 +86,6 @@ void GuiExpandCtrl::parentResized(const Point2I &oldParentExtent, const Point2I
 		newPosition.y += deltaY;
 		newPosition.y += deltaY;
 	else if (mVertSizing == vertResizeRelative && oldParentExtent.y != 0)
 	else if (mVertSizing == vertResizeRelative && oldParentExtent.y != 0)
 	{
 	{
-
 		S32 newTop = (newPosition.y * newParentExtent.y) / oldParentExtent.y;
 		S32 newTop = (newPosition.y * newParentExtent.y) / oldParentExtent.y;
 		S32 newBottom = ((newPosition.y + newExtent.y) * newParentExtent.y) / oldParentExtent.y;
 		S32 newBottom = ((newPosition.y + newExtent.y) * newParentExtent.y) / oldParentExtent.y;
 
 
@@ -103,6 +102,18 @@ void GuiExpandCtrl::parentResized(const Point2I &oldParentExtent, const Point2I
 	}
 	}
 
 
 	resize(newPosition, newExtent);
 	resize(newPosition, newExtent);
+
+	calcExpandedExtent();
+
+	if (mExpanded)
+	{
+		mBounds.extent = mExpandedExtent;
+	}
+	else
+	{
+		mBounds.extent = mCollapsedExtent;
+	}
+	setUpdate();
 }
 }
 
 
 void GuiExpandCtrl::setCollapsedExtent(const Point2I &extent)
 void GuiExpandCtrl::setCollapsedExtent(const Point2I &extent)

+ 1 - 1
engine/source/gui/containers/guiExpandCtrl.h

@@ -59,7 +59,7 @@ protected:
 public:
 public:
 	GuiExpandCtrl();
 	GuiExpandCtrl();
 
 
-   void parentResized(const Point2I &oldParentExtent, const Point2I &newParentExtent);
+   virtual void parentResized(const Point2I &oldParentExtent, const Point2I &newParentExtent);
 
 
    inline bool getExpanded() { return mExpanded; };
    inline bool getExpanded() { return mExpanded; };
    void setExpanded(bool isExpanded);
    void setExpanded(bool isExpanded);

+ 3 - 2
engine/source/gui/containers/guiPanelCtrl.cc

@@ -54,7 +54,7 @@ bool GuiPanelCtrl::onAdd()
 		AssertFatal(mHeader, "GuiPaneCtrl::onAdd() Cannot create a GuiButtonCtrl for the header.");
 		AssertFatal(mHeader, "GuiPaneCtrl::onAdd() Cannot create a GuiButtonCtrl for the header.");
 		if (mHeader)
 		if (mHeader)
 		{
 		{
-			mHeader->setField("horizSizing", "right");
+			mHeader->setField("horizSizing", "width");
 			mHeader->setField("vertSizing", "bottom");
 			mHeader->setField("vertSizing", "bottom");
 			mHeader->setField("extent", "64 64");
 			mHeader->setField("extent", "64 64");
 			mHeader->setField("minExtent", "16 16");
 			mHeader->setField("minExtent", "16 16");
@@ -92,7 +92,8 @@ void GuiPanelCtrl::onRender(Point2I offset, const RectI &updateRect)
 void GuiPanelCtrl::setControlProfile(GuiControlProfile *prof)
 void GuiPanelCtrl::setControlProfile(GuiControlProfile *prof)
 {
 {
 	Parent::setControlProfile(prof);
 	Parent::setControlProfile(prof);
-	mHeader->setControlProfile(prof);
+	if(mHeader)
+		mHeader->setControlProfile(prof);
 }
 }
 
 
 bool GuiPanelCtrl::calcExpandedExtent()
 bool GuiPanelCtrl::calcExpandedExtent()

+ 269 - 136
engine/source/gui/editor/guiInspector.cc

@@ -23,6 +23,7 @@
 #include "gui/buttons/guiButtonCtrl.h"
 #include "gui/buttons/guiButtonCtrl.h"
 #include "memory/frameAllocator.h"
 #include "memory/frameAllocator.h"
 
 
+#pragma region GuiInspector
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
 // GuiInspector
 // GuiInspector
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
@@ -32,33 +33,201 @@ GuiInspector::GuiInspector()
 {
 {
    mGroups.clear();
    mGroups.clear();
    mTarget = NULL;
    mTarget = NULL;
-   setField("ChildSpacing", "4");
-}
 
 
+   mGroupPanelProfile = NULL;
+   setField("GroupPanelProfile", "GuiPanelProfile");
+
+   mGroupGridProfile = NULL;
+   setField("GroupGridProfile", "GuiDefaultProfile");
+
+   mLabelProfile = NULL;
+   setField("LabelProfile", "GuiDefaultProfile");
+
+   mTextEditProfile = NULL;
+   setField("TextEditProfile", "GuiTextEditProfile");
+
+   mDropDownProfile = NULL;
+   setField("DropDownProfile", "GuiDropDownProfile");
+
+   mDropDownItemProfile = NULL;
+   setField("DropDownItemProfile", "GuiListBoxProfile");
+
+   mScrollProfile = NULL;
+   setField("ScrollProfile", "GuiScrollProfile");
+
+   mBackgroundProfile = NULL;
+   setField("BackgroundProfile", "GuiDefaultProfile");
+
+   mThumbProfile = NULL;
+   setField("ThumbProfile", "GuiScrollThumbProfile");
+
+   mArrowProfile = NULL;
+   setField("ArrowProfile", "GuiScrollArrowProfile");
+
+   mTrackProfile = NULL;
+   setField("TrackProfile", "GuiScrollTrackProfile");
+
+   mCheckboxProfile = NULL;
+   setField("CheckboxProfile", "GuiCheckboxProfile");
+
+   mButtonProfile = NULL;
+   setField("ButtonProfile", "GuiButtonProfile");
+
+   mUseConstantHeightThumb = false;
+   mScrollBarThickness = 12;
+   mShowArrowButtons = true;
+
+   mFieldCellSize.set(300, 30);
+   mControlOffset.set(10, 16);
+}
 
 
 GuiInspector::~GuiInspector()
 GuiInspector::~GuiInspector()
 {
 {
    clearGroups();
    clearGroups();
 }
 }
 
 
-bool GuiInspector::onAdd()
+void GuiInspector::initPersistFields()
 {
 {
-   if( !Parent::onAdd() )
-      return false;
+	Parent::initPersistFields();
+
+	addField("GroupPanelProfile", TypeGuiProfile, Offset(mGroupPanelProfile, GuiInspector));
+	addField("GroupGridProfile", TypeGuiProfile, Offset(mGroupGridProfile, GuiInspector));
+	addField("LabelProfile", TypeGuiProfile, Offset(mLabelProfile, GuiInspector));
+	addField("TextEditProfile", TypeGuiProfile, Offset(mTextEditProfile, GuiInspector));
+	addField("DropDownProfile", TypeGuiProfile, Offset(mDropDownProfile, GuiInspector));
+	addField("DropDownItemProfile", TypeGuiProfile, Offset(mDropDownItemProfile, GuiInspector));
+	addField("ScrollProfile", TypeGuiProfile, Offset(mScrollProfile, GuiInspector));
+	addField("backgroundProfile", TypeGuiProfile, Offset(mBackgroundProfile, GuiInspector));
+	addField("thumbProfile", TypeGuiProfile, Offset(mThumbProfile, GuiInspector));
+	addField("trackProfile", TypeGuiProfile, Offset(mTrackProfile, GuiInspector));
+	addField("arrowProfile", TypeGuiProfile, Offset(mArrowProfile, GuiInspector));
+	addField("CheckboxProfile", TypeGuiProfile, Offset(mCheckboxProfile, GuiInspector));
+	addField("ButtonProfile", TypeGuiProfile, Offset(mButtonProfile, GuiInspector));
+
+	addField("constantThumbHeight", TypeBool, Offset(mUseConstantHeightThumb, GuiInspector));
+	addField("scrollBarThickness", TypeS32, Offset(mScrollBarThickness, GuiInspector));
+	addField("showArrowButtons", TypeBool, Offset(mShowArrowButtons, GuiInspector));
+
+	addField("FieldCellSize", TypePoint2I, Offset(mFieldCellSize, GuiInspector));
+	addField("ControlOffset", TypePoint2I, Offset(mControlOffset, GuiInspector));
+}
 
 
-   return true;
+bool GuiInspector::onWake()
+{
+	if (!Parent::onWake())
+		return false;
+
+	if (mGroupPanelProfile != NULL)
+		mGroupPanelProfile->incRefCount();
+
+	if (mGroupGridProfile != NULL)
+		mGroupGridProfile->incRefCount();
+
+	if (mLabelProfile != NULL)
+		mLabelProfile->incRefCount();
+
+	if (mTextEditProfile != NULL)
+		mTextEditProfile->incRefCount();
+
+	if (mDropDownProfile != NULL)
+		mDropDownProfile->incRefCount();
+
+	if (mDropDownItemProfile != NULL)
+		mDropDownItemProfile->incRefCount();
+
+	if (mScrollProfile != NULL)
+		mScrollProfile->incRefCount();
+
+	if (mBackgroundProfile != NULL)
+		mBackgroundProfile->incRefCount();
+
+	if (mThumbProfile != NULL)
+		mThumbProfile->incRefCount();
+
+	if (mTrackProfile != NULL)
+		mTrackProfile->incRefCount();
+
+	if (mArrowProfile != NULL)
+		mArrowProfile->incRefCount();
+
+	if (mCheckboxProfile != NULL)
+		mCheckboxProfile->incRefCount();
+
+	if (mButtonProfile != NULL)
+		mButtonProfile->incRefCount();
+
+	return true;
+}
+
+void GuiInspector::onSleep()
+{
+	Parent::onSleep();
+
+	if (mGroupPanelProfile != NULL)
+		mGroupPanelProfile->decRefCount();
+
+	if (mGroupGridProfile != NULL)
+		mGroupGridProfile->decRefCount();
+
+	if (mLabelProfile != NULL)
+		mLabelProfile->decRefCount();
+
+	if (mTextEditProfile != NULL)
+		mTextEditProfile->decRefCount();
+
+	if (mDropDownProfile != NULL)
+		mDropDownProfile->decRefCount();
+
+	if (mDropDownItemProfile != NULL)
+		mDropDownItemProfile->decRefCount();
+
+	if (mScrollProfile != NULL)
+		mScrollProfile->decRefCount();
+
+	if (mBackgroundProfile != NULL)
+		mBackgroundProfile->decRefCount();
+
+	if (mThumbProfile != NULL)
+		mThumbProfile->decRefCount();
+
+	if (mTrackProfile != NULL)
+		mTrackProfile->decRefCount();
+
+	if (mArrowProfile != NULL)
+		mArrowProfile->decRefCount();
+
+	if (mCheckboxProfile != NULL)
+		mCheckboxProfile->decRefCount();
+
+	if (mButtonProfile != NULL)
+		mButtonProfile->decRefCount();
+}
+
+void GuiInspector::inspectPostApply()
+{
+	Parent::inspectPostApply();
+
+	if (mTarget)
+	{
+		SimObjectPtr<SimObject> oldTarget = mTarget;
+		mTarget = NULL;
+		inspectObject(oldTarget);
+	}
+}
+
+void GuiInspector::resize(const Point2I &newPosition, const Point2I &newExtent)
+{
+	Parent::resize(Point2I(0, 0), newExtent);
 }
 }
 
 
-//////////////////////////////////////////////////////////////////////////
-// Handle Parent Sizing (We constrain ourself to our parents width)
-//////////////////////////////////////////////////////////////////////////
 void GuiInspector::parentResized(const Point2I &oldParentExtent, const Point2I &newParentExtent)
 void GuiInspector::parentResized(const Point2I &oldParentExtent, const Point2I &newParentExtent)
 {
 {
    GuiControl *parent = getParent();
    GuiControl *parent = getParent();
    if( parent && dynamic_cast<GuiScrollCtrl*>(parent) != NULL )
    if( parent && dynamic_cast<GuiScrollCtrl*>(parent) != NULL )
    {
    {
+	   // Handle Parent Sizing (We constrain ourself to our parent's width)
       GuiScrollCtrl *scroll = dynamic_cast<GuiScrollCtrl*>(parent);
       GuiScrollCtrl *scroll = dynamic_cast<GuiScrollCtrl*>(parent);
-      setWidth( ( newParentExtent.x - ( scroll->scrollBarThickness() + 4  ) ) );
+      setWidth(newParentExtent.x - scroll->scrollBarThickness());
    }
    }
    else
    else
       Parent::parentResized(oldParentExtent,newParentExtent);
       Parent::parentResized(oldParentExtent,newParentExtent);
@@ -135,10 +304,7 @@ void GuiInspector::inspectObject( SimObject *object )
    {
    {
       general->registerObject();
       general->registerObject();
       mGroups.push_back( general );
       mGroups.push_back( general );
-      general->setPosition(Point2I(10, 0));
-      general->setExtent(Point2I((getExtent().x - 20), 20));
       addObject( general );
       addObject( general );
-      
    }
    }
 
 
    // Grab this objects field list
    // Grab this objects field list
@@ -155,8 +321,6 @@ void GuiInspector::inspectObject( SimObject *object )
          {
          {
             group->registerObject();
             group->registerObject();
             mGroups.push_back( group );
             mGroups.push_back( group );
-            group->setPosition(Point2I(10, 0));
-            group->setExtent(Point2I((getExtent().x - 20), 20));
             addObject( group );
             addObject( group );
          }            
          }            
       }
       }
@@ -168,16 +332,13 @@ void GuiInspector::inspectObject( SimObject *object )
    {
    {
       dynGroup->registerObject();
       dynGroup->registerObject();
       mGroups.push_back( dynGroup );
       mGroups.push_back( dynGroup );
-      dynGroup->setPosition(Point2I(10, 0));
-      dynGroup->setExtent(Point2I((getExtent().x - 20), 20));
       addObject( dynGroup );
       addObject( dynGroup );
-      
    }
    }
 
 
    // If the general group is still empty at this point, kill it.
    // If the general group is still empty at this point, kill it.
    for(S32 i=0; i<mGroups.size(); i++)
    for(S32 i=0; i<mGroups.size(); i++)
    {
    {
-      if(mGroups[i] == general && general->mStack->size() == 0)
+      if(mGroups[i] == general && general->mGrid->size() == 0)
       {
       {
          mGroups.erase(i);
          mGroups.erase(i);
          general->deleteObject();
          general->deleteObject();
@@ -233,8 +394,9 @@ ConsoleMethod( GuiInspector, setName, void, 3, 3, "(NewObjectName) Set object na
 {
 {
    object->setName(argv[2]);
    object->setName(argv[2]);
 }
 }
+#pragma endregion
 
 
-
+#pragma region GuiInspectorField
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
 // GuiInspectorField
 // GuiInspectorField
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
@@ -250,17 +412,14 @@ ConsoleMethod( GuiInspector, setName, void, 3, 3, "(NewObjectName) Set object na
 //        parent.  
 //        parent.  
 IMPLEMENT_CONOBJECT(GuiInspectorField);
 IMPLEMENT_CONOBJECT(GuiInspectorField);
 
 
-// Caption width is in percentage of total width
-S32 GuiInspectorField::smCaptionWidth = 50;
-
 GuiInspectorField::GuiInspectorField( GuiInspectorGroup* parent, SimObjectPtr<SimObject> target, AbstractClassRep::Field* field )
 GuiInspectorField::GuiInspectorField( GuiInspectorGroup* parent, SimObjectPtr<SimObject> target, AbstractClassRep::Field* field )
 {
 {
    if( field != NULL )
    if( field != NULL )
-      mCaption    = StringTable->insert( field->pFieldname );
+      mText    = StringTable->insert( field->pFieldname );
    else
    else
-      mCaption    = StringTable->EmptyString;
+      mText    = StringTable->EmptyString;
 
 
-   mParent     = parent;
+   mGroup     = parent;
    mTarget     = target;
    mTarget     = target;
    mField      = field;
    mField      = field;
    mCanSave    = false;
    mCanSave    = false;
@@ -269,8 +428,8 @@ GuiInspectorField::GuiInspectorField( GuiInspectorGroup* parent, SimObjectPtr<Si
 
 
 GuiInspectorField::GuiInspectorField()
 GuiInspectorField::GuiInspectorField()
 {
 {
-   mCaption       = StringTable->EmptyString;
-   mParent        = NULL;
+   mText       = StringTable->EmptyString;
+   mGroup        = NULL;
    mTarget        = NULL;
    mTarget        = NULL;
    mField         = NULL;
    mField         = NULL;
    mFieldArrayIndex = NULL;
    mFieldArrayIndex = NULL;
@@ -319,10 +478,10 @@ void GuiInspectorField::setInspectorField( AbstractClassRep::Field *field, const
       FrameTemp<char> valCopy( frameTempSize );
       FrameTemp<char> valCopy( frameTempSize );
       dSprintf( (char *)valCopy, frameTempSize, "%s%s", field->pFieldname, arrayIndex );
       dSprintf( (char *)valCopy, frameTempSize, "%s%s", field->pFieldname, arrayIndex );
 
 
-      mCaption = StringTable->insert( valCopy ); 
+      mText = StringTable->insert( valCopy ); 
    }
    }
    else
    else
-      mCaption = StringTable->insert( field->pFieldname );
+	   mText = StringTable->insert( field->pFieldname );
 }
 }
 
 
 
 
@@ -349,7 +508,7 @@ StringTableEntry GuiInspectorField::getFieldName()
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
 // Overrideables for custom edit fields
 // Overrideables for custom edit fields
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
-GuiControl* GuiInspectorField::constructEditControl()
+GuiControl* GuiInspectorField::constructEditControl(S32 width)
 {
 {
    GuiControl* retCtrl = new GuiTextEditCtrl();
    GuiControl* retCtrl = new GuiTextEditCtrl();
    
    
@@ -358,7 +517,7 @@ GuiControl* GuiInspectorField::constructEditControl()
       return retCtrl;
       return retCtrl;
 
 
    // Let's make it look pretty.
    // Let's make it look pretty.
-   retCtrl->setField( "profile", "GuiTextEditProfile" );
+   retCtrl->setControlProfile(mGroup->mInspector->mTextEditProfile);
 
 
    // Don't forget to register ourselves
    // Don't forget to register ourselves
    registerEditControl( retCtrl );
    registerEditControl( retCtrl );
@@ -367,7 +526,7 @@ GuiControl* GuiInspectorField::constructEditControl()
    dSprintf( szBuffer, 512, "%d.apply(%d.getText());",getId(), retCtrl->getId() );
    dSprintf( szBuffer, 512, "%d.apply(%d.getText());",getId(), retCtrl->getId() );
    retCtrl->setField("AltCommand", szBuffer );
    retCtrl->setField("AltCommand", szBuffer );
    retCtrl->setField("Validate", szBuffer );
    retCtrl->setField("Validate", szBuffer );
-   retCtrl->setExtent(Point2I((getExtent().x / 2) - 40, 30));
+   retCtrl->mBounds.set(mGroup->mInspector->mControlOffset, Point2I(width - mGroup->mInspector->mControlOffset.x, 30));
 
 
    return retCtrl;
    return retCtrl;
 }
 }
@@ -378,51 +537,39 @@ void GuiInspectorField::registerEditControl( GuiControl *ctrl )
       return;
       return;
         
         
    char szName[512];
    char szName[512];
-   dSprintf( szName, 512, "IE_%s_%d_%s_Field", ctrl->getClassName(), mTarget->getId(),mCaption);
+   dSprintf( szName, 512, "IE_%s_%d_%s_Field", ctrl->getClassName(), mTarget->getId(),mText);
 
 
    // Register the object
    // Register the object
    ctrl->registerObject( szName );
    ctrl->registerObject( szName );
 }
 }
 
 
-void GuiInspectorField::onRender(Point2I offset, const RectI &updateRect)
-{
-
-   Parent::onRender( offset, updateRect );
-}
-
 bool GuiInspectorField::onAdd()
 bool GuiInspectorField::onAdd()
 {
 {
-   if( !Parent::onAdd() )
-      return false;
-
-   if( !mTarget )
-      return false;
+	if( !Parent::onAdd() )
+		return false;
 
 
-   mEdit = constructEditControl();
+	if( !mTarget )
+		return false;
 
 
-   if( mEdit == NULL )
-      return false;
+	setControlProfile(mGroup->mInspector->mLabelProfile);
 
 
-   GuiControl* capCtrl = new GuiControl();
-   capCtrl->setField("position", "0 0");
-   capCtrl->setExtent(Point2I((getExtent().x / 2) - 10, 30));
-   capCtrl->setField("profile", "GuiTextProfile");
-   capCtrl->setField("text", mCaption);
+	//Find the target width
+	RectI innerRect = getInnerRect(Point2I(0,0), mGroup->mInspector->mFieldCellSize, NormalState, mProfile);
+	mEdit = constructEditControl(innerRect.extent.x);
 
 
-   mEdit->setPosition(Point2I((getExtent().x / 2), 0));
-   addObject(capCtrl);
-   setExtent(Point2I(getExtent().x, (mEdit->getExtent().y) + 10));
-   // Add our edit as a child
-   addObject( mEdit );
+	if( mEdit == NULL )
+		return false;
 
 
-   //
-   setField( "profile", "GuiDefaultProfile" );
+	innerRect.extent.y = mGroup->mInspector->mControlOffset.y + mEdit->getExtent().y;
+	Point2I outerExt = getOuterExtent(innerRect.extent, NormalState, mProfile);
+	mBounds.extent.y = outerExt.y;
 
 
+	addObject( mEdit );
 
 
-   // Force our editField to set it's value
-   updateValue( getData() );
+	// Force our editField to set it's value
+	updateValue( getData() );
 
 
-   return true;
+	return true;
 }
 }
 
 
 void GuiInspectorField::updateValue( const char* newValue )
 void GuiInspectorField::updateValue( const char* newValue )
@@ -437,22 +584,17 @@ ConsoleMethod( GuiInspectorField, apply, void, 3,3, "(newValue) Applies the give
 {
 {
    object->setData( argv[2] );
    object->setData( argv[2] );
 }
 }
+#pragma endregion
 
 
-void GuiInspectorField::resize(const Point2I &newPosition, const Point2I &newExtent)
-{
-   
-   Parent::resize(newPosition, newExtent);
-
-}
-
+#pragma region GuiInspectorGroup
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
 // GuiInspectorGroup
 // GuiInspectorGroup
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
 //
 //
 // The GuiInspectorGroup control is a helper control that the inspector
 // The GuiInspectorGroup control is a helper control that the inspector
-// makes use of which houses a collapsible pane type control for separating
+// makes use of which houses a collapsible panel type control for separating
 // inspected objects fields into groups.  The content of the inspector is 
 // inspected objects fields into groups.  The content of the inspector is 
-// made up of zero or more GuiInspectorGroup controls inside of a GuiStackControl
+// made up of zero or more GuiInspectorGroup controls inside of a GuiChainControl
 //
 //
 //
 //
 //
 //
@@ -460,48 +602,38 @@ IMPLEMENT_CONOBJECT(GuiInspectorGroup);
 
 
 GuiInspectorGroup::GuiInspectorGroup()
 GuiInspectorGroup::GuiInspectorGroup()
 {
 {
-
    mChildren.clear();
    mChildren.clear();
 
 
-   mTarget              = NULL;
-   mParent              = NULL;
-   mCanSave             = false;
+   mTarget = NULL;
+   mInspector = NULL;
+   mCanSave = false;
 
 
-   // Make sure we receive our ticks.
-   setProcessTicks();
+   mHorizSizing = horizSizingOptions::horizResizeWidth;
+   mVertSizing = vertSizingOptions::vertResizeTop;
+   mBounds.set(10, 0, (mInspector->getExtent().x - 20), 24);
 }
 }
 
 
-GuiInspectorGroup::GuiInspectorGroup( SimObjectPtr<SimObject> target, StringTableEntry groupName, SimObjectPtr<GuiInspector> parent )
+GuiInspectorGroup::GuiInspectorGroup( SimObjectPtr<SimObject> target, StringTableEntry groupName, SimObjectPtr<GuiInspector> inspector )
 {
 {
-
    mChildren.clear();
    mChildren.clear();
 
 
-   mText                = StringTable->insert(groupName);
-   mTarget              = target;
-   mParent              = parent;
-   mCanSave             = false;
-}
+   mText = StringTable->insert(groupName);
+   mTarget = target;
+   mInspector = inspector;
+   mCanSave = false;
 
 
-GuiInspectorGroup::~GuiInspectorGroup()
-{
-   if( !mChildren.empty() )
-   {
-      Vector<GuiInspectorField*>::iterator i = mChildren.begin();
-      for( ; i != mChildren.end(); i++ );
-         
-   } 
+   mHorizSizing = horizSizingOptions::horizResizeWidth;
+   mVertSizing = vertSizingOptions::vertResizeTop;
+   mBounds.set(10, 0, (mInspector->getExtent().x - 20), 24);
 }
 }
 
 
-//////////////////////////////////////////////////////////////////////////
-// Scene Events
-//////////////////////////////////////////////////////////////////////////
 bool GuiInspectorGroup::onAdd()
 bool GuiInspectorGroup::onAdd()
 {
 {
-   setField( "profile", "GuiPanelProfile" );
-
    if( !Parent::onAdd() )
    if( !Parent::onAdd() )
       return false;
       return false;
 
 
+	setControlProfile(mInspector->mGroupPanelProfile);
+
    // Create our inner controls. Allow subclasses to provide other content.
    // Create our inner controls. Allow subclasses to provide other content.
    if(!createContent())
    if(!createContent())
       return false;
       return false;
@@ -514,32 +646,29 @@ bool GuiInspectorGroup::onAdd()
 bool GuiInspectorGroup::createContent()
 bool GuiInspectorGroup::createContent()
 {
 {
    // Create our field stack control
    // Create our field stack control
-   mStack = new GuiChainCtrl();
-   if( !mStack )
+   mGrid = new GuiGridCtrl();
+   if( !mGrid)
       return false;
       return false;
 
 
-   setWidth(mParent->getExtent().x);
 
 
-   // Prefer GuiTransperantProfile for the stack.
-   mStack->setField( "profile", "GuiDefaultProfile" );
-   mStack->registerObject();
-   mStack->setExtent(Point2I(getExtent().x - 20, 10));
-   mStack->setField("position", "0 30");
-   addObject( mStack );
-   
+   mGrid->setControlProfile(mInspector->mGroupGridProfile);
+   mGrid->setCellSize(mInspector->mFieldCellSize.x, mInspector->mFieldCellSize.y);
+   mGrid->setCellSpacing(0,0);
+   mGrid->setCellModeX(GuiGridCtrl::CellMode::Variable);
+   mGrid->setCellModeY(GuiGridCtrl::CellMode::Variable);
+   mGrid->setMaxColCount(0);
+   mGrid->mIsExtentDynamic = true;
+   mGrid->mOrderMode = GuiGridCtrl::OrderMode::LRTB;
+   mGrid->setWidth(getExtent().x - 20);
+   mGrid->setPosition(Point2I(10, getExtent().y));
+   mGrid->setField("horizSizing", "width");
+   mGrid->setField("vertSizing", "bottom");
+   mGrid->registerObject();
+   addObject( mGrid );
 
 
    return true;
    return true;
 }
 }
 
 
-//////////////////////////////////////////////////////////////////////////
-// Control Sizing Animation Functions
-//////////////////////////////////////////////////////////////////////////
-void GuiInspectorGroup::animateToContents()
-{
-   setExpanded(0);
-   setExpanded(1);
-}
-
 GuiInspectorField* GuiInspectorGroup::constructField( S32 fieldType )
 GuiInspectorField* GuiInspectorGroup::constructField( S32 fieldType )
 {
 {
    ConsoleBaseType *cbt = ConsoleBaseType::getType(fieldType);
    ConsoleBaseType *cbt = ConsoleBaseType::getType(fieldType);
@@ -681,12 +810,12 @@ bool GuiInspectorGroup::inspectGroup()
                {
                {
                   field->setExtent(Point2I(this->getExtent().x, 30));
                   field->setExtent(Point2I(this->getExtent().x, 30));
                   field->setTarget( mTarget );
                   field->setTarget( mTarget );
-                  field->setParent( this );
+                  field->setInspectorGroup( this );
                   field->setInspectorField( itr, intToStr );
                   field->setInspectorField( itr, intToStr );
                }
                }
                field->registerObject();
                field->registerObject();
                mChildren.push_back( field );
                mChildren.push_back( field );
-               mStack->addObject( field );
+               mGrid->addObject( field );
             }
             }
          }
          }
          else
          else
@@ -707,13 +836,13 @@ bool GuiInspectorGroup::inspectGroup()
             else
             else
             {
             {
                field->setTarget( mTarget );
                field->setTarget( mTarget );
-               field->setParent( this );
+               field->setInspectorGroup( this );
                field->setInspectorField( itr );
                field->setInspectorField( itr );
             }
             }
             field->setExtent(Point2I(this->getExtent().x, 30));
             field->setExtent(Point2I(this->getExtent().x, 30));
             field->registerObject();
             field->registerObject();
             mChildren.push_back( field );
             mChildren.push_back( field );
-            mStack->addObject( field );
+            mGrid->addObject( field );
 
 
          }       
          }       
       }
       }
@@ -729,8 +858,9 @@ bool GuiInspectorGroup::inspectGroup()
 
 
    return true;
    return true;
 }
 }
+#pragma endregion
 
 
-
+#pragma region GuiInspectorDynamicGroup
 IMPLEMENT_CONOBJECT(GuiInspectorDynamicGroup);
 IMPLEMENT_CONOBJECT(GuiInspectorDynamicGroup);
 
 
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
@@ -768,7 +898,7 @@ bool GuiInspectorDynamicGroup::createContent()
    shell->addObject(addFieldBtn);
    shell->addObject(addFieldBtn);
    // save off the shell control, so we can push it to the bottom of the stack in inspectGroup()
    // save off the shell control, so we can push it to the bottom of the stack in inspectGroup()
    mAddCtrl = shell;
    mAddCtrl = shell;
-   mStack->addObject(shell);
+   mGrid->addObject(shell);
 
 
    return true;
    return true;
 }
 }
@@ -814,11 +944,11 @@ bool GuiInspectorDynamicGroup::inspectGroup()
          field->setExtent(Point2I(this->getExtent().x, 30));
          field->setExtent(Point2I(this->getExtent().x, 30));
          field->registerObject();
          field->registerObject();
          mChildren.push_back( field );
          mChildren.push_back( field );
-         mStack->addObject( field );
+         mGrid->addObject( field );
       }
       }
    }
    }
    
    
-   mStack->pushObjectToBack(mAddCtrl);
+   mGrid->pushObjectToBack(mAddCtrl);
 
 
    setUpdate();
    setUpdate();
 
 
@@ -835,11 +965,11 @@ void GuiInspectorDynamicGroup::clearFields()
    // save mAddCtrl
    // save mAddCtrl
    Sim::getGuiGroup()->addObject(mAddCtrl);
    Sim::getGuiGroup()->addObject(mAddCtrl);
    // delete everything else
    // delete everything else
-   mStack->clear();
+   mGrid->clear();
    // clear the mChildren list.
    // clear the mChildren list.
    mChildren.clear();
    mChildren.clear();
    // and restore.
    // and restore.
-   mStack->addObject(mAddCtrl);
+   mGrid->addObject(mAddCtrl);
 }
 }
 
 
 SimFieldDictionary::Entry* GuiInspectorDynamicGroup::findDynamicFieldInDictionary( StringTableEntry fieldName )
 SimFieldDictionary::Entry* GuiInspectorDynamicGroup::findDynamicFieldInDictionary( StringTableEntry fieldName )
@@ -863,7 +993,7 @@ SimFieldDictionary::Entry* GuiInspectorDynamicGroup::findDynamicFieldInDictionar
 void GuiInspectorDynamicGroup::addDynamicField()
 void GuiInspectorDynamicGroup::addDynamicField()
 {
 {
    // We can't add a field without a target
    // We can't add a field without a target
-   if( !mTarget || !mStack )
+   if( !mTarget || !mGrid)
    {
    {
       Con::warnf("GuiInspectorDynamicGroup::addDynamicField - no target SimObject to add a dynamic field to.");
       Con::warnf("GuiInspectorDynamicGroup::addDynamicField - no target SimObject to add a dynamic field to.");
       return;
       return;
@@ -885,14 +1015,16 @@ void GuiInspectorDynamicGroup::addDynamicField()
 
 
    // now we simply re-inspect the object, to see the new field.
    // now we simply re-inspect the object, to see the new field.
    this->inspectGroup();
    this->inspectGroup();
-   animateToContents();
+   //animateToContents();
 }
 }
 
 
 ConsoleMethod( GuiInspectorDynamicGroup, addDynamicField, void, 2, 2, "obj.addDynamicField();" )
 ConsoleMethod( GuiInspectorDynamicGroup, addDynamicField, void, 2, 2, "obj.addDynamicField();" )
 {
 {
    object->addDynamicField();
    object->addDynamicField();
 }
 }
+#pragma endregion
 
 
+#pragma region GuiInspectorDynamicField
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
 // GuiInspectorDynamicField - Child class of GuiInspectorField 
 // GuiInspectorDynamicField - Child class of GuiInspectorField 
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
@@ -900,9 +1032,7 @@ IMPLEMENT_CONOBJECT(GuiInspectorDynamicField);
 
 
 GuiInspectorDynamicField::GuiInspectorDynamicField( GuiInspectorGroup* parent, SimObjectPtr<SimObject> target, SimFieldDictionary::Entry* field )
 GuiInspectorDynamicField::GuiInspectorDynamicField( GuiInspectorGroup* parent, SimObjectPtr<SimObject> target, SimFieldDictionary::Entry* field )
 {
 {
-   mCaption    = NULL;
-
-   mParent     = parent;
+   mGroup     = parent;
    mTarget     = target;
    mTarget     = target;
    mDynField   = field;
    mDynField   = field;
    mRenameCtrl = NULL;
    mRenameCtrl = NULL;
@@ -935,7 +1065,7 @@ const char* GuiInspectorDynamicField::getData()
 
 
 void GuiInspectorDynamicField::renameField( StringTableEntry newFieldName )
 void GuiInspectorDynamicField::renameField( StringTableEntry newFieldName )
 {
 {
-   if( mTarget == NULL || mDynField == NULL || mParent == NULL || mEdit == NULL )
+   if( mTarget == NULL || mDynField == NULL || mGroup == NULL || mEdit == NULL )
    {
    {
       Con::warnf("GuiInspectorDynamicField::renameField - No target object or dynamic field data found!" );
       Con::warnf("GuiInspectorDynamicField::renameField - No target object or dynamic field data found!" );
       return;
       return;
@@ -952,7 +1082,7 @@ void GuiInspectorDynamicField::renameField( StringTableEntry newFieldName )
       return;
       return;
 
 
    // Grab a pointer to our parent and cast it to GuiInspectorDynamicGroup
    // Grab a pointer to our parent and cast it to GuiInspectorDynamicGroup
-   GuiInspectorDynamicGroup *group = dynamic_cast<GuiInspectorDynamicGroup*>(mParent);
+   GuiInspectorDynamicGroup *group = dynamic_cast<GuiInspectorDynamicGroup*>(mGroup);
 
 
    if( group == NULL )
    if( group == NULL )
    {
    {
@@ -1041,7 +1171,7 @@ GuiControl* GuiInspectorDynamicField::constructRenameControl()
    GuiButtonCtrl * delButt = new GuiButtonCtrl();
    GuiButtonCtrl * delButt = new GuiButtonCtrl();
    if( delButt != NULL )
    if( delButt != NULL )
    {
    {
-      dSprintf(szBuffer, 512, "%d.%s = \"\";%d.inspectGroup();", mTarget->getId(), getFieldName(), mParent->getId());
+      dSprintf(szBuffer, 512, "%d.%s = \"\";%d.inspectGroup();", mTarget->getId(), getFieldName(), mGroup->getId());
 
 
       delButt->setField("profile", "GuiButtonDynProfile");
       delButt->setField("profile", "GuiButtonDynProfile");
       delButt->setField("Text", "X");
       delButt->setField("Text", "X");
@@ -1060,7 +1190,9 @@ void GuiInspectorDynamicField::resize( const Point2I &newPosition, const Point2I
 {
 {
    Parent::resize( newPosition, newExtent );
    Parent::resize( newPosition, newExtent );
 }
 }
+#pragma endregion
 
 
+#pragma region GuiInspectorDatablockField
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
 // GuiInspectorDatablockField 
 // GuiInspectorDatablockField 
 // Field construction for datablock types
 // Field construction for datablock types
@@ -1116,7 +1248,7 @@ GuiControl* GuiInspectorDatablockField::constructEditControl()
 
 
    // Configure it to update our value when the dropdown is closed
    // Configure it to update our value when the dropdown is closed
    char szBuffer[512];
    char szBuffer[512];
-   dSprintf( szBuffer, 512, "%d.%s = %d.getText();%d.inspect(%d);",mTarget->getId(), mField->pFieldname, menu->getId(), mParent->mParent->getId(), mTarget->getId() );
+   dSprintf( szBuffer, 512, "%d.%s = %d.getText();%d.inspect(%d);",mTarget->getId(), mField->pFieldname, menu->getId(), mGroup->mInspector->getId(), mTarget->getId() );
    menu->setField("Command", szBuffer );
    menu->setField("Command", szBuffer );
 
 
    Vector<StringTableEntry> entries;
    Vector<StringTableEntry> entries;
@@ -1144,3 +1276,4 @@ GuiControl* GuiInspectorDatablockField::constructEditControl()
 
 
    return retCtrl;
    return retCtrl;
 }
 }
+#pragma endregion

+ 40 - 15
engine/source/gui/editor/guiInspector.h

@@ -58,7 +58,13 @@
 #include "gui/containers/guiChainCtrl.h"
 #include "gui/containers/guiChainCtrl.h"
 #endif
 #endif
 
 
+#ifndef _GUIGRIDCTRL_H_
+#include "gui/containers/guiGridCtrl.h"
+#endif
+
+#ifndef _GUIPANELCTRL_H_
 #include "gui/containers/guiPanelCtrl.h"
 #include "gui/containers/guiPanelCtrl.h"
+#endif
 
 
 
 
 // Forward Declare GuiInspectorGroup
 // Forward Declare GuiInspectorGroup
@@ -79,15 +85,41 @@ public:
 
 
    GuiInspector();
    GuiInspector();
    ~GuiInspector();
    ~GuiInspector();
+   static void initPersistFields();
    DECLARE_CONOBJECT(GuiInspector);
    DECLARE_CONOBJECT(GuiInspector);
 
 
+   virtual void inspectPostApply();
+   virtual void resize(const Point2I &newPosition, const Point2I &newExtent);
    virtual void parentResized(const Point2I &oldParentExtent, const Point2I &newParentExtent);
    virtual void parentResized(const Point2I &oldParentExtent, const Point2I &newParentExtent);
    void inspectObject( SimObject *object );
    void inspectObject( SimObject *object );
    inline SimObject *getInspectObject() { return mTarget.isNull() ? NULL : mTarget; };
    inline SimObject *getInspectObject() { return mTarget.isNull() ? NULL : mTarget; };
    void setName( const char* newName );
    void setName( const char* newName );
    void clearGroups();
    void clearGroups();
-   bool onAdd();
    bool findExistentGroup( StringTableEntry groupName );
    bool findExistentGroup( StringTableEntry groupName );
+
+   GuiControlProfile *mGroupPanelProfile;
+   GuiControlProfile *mGroupGridProfile;
+   GuiControlProfile *mLabelProfile;
+   GuiControlProfile *mTextEditProfile;
+   GuiControlProfile *mDropDownProfile;
+   GuiControlProfile *mDropDownItemProfile;
+   GuiControlProfile *mScrollProfile;
+   GuiControlProfile *mBackgroundProfile;
+   GuiControlProfile *mThumbProfile;
+   GuiControlProfile *mArrowProfile;
+   GuiControlProfile *mTrackProfile;
+   GuiControlProfile *mCheckboxProfile;
+   GuiControlProfile *mButtonProfile;
+
+   bool onWake();
+   void onSleep();
+
+   S32 mScrollBarThickness;
+   bool mShowArrowButtons;
+   bool mUseConstantHeightThumb;
+
+   Point2I mFieldCellSize;
+   Point2I mControlOffset;
 };
 };
 
 
 class GuiInspectorField : public GuiControl
 class GuiInspectorField : public GuiControl
@@ -95,12 +127,9 @@ class GuiInspectorField : public GuiControl
 private:
 private:
    typedef GuiControl Parent;
    typedef GuiControl Parent;
 public:
 public:
-   // Static Caption Width (in percentage) for all inspector fields
-   static S32                 smCaptionWidth;
 
 
    // Members
    // Members
-   StringTableEntry           mCaption;
-   GuiInspectorGroup*         mParent;
+   GuiInspectorGroup*         mGroup;
    SimObjectPtr<SimObject>    mTarget;
    SimObjectPtr<SimObject>    mTarget;
    AbstractClassRep::Field*   mField;
    AbstractClassRep::Field*   mField;
    StringTableEntry           mFieldArrayIndex;
    StringTableEntry           mFieldArrayIndex;
@@ -114,21 +143,19 @@ public:
    DECLARE_CONOBJECT(GuiInspectorField);
    DECLARE_CONOBJECT(GuiInspectorField);
 
 
    virtual void setTarget( SimObjectPtr<SimObject> target ) { mTarget = target; };
    virtual void setTarget( SimObjectPtr<SimObject> target ) { mTarget = target; };
-   virtual void setParent( GuiInspectorGroup* parent ) { mParent = parent; };
+   virtual void setInspectorGroup( GuiInspectorGroup* grp ) { mGroup = grp; };
    virtual void setInspectorField( AbstractClassRep::Field *field, const char*arrayIndex = NULL );
    virtual void setInspectorField( AbstractClassRep::Field *field, const char*arrayIndex = NULL );
 
 
 protected:
 protected:
    void registerEditControl( GuiControl *ctrl );
    void registerEditControl( GuiControl *ctrl );
 public:
 public:
-   virtual GuiControl* constructEditControl();
+   virtual GuiControl* constructEditControl(S32 width);
    virtual void        updateValue( const char* newValue );
    virtual void        updateValue( const char* newValue );
    virtual StringTableEntry getFieldName();
    virtual StringTableEntry getFieldName();
    virtual void              setData( const char* data );
    virtual void              setData( const char* data );
    virtual const char*  getData();
    virtual const char*  getData();
 
 
-   virtual void resize(const Point2I &newPosition, const Point2I &newExtent);
    virtual bool onAdd();
    virtual bool onAdd();
-   virtual void onRender(Point2I offset, const RectI &updateRect);
 };
 };
 
 
 class GuiInspectorGroup : public GuiPanelCtrl
 class GuiInspectorGroup : public GuiPanelCtrl
@@ -138,14 +165,13 @@ private:
 public:
 public:
    // Members
    // Members
    SimObjectPtr<SimObject>             mTarget;
    SimObjectPtr<SimObject>             mTarget;
-   SimObjectPtr<GuiInspector>          mParent;
+   SimObjectPtr<GuiInspector>          mInspector;
    Vector<GuiInspectorField*>          mChildren;
    Vector<GuiInspectorField*>          mChildren;
-   GuiChainCtrl*						      mStack;
+   GuiGridCtrl*						   mGrid;
 
 
    // Constructor/Destructor/Conobject Declaration
    // Constructor/Destructor/Conobject Declaration
    GuiInspectorGroup();
    GuiInspectorGroup();
-   GuiInspectorGroup( SimObjectPtr<SimObject> target, StringTableEntry groupName, SimObjectPtr<GuiInspector> parent );
-   ~GuiInspectorGroup();
+   GuiInspectorGroup( SimObjectPtr<SimObject> target, StringTableEntry groupName, SimObjectPtr<GuiInspector> inspector );
    DECLARE_CONOBJECT(GuiInspectorGroup);
    DECLARE_CONOBJECT(GuiInspectorGroup);
 
 
    virtual GuiInspectorField* constructField( S32 fieldType );
    virtual GuiInspectorField* constructField( S32 fieldType );
@@ -154,12 +180,11 @@ public:
    // Publicly Accessible Information about this group
    // Publicly Accessible Information about this group
    StringTableEntry getGroupName() { return mText; };
    StringTableEntry getGroupName() { return mText; };
    SimObjectPtr<SimObject> getGroupTarget() { return mTarget; };
    SimObjectPtr<SimObject> getGroupTarget() { return mTarget; };
-   SimObjectPtr<GuiInspector> getContentCtrl() { return mParent; };
+   SimObjectPtr<GuiInspector> getContentCtrl() { return mInspector; };
 
 
    bool onAdd();
    bool onAdd();
    virtual bool inspectGroup();
    virtual bool inspectGroup();
 
 
-   virtual void animateToContents();
 protected:
 protected:
    // overridable method that creates our inner controls.
    // overridable method that creates our inner controls.
    virtual bool createContent();
    virtual bool createContent();

+ 199 - 168
engine/source/gui/editor/guiInspectorTypes.cc

@@ -26,30 +26,39 @@
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
 IMPLEMENT_CONOBJECT(GuiInspectorTypeEnum);
 IMPLEMENT_CONOBJECT(GuiInspectorTypeEnum);
 
 
-GuiControl* GuiInspectorTypeEnum::constructEditControl()
+GuiControl* GuiInspectorTypeEnum::constructEditControl(S32 width)
 {
 {
-   GuiControl* retCtrl = new GuiDropDownCtrl();
+	GuiDropDownCtrl* retCtrl = new GuiDropDownCtrl();
 
 
    // If we couldn't construct the control, bail!
    // If we couldn't construct the control, bail!
    if( retCtrl == NULL )
    if( retCtrl == NULL )
       return retCtrl;
       return retCtrl;
 
 
-   GuiDropDownCtrl *menu = dynamic_cast<GuiDropDownCtrl*>(retCtrl);
-
    // Let's make it look pretty.
    // Let's make it look pretty.
-   retCtrl->setExtent(Point2I((mParent->getWidth() / 2) - 20, 24));
-   menu->setField("text", getData());
+   retCtrl->setControlProfile(mGroup->mInspector->mDropDownProfile);
+   retCtrl->setControlListBoxProfile(mGroup->mInspector->mDropDownItemProfile);
+   retCtrl->setControlScrollProfile(mGroup->mInspector->mScrollProfile);
+   retCtrl->setControlThumbProfile(mGroup->mInspector->mThumbProfile);
+   retCtrl->setControlArrowProfile(mGroup->mInspector->mArrowProfile);
+   retCtrl->setControlTrackProfile(mGroup->mInspector->mTrackProfile);
+   retCtrl->setControlBackgroundProfile(mGroup->mInspector->mBackgroundProfile);
+   retCtrl->setConstantThumbHeight(mGroup->mInspector->mUseConstantHeightThumb);
+   retCtrl->setShowArrowButtons(mGroup->mInspector->mShowArrowButtons);
+   retCtrl->setScrollBarThickness(mGroup->mInspector->mScrollBarThickness);
 
 
    registerEditControl( retCtrl );
    registerEditControl( retCtrl );
 
 
    // Configure it to update our value when the popup is closed
    // Configure it to update our value when the popup is closed
    char szBuffer[512];
    char szBuffer[512];
-   dSprintf( szBuffer, 512, "%d.%s = %d.getText();%d.inspect(%d);",mTarget->getId(), mField->pFieldname, menu->getId(), mParent->mParent->getId(), mTarget->getId() );
-   menu->setField("Command", szBuffer );
+   dSprintf( szBuffer, 512, "%d.%s = %d.getText();%d.inspect(%d);",mTarget->getId(), mField->pFieldname, retCtrl->getId(), mGroup->mInspector->getId(), mTarget->getId() );
+   retCtrl->setField("Command", szBuffer );
+   retCtrl->mBounds.set(mGroup->mInspector->mControlOffset, Point2I(width - mGroup->mInspector->mControlOffset.x, 24));
 
 
    //now add the entries
    //now add the entries
    for(S32 i = 0; i < mField->table->size; i++)
    for(S32 i = 0; i < mField->table->size; i++)
-      menu->getList()->addItemWithID(mField->table->table[i].label, mField->table->table[i].index);
+	   retCtrl->getList()->addItemWithID(mField->table->table[i].label, mField->table->table[i].index);
+   
+   retCtrl->setField("text", getData());
 
 
    return retCtrl;
    return retCtrl;
 }
 }
@@ -94,33 +103,31 @@ StringTableEntry  GuiInspectorTypeEnum::getData()
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
 IMPLEMENT_CONOBJECT(GuiInspectorTypeCheckBox);
 IMPLEMENT_CONOBJECT(GuiInspectorTypeCheckBox);
 
 
-GuiControl* GuiInspectorTypeCheckBox::constructEditControl()
+GuiControl* GuiInspectorTypeCheckBox::constructEditControl(S32 width)
 {
 {
-   GuiControl* retCtrl = new GuiCheckBoxCtrl();
+	GuiCheckBoxCtrl* retCtrl = new GuiCheckBoxCtrl();
 
 
-   // If we couldn't construct the control, bail!
-   if( retCtrl == NULL )
-      return retCtrl;
-
-   GuiCheckBoxCtrl *check = dynamic_cast<GuiCheckBoxCtrl*>(retCtrl);
-
-   // Let's make it look pretty.
-   retCtrl->setField( "profile", "GuiCheckBoxProfile" );
-   retCtrl->setField( "text", "" );
-   retCtrl->setExtent(Point2I(20, 30));
+	// If we couldn't construct the control, bail!
+	if( retCtrl == NULL )
+		return retCtrl;
 
 
-   //check->mIndent = 4;
+	// Let's make it look pretty.
+	retCtrl->setControlProfile(mGroup->mInspector->mCheckboxProfile);
 
 
-   retCtrl->setScriptValue( getData() );
+	retCtrl->setText(mText);
+	mText = StringTable->EmptyString;
+	retCtrl->setScriptValue( getData() );
 
 
-   registerEditControl( retCtrl );
+	registerEditControl( retCtrl );
 
 
-   // Configure it to update our value when the popup is closed
-   char szBuffer[512];
-   dSprintf( szBuffer, 512, "%d.apply(%d.getValue());",getId(),check->getId() );
-   check->setField("Command", szBuffer );
+	// Configure it to update our value when the popup is closed
+	char szBuffer[512];
+	dSprintf( szBuffer, 512, "%d.apply(%d.getValue());",getId(),retCtrl->getId() );
+	retCtrl->setField("Command", szBuffer );
+	retCtrl->mBounds.set(mGroup->mInspector->mControlOffset, Point2I(width - mGroup->mInspector->mControlOffset.x, 30));
+	retCtrl->setTextExtent(Point2I(retCtrl->getExtent().x - retCtrl->getTextOffset().x, retCtrl->getExtent().y - retCtrl->getTextOffset().y));
 
 
-   return retCtrl;
+	return retCtrl;
 }
 }
 
 
 
 
@@ -150,26 +157,33 @@ static S32 QSORT_CALLBACK stringCompare(const void *a,const void *b)
    return(dStricmp(sa, sb));
    return(dStricmp(sa, sb));
 }
 }
 
 
-GuiControl* GuiInspectorTypeGuiProfile::constructEditControl()
+GuiControl* GuiInspectorTypeGuiProfile::constructEditControl(S32 width)
 {
 {
-   GuiControl* retCtrl = new GuiDropDownCtrl();
+	GuiDropDownCtrl* retCtrl = new GuiDropDownCtrl();
 
 
    // If we couldn't construct the control, bail!
    // If we couldn't construct the control, bail!
    if( retCtrl == NULL )
    if( retCtrl == NULL )
       return retCtrl;
       return retCtrl;
 
 
-   GuiDropDownCtrl *menu = dynamic_cast<GuiDropDownCtrl*>(retCtrl);
-
    // Let's make it look pretty.
    // Let's make it look pretty.
-   retCtrl->setExtent(Point2I((mParent->getWidth() / 2) - 20, 24));
-   menu->setField("text", getData());
+   retCtrl->setControlProfile(mGroup->mInspector->mDropDownProfile);
+   retCtrl->setControlListBoxProfile(mGroup->mInspector->mDropDownItemProfile);
+   retCtrl->setControlScrollProfile(mGroup->mInspector->mScrollProfile);
+   retCtrl->setControlThumbProfile(mGroup->mInspector->mThumbProfile);
+   retCtrl->setControlArrowProfile(mGroup->mInspector->mArrowProfile);
+   retCtrl->setControlTrackProfile(mGroup->mInspector->mTrackProfile);
+   retCtrl->setControlBackgroundProfile(mGroup->mInspector->mBackgroundProfile);
+   retCtrl->setConstantThumbHeight(mGroup->mInspector->mUseConstantHeightThumb);
+   retCtrl->setShowArrowButtons(mGroup->mInspector->mShowArrowButtons);
+   retCtrl->setScrollBarThickness(mGroup->mInspector->mScrollBarThickness);
 
 
    registerEditControl( retCtrl );
    registerEditControl( retCtrl );
 
 
    // Configure it to update our value when the popup is closed
    // Configure it to update our value when the popup is closed
    char szBuffer[512];
    char szBuffer[512];
-   dSprintf( szBuffer, 512, "%d.apply(%d.getText());",getId(),menu->getId() );
-   menu->setField("Command", szBuffer );
+   dSprintf( szBuffer, 512, "%d.apply(%d.getText());",getId(),retCtrl->getId() );
+   retCtrl->setField("Command", szBuffer );
+   retCtrl->mBounds.set(mGroup->mInspector->mControlOffset, Point2I(width - mGroup->mInspector->mControlOffset.x, 24));
 
 
    Vector<StringTableEntry> entries;
    Vector<StringTableEntry> entries;
 
 
@@ -183,9 +197,11 @@ GuiControl* GuiInspectorTypeGuiProfile::constructEditControl()
       }
       }
    }
    }
 
 
-   menu->getList()->sortByText();
+   retCtrl->getList()->sortByText();
    for(U32 j = 0; j < (U32)entries.size(); j++)
    for(U32 j = 0; j < (U32)entries.size(); j++)
-      menu->getList()->addItem(entries[j]);
+	   retCtrl->getList()->addItem(entries[j]);
+
+   retCtrl->setField("text", getData());
 
 
    return retCtrl;
    return retCtrl;
 }
 }
@@ -202,26 +218,33 @@ void GuiInspectorTypeGuiBorderProfile::consoleInit()
    ConsoleBaseType::getType(TypeGuiBorderProfile)->setInspectorFieldType("GuiInspectorTypeGuiBorderProfile");
    ConsoleBaseType::getType(TypeGuiBorderProfile)->setInspectorFieldType("GuiInspectorTypeGuiBorderProfile");
 }
 }
 
 
-GuiControl* GuiInspectorTypeGuiBorderProfile::constructEditControl()
+GuiControl* GuiInspectorTypeGuiBorderProfile::constructEditControl(S32 width)
 {
 {
-   GuiControl* retCtrl = new GuiDropDownCtrl();
+	GuiDropDownCtrl* retCtrl = new GuiDropDownCtrl();
 
 
    // If we couldn't construct the control, bail!
    // If we couldn't construct the control, bail!
    if (retCtrl == NULL)
    if (retCtrl == NULL)
       return retCtrl;
       return retCtrl;
 
 
-   GuiDropDownCtrl *menu = dynamic_cast<GuiDropDownCtrl*>(retCtrl);
-
    // Let's make it look pretty.
    // Let's make it look pretty.
-   retCtrl->setExtent(Point2I((mParent->getWidth() / 2) - 20, 24));
-   menu->setField("text", getData());
+   retCtrl->setControlProfile(mGroup->mInspector->mDropDownProfile);
+   retCtrl->setControlListBoxProfile(mGroup->mInspector->mDropDownItemProfile);
+   retCtrl->setControlScrollProfile(mGroup->mInspector->mScrollProfile);
+   retCtrl->setControlThumbProfile(mGroup->mInspector->mThumbProfile);
+   retCtrl->setControlArrowProfile(mGroup->mInspector->mArrowProfile);
+   retCtrl->setControlTrackProfile(mGroup->mInspector->mTrackProfile);
+   retCtrl->setControlBackgroundProfile(mGroup->mInspector->mBackgroundProfile);
+   retCtrl->setConstantThumbHeight(mGroup->mInspector->mUseConstantHeightThumb);
+   retCtrl->setShowArrowButtons(mGroup->mInspector->mShowArrowButtons);
+   retCtrl->setScrollBarThickness(mGroup->mInspector->mScrollBarThickness);
 
 
    registerEditControl(retCtrl);
    registerEditControl(retCtrl);
 
 
    // Configure it to update our value when the popup is closed
    // Configure it to update our value when the popup is closed
    char szBuffer[512];
    char szBuffer[512];
-   dSprintf(szBuffer, 512, "%d.apply(%d.getText());", getId(), menu->getId());
-   menu->setField("Command", szBuffer);
+   dSprintf(szBuffer, 512, "%d.apply(%d.getText());", getId(), retCtrl->getId());
+   retCtrl->setField("Command", szBuffer);
+   retCtrl->mBounds.set(mGroup->mInspector->mControlOffset, Point2I(width - mGroup->mInspector->mControlOffset.x, 24));
 
 
    Vector<StringTableEntry> entries;
    Vector<StringTableEntry> entries;
 
 
@@ -235,9 +258,9 @@ GuiControl* GuiInspectorTypeGuiBorderProfile::constructEditControl()
       }
       }
    }
    }
 
 
-   menu->getList()->sortByText();
+   retCtrl->getList()->sortByText();
    for (U32 j = 0; j < (U32)entries.size(); j++)
    for (U32 j = 0; j < (U32)entries.size(); j++)
-      menu->getList()->addItem(entries[j]);
+	   retCtrl->getList()->addItem(entries[j]);
 
 
    return retCtrl;
    return retCtrl;
 }
 }
@@ -255,7 +278,7 @@ void GuiInspectorTypeFileName::consoleInit()
    ConsoleBaseType::getType(TypeFilename)->setInspectorFieldType("GuiInspectorTypeFileName");
    ConsoleBaseType::getType(TypeFilename)->setInspectorFieldType("GuiInspectorTypeFileName");
 }
 }
 
 
-GuiControl* GuiInspectorTypeFileName::constructEditControl()
+GuiControl* GuiInspectorTypeFileName::constructEditControl(S32 width)
 {
 {
    GuiControl* retCtrl = new GuiControl();
    GuiControl* retCtrl = new GuiControl();
 
 
@@ -264,7 +287,7 @@ GuiControl* GuiInspectorTypeFileName::constructEditControl()
       return retCtrl;
       return retCtrl;
 
 
    // Let's make it look pretty.
    // Let's make it look pretty.
-   retCtrl->setField( "profile", "GuiTextProfile" );
+   retCtrl->setControlProfile(mGroup->mInspector->mTextEditProfile);
 
 
    // Don't forget to register ourselves
    // Don't forget to register ourselves
    registerEditControl( retCtrl );
    registerEditControl( retCtrl );
@@ -273,23 +296,21 @@ GuiControl* GuiInspectorTypeFileName::constructEditControl()
    dSprintf( szBuffer, 512, "%d.apply(%d.getText());",getId(),retCtrl->getId() );
    dSprintf( szBuffer, 512, "%d.apply(%d.getText());",getId(),retCtrl->getId() );
    retCtrl->setField("AltCommand", szBuffer );
    retCtrl->setField("AltCommand", szBuffer );
    retCtrl->setField("Validate", szBuffer );
    retCtrl->setField("Validate", szBuffer );
-   retCtrl->setExtent(Point2I((mParent->getExtent().x / 2) - 20, 25));
+   retCtrl->mBounds.set(mGroup->mInspector->mControlOffset, Point2I(width - (mGroup->mInspector->mControlOffset.x + 34), 30));
 
 
    mBrowseButton = new GuiButtonCtrl();
    mBrowseButton = new GuiButtonCtrl();
 
 
    if( mBrowseButton != NULL )
    if( mBrowseButton != NULL )
    {
    {
-      
       char szBuffer[512];
       char szBuffer[512];
       dSprintf( szBuffer, 512, "getLoadFilename(\"*.*\", \"%d.apply\", \"%s\");",getId(), getData());
       dSprintf( szBuffer, 512, "getLoadFilename(\"*.*\", \"%d.apply\", \"%s\");",getId(), getData());
       mBrowseButton->setField( "Command", szBuffer );
       mBrowseButton->setField( "Command", szBuffer );
-      mBrowseButton->setField( "text", "..." );
-      mBrowseButton->setField( "Profile", "GuiButtonDynProfile" );
+      mBrowseButton->setField( "text", "..." ); 
+	  mBrowseButton->setControlProfile(mGroup->mInspector->mButtonProfile);
       mBrowseButton->registerObject();
       mBrowseButton->registerObject();
-      mBrowseButton->setExtent(Point2I(30, 25));
-      mBrowseButton->setPosition(Point2I(((mParent->getExtent().x / 2) - 20) - 30, 0));
-      retCtrl->addObject( mBrowseButton );
-
+      mBrowseButton->setExtent(Point2I(30, 28));
+      mBrowseButton->setPosition(Point2I(mGroup->mInspector->mControlOffset.x + retCtrl->getWidth() + 4, mGroup->mInspector->mControlOffset.y + 1));
+      addObject( mBrowseButton );
    }
    }
 
 
    return retCtrl;
    return retCtrl;
@@ -305,9 +326,9 @@ void GuiInspectorTypeFileName::resize( const Point2I &newPosition, const Point2I
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
 IMPLEMENT_CONOBJECT(GuiInspectorTypeColor);
 IMPLEMENT_CONOBJECT(GuiInspectorTypeColor);
 
 
-GuiControl* GuiInspectorTypeColor::constructEditControl()
+GuiControl* GuiInspectorTypeColor::constructEditControl(S32 width)
 {
 {
-   GuiControl* retCtrl = new GuiColorPickerCtrl();
+	GuiColorPickerCtrl* retCtrl = new GuiColorPickerCtrl();
 
 
    // If we couldn't construct the control, bail!
    // If we couldn't construct the control, bail!
    if( retCtrl == NULL )
    if( retCtrl == NULL )
@@ -316,12 +337,12 @@ GuiControl* GuiInspectorTypeColor::constructEditControl()
    // Don't forget to register ourselves
    // Don't forget to register ourselves
    registerEditControl( retCtrl );
    registerEditControl( retCtrl );
 
 
-   retCtrl->setExtent(Point2I((getExtent().x / 2) - 30, 30));
    const char* mCol = getData();
    const char* mCol = getData();
    retCtrl->setField("BaseColor", mCol);
    retCtrl->setField("BaseColor", mCol);
    char szBuffer[512];
    char szBuffer[512];
    dSprintf(szBuffer, 512, "%s(\"%s\", \"%d.apply\");", mColorFunction, getData(), getId());
    dSprintf(szBuffer, 512, "%s(\"%s\", \"%d.apply\");", mColorFunction, getData(), getId());
    retCtrl->setField("Command", szBuffer);
    retCtrl->setField("Command", szBuffer);
+   retCtrl->mBounds.set(mGroup->mInspector->mControlOffset, Point2I(width - mGroup->mInspector->mControlOffset.x, 24));
 
 
    return retCtrl;
    return retCtrl;
 }
 }
@@ -380,7 +401,7 @@ void GuiInspectorTypeSimObjectPtr::consoleInit()
    ConsoleBaseType::getType(TypeSimObjectPtr)->setInspectorFieldType("GuiInspectorTypeSimObjectPtr");
    ConsoleBaseType::getType(TypeSimObjectPtr)->setInspectorFieldType("GuiInspectorTypeSimObjectPtr");
 }
 }
 
 
-GuiControl * GuiInspectorTypeSimObjectPtr::constructEditControl()
+GuiControl * GuiInspectorTypeSimObjectPtr::constructEditControl(S32 width)
 {
 {
    GuiControl* retCtrl = new GuiControl();
    GuiControl* retCtrl = new GuiControl();
 
 
@@ -388,8 +409,13 @@ GuiControl * GuiInspectorTypeSimObjectPtr::constructEditControl()
    if (retCtrl == NULL)
    if (retCtrl == NULL)
       return retCtrl;
       return retCtrl;
 
 
-   retCtrl->setField("profile", "GuiTextProfile");
-   retCtrl->setExtent(Point2I((mParent->getWidth() / 2) - 20, 25));
+   // Let's make it look pretty.
+   retCtrl->setControlProfile(mGroup->mInspector->mLabelProfile);
+
+   // Don't forget to register ourselves
+   registerEditControl(retCtrl);
+
+   retCtrl->mBounds.set(mGroup->mInspector->mControlOffset, Point2I(width - mGroup->mInspector->mControlOffset.x, 30));
    retCtrl->setField("text", getData());
    retCtrl->setField("text", getData());
 
 
    return retCtrl;
    return retCtrl;
@@ -416,10 +442,8 @@ void GuiInspectorTypeS32::consoleInit()
    ConsoleBaseType::getType(TypeS32)->setInspectorFieldType("GuiInspectorTypeS32");
    ConsoleBaseType::getType(TypeS32)->setInspectorFieldType("GuiInspectorTypeS32");
 }
 }
 
 
-GuiControl * GuiInspectorTypeS32::constructEditControl()
+GuiControl * GuiInspectorTypeS32::constructEditControl(S32 width)
 {
 {
-   
-   GuiControl* retCtrl;
    const char* mData = getData();
    const char* mData = getData();
    const char* mName = mField->pFieldname; 
    const char* mName = mField->pFieldname; 
    U32 mCount = 1;
    U32 mCount = 1;
@@ -431,94 +455,90 @@ GuiControl * GuiInspectorTypeS32::constructEditControl()
    // this is just here for Collision layers and groups, needs to be swapped over to a different type.
    // this is just here for Collision layers and groups, needs to be swapped over to a different type.
    if (mCount == 32)
    if (mCount == 32)
    {
    {
-      retCtrl = new GuiGridCtrl();
+      GuiGridCtrl *retCtrl = new GuiGridCtrl();
       registerEditControl(retCtrl);
       registerEditControl(retCtrl);
-      retCtrl->setField("CellSizeX","35");
-      retCtrl->setField("CellSizeY","30");
-      retCtrl->setExtent(Point2I(mParent->getExtent().x / 2, 10));
 
 
+	  retCtrl->mCellModeX = GuiGridCtrl::Absolute;
+	  retCtrl->mCellModeY = GuiGridCtrl::Absolute;
+	  retCtrl->mCellSpacingX = 8;
+	  retCtrl->mCellSpacingY = 4;
+
+	  retCtrl->mBounds.set(mGroup->mInspector->mControlOffset, Point2I(width - mGroup->mInspector->mControlOffset.x, 30));
+
+	  U32 labelWidth = mGroup->mInspector->mLabelProfile->mFont->getStrWidth("00");
+	  U32 x = 0, y = 0;
       for (U32 i = 0; i < mCount; i++)
       for (U32 i = 0; i < mCount; i++)
       {
       {
          char szName[32];
          char szName[32];
          dSprintf(szName, 32, "%d", i);
          dSprintf(szName, 32, "%d", i);
-         // create our elemnts.
-         GuiControl* mCont = new GuiControl;
-         registerEditControl(mCont);
-         GuiControl* mLabel = new GuiControl;
-         registerEditControl(mLabel);
-         GuiCheckBoxCtrl* mCheck = new GuiCheckBoxCtrl;
-         registerEditControl(mCheck);
+
+         // create our checkboxes.
+         GuiCheckBoxCtrl* checkBox = new GuiCheckBoxCtrl;
+         registerEditControl(checkBox);
+		 checkBox->setControlProfile(mGroup->mInspector->mCheckboxProfile);
+		 checkBox->setTextOffset(Point2I(2,0));
+		 checkBox->setTextExtent(Point2I(labelWidth + 2, checkBox->mProfile->mFont->getHeight() + 2));
+		 checkBox->setBoxOffset(Point2I(checkBox->getTextExtent().x + 2, 0));
+		 checkBox->setText(szName);
+
          // collision group and layer default to on.
          // collision group and layer default to on.
          const char* val = StringUnit::getUnit(mData, i, " ");
          const char* val = StringUnit::getUnit(mData, i, " ");
          if (StringTable->insert(szName) == StringTable->insert(val))
          if (StringTable->insert(szName) == StringTable->insert(val))
          {
          {
-            mCheck->setStateOn(true);
+            checkBox->setStateOn(true);
          }
          }
          // say hello to my really big friend.
          // say hello to my really big friend.
          char szBuffer[512];
          char szBuffer[512];
          dSprintf(szBuffer, 512, "CollisionArrayUpdate(%d,\"%s\", \"%s\", %d, \"%d.apply\");",
          dSprintf(szBuffer, 512, "CollisionArrayUpdate(%d,\"%s\", \"%s\", %d, \"%d.apply\");",
-            mTarget->getId(), mName,szName,mCheck->getId(),getId());
-
-         mCheck->setField("Command", szBuffer);
-         // minimum size required for 2 numbers to show up and a checkbox.
-         mCont->setExtent(Point2I(35, 30));
-         mLabel->setText(szName);
-         mLabel->setExtent(Point2I(15, 30));
-         mCheck->setExtent(Point2I(20, 30));
-         mCont->addObject(mLabel);
-         mLabel->setPosition(Point2I(0, 0));
-         mCont->addObject(mCheck);
-         mCheck->setPosition(Point2I(15, 0));
-
-         retCtrl->addObject(mCont);
+            mTarget->getId(), mName,szName,checkBox->getId(),getId());
+
+         checkBox->setField("Command", szBuffer);
+
+		 if (i == 0)
+		 {
+			 U32 xNeeded = checkBox->getBoxOffset().x + checkBox->getBoxExtent().x;
+			 U32 yNeeded = checkBox->getBoxOffset().y + checkBox->getBoxExtent().y;
+
+			 Point2I outerExt = checkBox->getOuterExtent(Point2I(xNeeded, yNeeded), NormalState, checkBox->mProfile);
+
+			 x = (U32)outerExt.x;
+			 y = (U32)outerExt.y;
+		 }
+
+         retCtrl->addObject(checkBox);
       }
       }
 
 
-      GuiButtonCtrl* mAll = new GuiButtonCtrl;
-      registerEditControl(mAll);
-      GuiButtonCtrl* mNone = new GuiButtonCtrl;
-      registerEditControl(mNone);
+      GuiButtonCtrl* allButton = new GuiButtonCtrl;
+	  allButton->setControlProfile(mGroup->mInspector->mButtonProfile);
+      registerEditControl(allButton);
+
+      GuiButtonCtrl* noneButton = new GuiButtonCtrl;
+	  noneButton->setControlProfile(mGroup->mInspector->mButtonProfile);
+      registerEditControl(noneButton);
 
 
-      mAll->setText("All");
-      mNone->setText("None");
+      allButton->setText("All");
+      noneButton->setText("None");
+	  Point2I buttonExt = noneButton->getOuterExtent(Point2I(noneButton->mProfile->mFont->getStrWidth("None"), noneButton->mProfile->mFont->getHeight()), NormalState, noneButton->mProfile);
+
+      retCtrl->mCellSizeX = getMax(x, (U32)buttonExt.x);
+      retCtrl->mCellSizeY = getMax(y, (U32)buttonExt.y);
 
 
       char szBufferAll[512];
       char szBufferAll[512];
       dSprintf(szBufferAll, 512, "%d.apply(\"all\");", getId());
       dSprintf(szBufferAll, 512, "%d.apply(\"all\");", getId());
-      mAll->setField("Command", szBufferAll);
-      mAll->setField("profile", "GuiButtonDynProfile");
+      allButton->setField("Command", szBufferAll);
+
       dSprintf(szBufferAll, 512, "%d.apply(\"none\");", getId());
       dSprintf(szBufferAll, 512, "%d.apply(\"none\");", getId());
-      mNone->setField("Command", szBufferAll);
-      mNone->setField("profile", "GuiButtonDynProfile");
+      noneButton->setField("Command", szBufferAll);
 
 
-      retCtrl->addObject(mAll);
-      retCtrl->addObject(mNone);
+      retCtrl->addObject(allButton);
+      retCtrl->addObject(noneButton);
 
 
+	  return retCtrl;
    }
    }
    else
    else
    {
    {
-      // everything else should do fine under an ordinary text edit.
-      retCtrl = new GuiTextEditCtrl();
-
-      // If we couldn't construct the control, bail!
-      if (retCtrl == NULL)
-         return retCtrl;
-
-      // Let's make it look pretty.
-      retCtrl->setField("profile", "GuiNumberEditProfile");
-
-      // Don't forget to register ourselves
-      registerEditControl(retCtrl);
-
-      char szBuffer[512];
-      dSprintf(szBuffer, 512, "%d.apply(%d.getText());", getId(), retCtrl->getId());
-      retCtrl->setField("AltCommand", szBuffer);
-      retCtrl->setField("Validate", szBuffer);
-      retCtrl->setExtent(Point2I((getExtent().x / 2) - 40, 30));
-
+      return GuiInspectorField::constructEditControl(width);
    }
    }
-
-   
-
-   return retCtrl;
 }
 }
 
 
 const char* GuiInspectorTypeS32::getData()
 const char* GuiInspectorTypeS32::getData()
@@ -541,7 +561,7 @@ void GuiInspectorTypePoint2I::consoleInit()
    ConsoleBaseType::getType(TypePoint2I)->setInspectorFieldType("GuiInspectorTypePoint2I");
    ConsoleBaseType::getType(TypePoint2I)->setInspectorFieldType("GuiInspectorTypePoint2I");
 }
 }
 
 
-GuiControl * GuiInspectorTypePoint2I::constructEditControl()
+GuiControl * GuiInspectorTypePoint2I::constructEditControl(S32 width)
 {
 {
    // Do everything in a simple way first.
    // Do everything in a simple way first.
    // then complicate it.
    // then complicate it.
@@ -551,16 +571,20 @@ GuiControl * GuiInspectorTypePoint2I::constructEditControl()
    if (retCtrl == NULL)
    if (retCtrl == NULL)
       return retCtrl;
       return retCtrl;
 
 
+   // Let's make it look pretty.
+   retCtrl->setControlProfile(mGroup->mInspector->mBackgroundProfile);
+   retCtrl->mBounds.set(mGroup->mInspector->mControlOffset, Point2I(width - mGroup->mInspector->mControlOffset.x, 60));
+
    // get our data.
    // get our data.
    const char* mData = mTarget->getDataField(mField->pFieldname, NULL);
    const char* mData = mTarget->getDataField(mField->pFieldname, NULL);
    // Don't forget to register ourselves
    // Don't forget to register ourselves
    retCtrl->setCanSaveDynamicFields(true);
    retCtrl->setCanSaveDynamicFields(true);
    registerEditControl(retCtrl);
    registerEditControl(retCtrl);
-   // we want 2 controls in this one.
-   retCtrl->setExtent(Point2I(mParent->getExtent().x / 2, 60));
+
    // make our x fields.
    // make our x fields.
    GuiTextEditCtrl* mXctrl = new GuiTextEditCtrl();
    GuiTextEditCtrl* mXctrl = new GuiTextEditCtrl();
    GuiControl* mXLabel = new GuiControl();
    GuiControl* mXLabel = new GuiControl();
+
    // make our y fields.
    // make our y fields.
    GuiTextEditCtrl* mYctrl = new GuiTextEditCtrl();
    GuiTextEditCtrl* mYctrl = new GuiTextEditCtrl();
    GuiControl* mYLabel = new GuiControl();
    GuiControl* mYLabel = new GuiControl();
@@ -569,8 +593,11 @@ GuiControl * GuiInspectorTypePoint2I::constructEditControl()
    registerEditControl(mXctrl);
    registerEditControl(mXctrl);
    registerEditControl(mYctrl);
    registerEditControl(mYctrl);
 
 
-   mXctrl->setField("profile", "GuiNumberEditProfile");
-   mYctrl->setField("profile", "GuiNumberEditProfile");
+   // Let's make it look pretty.
+   mXctrl->setControlProfile(mGroup->mInspector->mTextEditProfile);
+   mYctrl->setControlProfile(mGroup->mInspector->mTextEditProfile);
+   mXLabel->setControlProfile(mGroup->mInspector->mLabelProfile);
+   mYLabel->setControlProfile(mGroup->mInspector->mLabelProfile);
 
 
    U32 mCount = StringUnit::getUnitCount(mData, " ");
    U32 mCount = StringUnit::getUnitCount(mData, " ");
 
 
@@ -594,12 +621,9 @@ GuiControl * GuiInspectorTypePoint2I::constructEditControl()
    mXLabel->setField("text","X:");
    mXLabel->setField("text","X:");
    mYLabel->setField("text", "Y:");
    mYLabel->setField("text", "Y:");
    mYLabel->setPosition(Point2I(0, 30));
    mYLabel->setPosition(Point2I(0, 30));
-
-   mXLabel->setField("profile", "GuiTextProfile");
-   mYLabel->setField("profile", "GuiTextProfile");
    
    
-   mXctrl->setExtent(Point2I((mParent->getExtent().x / 2) - 25 - 20, 30));
-   mYctrl->setExtent(Point2I((mParent->getExtent().x / 2) - 25 - 20, 30));
+   mXctrl->setExtent(Point2I(width - 25 - 20, 30));
+   mYctrl->setExtent(Point2I(width - 25 - 20, 30));
 
 
    char szCommand[512];
    char szCommand[512];
 
 
@@ -652,7 +676,7 @@ void GuiInspectorTypePoint2F::consoleInit()
    ConsoleBaseType::getType(TypePoint2F)->setInspectorFieldType("GuiInspectorTypePoint2F");
    ConsoleBaseType::getType(TypePoint2F)->setInspectorFieldType("GuiInspectorTypePoint2F");
 }
 }
 
 
-GuiControl * GuiInspectorTypePoint2F::constructEditControl()
+GuiControl * GuiInspectorTypePoint2F::constructEditControl(S32 width)
 {
 {
    GuiControl* retCtrl = new GuiControl();
    GuiControl* retCtrl = new GuiControl();
 
 
@@ -660,16 +684,20 @@ GuiControl * GuiInspectorTypePoint2F::constructEditControl()
    if (retCtrl == NULL)
    if (retCtrl == NULL)
       return retCtrl;
       return retCtrl;
 
 
+   // Let's make it look pretty.
+   retCtrl->setControlProfile(mGroup->mInspector->mBackgroundProfile);
+   retCtrl->mBounds.set(mGroup->mInspector->mControlOffset, Point2I(width - mGroup->mInspector->mControlOffset.x, 60));
+
    // get our data.
    // get our data.
    const char* mData = mTarget->getDataField(mField->pFieldname, NULL);
    const char* mData = mTarget->getDataField(mField->pFieldname, NULL);
    // Don't forget to register ourselves
    // Don't forget to register ourselves
    retCtrl->setCanSaveDynamicFields(true);
    retCtrl->setCanSaveDynamicFields(true);
    registerEditControl(retCtrl);
    registerEditControl(retCtrl);
-   // we want 2 controls in this one.
-   retCtrl->setExtent(Point2I(mParent->getExtent().x / 2, 60));
+
    // make our x fields.
    // make our x fields.
    GuiTextEditCtrl* mXctrl = new GuiTextEditCtrl();
    GuiTextEditCtrl* mXctrl = new GuiTextEditCtrl();
    GuiControl* mXLabel = new GuiControl();
    GuiControl* mXLabel = new GuiControl();
+
    // make our y fields.
    // make our y fields.
    GuiTextEditCtrl* mYctrl = new GuiTextEditCtrl();
    GuiTextEditCtrl* mYctrl = new GuiTextEditCtrl();
    GuiControl* mYLabel = new GuiControl();
    GuiControl* mYLabel = new GuiControl();
@@ -678,10 +706,14 @@ GuiControl * GuiInspectorTypePoint2F::constructEditControl()
    registerEditControl(mXctrl);
    registerEditControl(mXctrl);
    registerEditControl(mYctrl);
    registerEditControl(mYctrl);
 
 
+   // Let's make it look pretty.
+   mXctrl->setControlProfile(mGroup->mInspector->mTextEditProfile);
+   mYctrl->setControlProfile(mGroup->mInspector->mTextEditProfile);
+   mXLabel->setControlProfile(mGroup->mInspector->mLabelProfile);
+   mYLabel->setControlProfile(mGroup->mInspector->mLabelProfile);
+
    // the only difference between point2i and 2f
    // the only difference between point2i and 2f
    // keeping them separate just incase changes to textEdit.
    // keeping them separate just incase changes to textEdit.
-   mXctrl->setField("profile", "GuiTextEditProfile");
-   mYctrl->setField("profile", "GuiTextEditProfile");
 
 
    U32 mCount = StringUnit::getUnitCount(mData, " ");
    U32 mCount = StringUnit::getUnitCount(mData, " ");
 
 
@@ -706,11 +738,8 @@ GuiControl * GuiInspectorTypePoint2F::constructEditControl()
    mYLabel->setField("text", "Y:");
    mYLabel->setField("text", "Y:");
    mYLabel->setPosition(Point2I(0, 30));
    mYLabel->setPosition(Point2I(0, 30));
 
 
-   mXLabel->setField("profile", "GuiTextProfile");
-   mYLabel->setField("profile", "GuiTextProfile");
-
-   mXctrl->setExtent(Point2I((mParent->getExtent().x / 2) - 25 - 20, 30));
-   mYctrl->setExtent(Point2I((mParent->getExtent().x / 2) - 25 - 20, 30));
+   mXctrl->setExtent(Point2I(width - 25 - 20, 30));
+   mYctrl->setExtent(Point2I(width - 25 - 20, 30));
 
 
    char szCommand[512];
    char szCommand[512];
 
 
@@ -763,7 +792,7 @@ void GuiInspectorTypeVector2::consoleInit()
    ConsoleBaseType::getType(TypeVector2)->setInspectorFieldType("GuiInspectorTypeVector2");
    ConsoleBaseType::getType(TypeVector2)->setInspectorFieldType("GuiInspectorTypeVector2");
 }
 }
 
 
-GuiControl * GuiInspectorTypeVector2::constructEditControl()
+GuiControl * GuiInspectorTypeVector2::constructEditControl(S32 width)
 {
 {
    // yes vector2 is the same as point2f as well. 
    // yes vector2 is the same as point2f as well. 
    // all of these could be done similarly to color. but testing need test.
    // all of these could be done similarly to color. but testing need test.
@@ -773,16 +802,20 @@ GuiControl * GuiInspectorTypeVector2::constructEditControl()
    if (retCtrl == NULL)
    if (retCtrl == NULL)
       return retCtrl;
       return retCtrl;
 
 
+   // Let's make it look pretty.
+   retCtrl->setControlProfile(mGroup->mInspector->mBackgroundProfile);
+   retCtrl->mBounds.set(mGroup->mInspector->mControlOffset, Point2I(width - mGroup->mInspector->mControlOffset.x, 60));
+
    // get our data.
    // get our data.
    const char* mData = mTarget->getDataField(mField->pFieldname, NULL);
    const char* mData = mTarget->getDataField(mField->pFieldname, NULL);
    // Don't forget to register ourselves
    // Don't forget to register ourselves
    retCtrl->setCanSaveDynamicFields(true);
    retCtrl->setCanSaveDynamicFields(true);
    registerEditControl(retCtrl);
    registerEditControl(retCtrl);
-   // we want 2 controls in this one.
-   retCtrl->setExtent(Point2I(mParent->getExtent().x / 2, 60));
+
    // make our x fields.
    // make our x fields.
    GuiTextEditCtrl* mXctrl = new GuiTextEditCtrl();
    GuiTextEditCtrl* mXctrl = new GuiTextEditCtrl();
    GuiControl* mXLabel = new GuiControl();
    GuiControl* mXLabel = new GuiControl();
+
    // make our y fields.
    // make our y fields.
    GuiTextEditCtrl* mYctrl = new GuiTextEditCtrl();
    GuiTextEditCtrl* mYctrl = new GuiTextEditCtrl();
    GuiControl* mYLabel = new GuiControl();
    GuiControl* mYLabel = new GuiControl();
@@ -791,10 +824,11 @@ GuiControl * GuiInspectorTypeVector2::constructEditControl()
    registerEditControl(mXctrl);
    registerEditControl(mXctrl);
    registerEditControl(mYctrl);
    registerEditControl(mYctrl);
 
 
-   // the only difference between point2i and 2f
-   // keeping them separate just incase changes to textEdit.
-   mXctrl->setField("profile", "GuiTextEditProfile");
-   mYctrl->setField("profile", "GuiTextEditProfile");
+   // Let's make it look pretty.
+   mXctrl->setControlProfile(mGroup->mInspector->mTextEditProfile);
+   mYctrl->setControlProfile(mGroup->mInspector->mTextEditProfile);
+   mXLabel->setControlProfile(mGroup->mInspector->mLabelProfile);
+   mYLabel->setControlProfile(mGroup->mInspector->mLabelProfile);
 
 
    U32 mCount = StringUnit::getUnitCount(mData, " ");
    U32 mCount = StringUnit::getUnitCount(mData, " ");
 
 
@@ -819,11 +853,8 @@ GuiControl * GuiInspectorTypeVector2::constructEditControl()
    mYLabel->setField("text", "Y:");
    mYLabel->setField("text", "Y:");
    mYLabel->setPosition(Point2I(0, 30));
    mYLabel->setPosition(Point2I(0, 30));
 
 
-   mXLabel->setField("profile", "GuiTextProfile");
-   mYLabel->setField("profile", "GuiTextProfile");
-
-   mXctrl->setExtent(Point2I((mParent->getExtent().x / 2) - 25 - 20, 30));
-   mYctrl->setExtent(Point2I((mParent->getExtent().x / 2) - 25 - 20, 30));
+   mXctrl->setExtent(Point2I(width - 25 - 20, 30));
+   mYctrl->setExtent(Point2I(width - 25 - 20, 30));
 
 
    char szCommand[512];
    char szCommand[512];
 
 
@@ -869,7 +900,7 @@ void GuiInspectorTypeVector2::updateValue(StringTableEntry newValue)
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
 IMPLEMENT_CONOBJECT(GuiInspectorTypeAsset);
 IMPLEMENT_CONOBJECT(GuiInspectorTypeAsset);
 
 
-GuiControl* GuiInspectorTypeAsset::constructEditControl()
+GuiControl* GuiInspectorTypeAsset::constructEditControl(S32 width)
 {
 {
    // we don't need a custom update for this.
    // we don't need a custom update for this.
    // the object is a guicontrol and therefore 
    // the object is a guicontrol and therefore 
@@ -881,12 +912,12 @@ GuiControl* GuiInspectorTypeAsset::constructEditControl()
       return retCtrl;
       return retCtrl;
 
 
    // Let's make it look pretty.
    // Let's make it look pretty.
-   retCtrl->setField("profile", "GuiTextProfile");
+   retCtrl->setControlProfile(mGroup->mInspector->mLabelProfile);
 
 
    // Don't forget to register ourselves
    // Don't forget to register ourselves
    registerEditControl(retCtrl);
    registerEditControl(retCtrl);
 
 
-   retCtrl->setExtent(Point2I((getExtent().x / 2), 30));
+   retCtrl->mBounds.set(mGroup->mInspector->mControlOffset, Point2I(width - (mGroup->mInspector->mControlOffset.x + 34), 30));
    retCtrl->setText(getData());
    retCtrl->setText(getData());
 
 
    mBrowseButton = new GuiButtonCtrl();
    mBrowseButton = new GuiButtonCtrl();
@@ -898,10 +929,10 @@ GuiControl* GuiInspectorTypeAsset::constructEditControl()
       dSprintf(szBuffer, 512, "getAsset(\"%d.apply\", \"%s\", \"%s\");", getId(), getData(), mAssetType);
       dSprintf(szBuffer, 512, "getAsset(\"%d.apply\", \"%s\", \"%s\");", getId(), getData(), mAssetType);
       mBrowseButton->setField("Command", szBuffer);
       mBrowseButton->setField("Command", szBuffer);
       mBrowseButton->setField("text", "...");
       mBrowseButton->setField("text", "...");
-      mBrowseButton->setField("Profile", "GuiButtonDynProfile");
-      mBrowseButton->registerObject();
-      mBrowseButton->setExtent(Point2I(30, 25));
-      mBrowseButton->setPosition(Point2I(((getExtent().x / 2) - 30) - 30, 0));
+	  mBrowseButton->setControlProfile(mGroup->mInspector->mButtonProfile);
+	  mBrowseButton->registerObject();
+	  mBrowseButton->setExtent(Point2I(30, 28));
+	  mBrowseButton->setPosition(Point2I(mGroup->mInspector->mControlOffset.x + retCtrl->getWidth() + 4, mGroup->mInspector->mControlOffset.y + 1));
       retCtrl->addObject(mBrowseButton);
       retCtrl->addObject(mBrowseButton);
 
 
    }
    }

+ 12 - 12
engine/source/gui/editor/guiInspectorTypes.h

@@ -87,7 +87,7 @@ public:
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
    // Override able methods for custom edit fields
    // Override able methods for custom edit fields
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
-   virtual GuiControl*        constructEditControl();
+   virtual GuiControl*        constructEditControl(S32 width);
    virtual void               setData( StringTableEntry data );
    virtual void               setData( StringTableEntry data );
    virtual StringTableEntry   getData();
    virtual StringTableEntry   getData();
    virtual void               updateValue( StringTableEntry newValue );
    virtual void               updateValue( StringTableEntry newValue );
@@ -108,7 +108,7 @@ public:
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
    // Override able methods for custom edit fields (Both are REQUIRED)
    // Override able methods for custom edit fields (Both are REQUIRED)
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
-   virtual GuiControl* constructEditControl();
+   virtual GuiControl* constructEditControl(S32 width);
 };
 };
 
 
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
@@ -125,7 +125,7 @@ public:
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
    // Override able methods for custom edit fields (Both are REQUIRED)
    // Override able methods for custom edit fields (Both are REQUIRED)
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
-   virtual GuiControl* constructEditControl();
+   virtual GuiControl* constructEditControl(S32 width);
 };
 };
 
 
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
@@ -142,7 +142,7 @@ public:
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
    // Override able methods for custom edit fields (Both are REQUIRED)
    // Override able methods for custom edit fields (Both are REQUIRED)
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
-   virtual GuiControl* constructEditControl();
+   virtual GuiControl* constructEditControl(S32 width);
 };
 };
 
 
 
 
@@ -162,7 +162,7 @@ public:
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
    // Override able methods for custom edit fields
    // Override able methods for custom edit fields
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
-   virtual GuiControl*        constructEditControl();
+   virtual GuiControl*        constructEditControl(S32 width);
    virtual void               resize(const Point2I &newPosition, const Point2I &newExtent);
    virtual void               resize(const Point2I &newPosition, const Point2I &newExtent);
 };
 };
 
 
@@ -182,7 +182,7 @@ public:
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
    // Override able methods for custom edit fields
    // Override able methods for custom edit fields
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
-   virtual GuiControl*        constructEditControl();
+   virtual GuiControl*        constructEditControl(S32 width);
    virtual void               updateValue(StringTableEntry newValue);
    virtual void               updateValue(StringTableEntry newValue);
 };
 };
 
 
@@ -228,7 +228,7 @@ public:
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
    // Override able methods for custom edit fields
    // Override able methods for custom edit fields
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
-   virtual GuiControl*        constructEditControl();
+   virtual GuiControl*        constructEditControl(S32 width);
    virtual StringTableEntry   getData();
    virtual StringTableEntry   getData();
 };
 };
 
 
@@ -246,7 +246,7 @@ public:
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
    // Override able methods for custom edit fields
    // Override able methods for custom edit fields
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
-   virtual GuiControl*        constructEditControl();
+   virtual GuiControl*        constructEditControl(S32 width);
    virtual const char*        getData();
    virtual const char*        getData();
 };
 };
 
 
@@ -264,7 +264,7 @@ public:
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
    // Override able methods for custom edit fields
    // Override able methods for custom edit fields
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
-   virtual GuiControl*        constructEditControl();
+   virtual GuiControl*        constructEditControl(S32 width);
    virtual void               updateValue(StringTableEntry newValue);
    virtual void               updateValue(StringTableEntry newValue);
 };
 };
 
 
@@ -282,7 +282,7 @@ public:
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
    // Override able methods for custom edit fields
    // Override able methods for custom edit fields
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
-   virtual GuiControl*        constructEditControl();
+   virtual GuiControl*        constructEditControl(S32 width);
    virtual void               updateValue(StringTableEntry newValue);
    virtual void               updateValue(StringTableEntry newValue);
 };
 };
 
 
@@ -300,7 +300,7 @@ public:
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
    // Override able methods for custom edit fields
    // Override able methods for custom edit fields
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
-   virtual GuiControl*        constructEditControl();
+   virtual GuiControl*        constructEditControl(S32 width);
    virtual void               updateValue(StringTableEntry newValue);
    virtual void               updateValue(StringTableEntry newValue);
 };
 };
 
 
@@ -320,7 +320,7 @@ public:
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
    // Override able methods for custom edit fields
    // Override able methods for custom edit fields
    //////////////////////////////////////////////////////////////////////////
    //////////////////////////////////////////////////////////////////////////
-   virtual GuiControl*        constructEditControl();
+   virtual GuiControl*        constructEditControl(S32 width);
 };
 };
 
 
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////

+ 0 - 6
engine/source/gui/editor/guiMenuBarCtrl.cc

@@ -431,9 +431,6 @@ bool GuiMenuBarCtrl::onWake()
 	if (!Parent::onWake())
 	if (!Parent::onWake())
 		return false;
 		return false;
 
 
-	if (mBackgroundProfile != NULL)
-		mBackgroundProfile->incRefCount();
-
 	if (mMenuProfile != NULL)
 	if (mMenuProfile != NULL)
 		mMenuProfile->incRefCount();
 		mMenuProfile->incRefCount();
 
 
@@ -462,9 +459,6 @@ void GuiMenuBarCtrl::onSleep()
 {
 {
 	Parent::onSleep();
 	Parent::onSleep();
 
 
-	if (mBackgroundProfile != NULL)
-		mBackgroundProfile->decRefCount();
-
 	if (mMenuProfile != NULL)
 	if (mMenuProfile != NULL)
 		mMenuProfile->decRefCount();
 		mMenuProfile->decRefCount();
 
 

+ 0 - 1
engine/source/gui/guiControl.cc

@@ -441,7 +441,6 @@ void GuiControl::parentResized(const Point2I &oldParentExtent, const Point2I &ne
       newPosition.y += deltaY;
       newPosition.y += deltaY;
    else if(mVertSizing == vertResizeRelative && oldParentExtent.y != 0)
    else if(mVertSizing == vertResizeRelative && oldParentExtent.y != 0)
    {
    {
-
       S32 newTop = (newPosition.y * newParentExtent.y) / oldParentExtent.y;
       S32 newTop = (newPosition.y * newParentExtent.y) / oldParentExtent.y;
       S32 newBottom = ((newPosition.y + newExtent.y) * newParentExtent.y) / oldParentExtent.y;
       S32 newBottom = ((newPosition.y + newExtent.y) * newParentExtent.y) / oldParentExtent.y;
 
 

+ 1 - 1
toybox/Sandbox/1/gui/guiProfiles.cs

@@ -197,7 +197,7 @@ if (!isObject(GuiListBoxBorderProfile)) new GuiBorderProfile (GuiListBoxBorderPr
 	margin = 1;
 	margin = 1;
 	marginHL = 1;
 	marginHL = 1;
 	marginSL = 1;
 	marginSL = 1;
-	MarginNA = 1;
+	marginNA = 1;
 
 
 	padding = 4;
 	padding = 4;
 	paddingHL = 4;
 	paddingHL = 4;