Browse Source

Fixed a few bugs with GuiWindows and GuiPages

Peter Robinson 4 years ago
parent
commit
118e266d91

+ 22 - 0
engine/source/gui/containers/guiTabPageCtrl.cc

@@ -178,3 +178,25 @@ void GuiTabPageCtrl::selectWindow(void)
    //also set the first responder to be the one within this window
    setFirstResponder(mFirstResponder);
 }
+
+void GuiTabPageCtrl::onRender(Point2I offset, const RectI &updateRect)
+{
+	RectI ctrlRect = applyMargins(offset, mBounds.extent, NormalState, mProfile);
+
+	if (!ctrlRect.isValidRect())
+	{
+		return;
+	}
+
+	renderUniversalRect(ctrlRect, mProfile, NormalState);
+
+	//Render Text
+	RectI fillRect = applyBorders(ctrlRect.point, ctrlRect.extent, NormalState, mProfile);
+	RectI contentRect = applyPadding(fillRect.point, fillRect.extent, NormalState, mProfile);
+
+	if (contentRect.isValidRect())
+	{
+		//Render the childen
+		renderChildControls(offset, contentRect, updateRect);
+	}
+}

+ 1 - 0
engine/source/gui/containers/guiTabPageCtrl.h

@@ -52,6 +52,7 @@ class GuiTabPageCtrl : public GuiControl
       void selectWindow(void);               ///< Select this window
 
       virtual void setText(const char *txt = NULL); ///< Override setText function to signal parent we need to update.
+	  void onRender(Point2I offset, const RectI &updateRect);
 };
 
 #endif //_GUITABPAGECTRL_H_

+ 0 - 6
engine/source/gui/containers/guiWindowCtrl.cc

@@ -644,12 +644,6 @@ void GuiWindowCtrl::onRender(Point2I offset, const RectI &updateRect)
 	else if (hasFocus)
 	{
 		currentState = SelectedState;
-
-		GuiControl *parent = getParent();
-		if (parent)
-		{
-			parent->pushObjectToBack(this);
-		}
 	}
 	else if (curHitRegion == TitleBar)
 	{