Index: OGRE/trunk/resources/overlays/TestKdTree.overlay
===================================================================
--- OGRE/trunk/resources/overlays/TestKdTree.overlay	(revision 1177)
+++ OGRE/trunk/resources/overlays/TestKdTree.overlay	(revision 1183)
@@ -1,2 +1,15 @@
+template element TextArea(KdTree/Templates/BasicText)
+{
+	metrics_mode pixels
+	left 5
+	top 5
+	width 180
+	height 30
+	font_name TrebuchetMSBold
+	char_height 16
+	colour_top 0.5 0.7 0.5
+	colour_bottom 0.3 0.5 0.3
+}
+
 // Ogre overlay scripts
 KdTree/DebugOverlay
@@ -4,5 +17,5 @@
 	zorder 500
 	// Stats block
-	container BorderPanel(KdTree/StatPanel)
+	container BorderPanel(KdTree/OptionsPanel)
 	{
 		metrics_mode pixels
@@ -10,5 +23,4 @@
 		left 5 
 		top 5
-		// width 220
 		width 430
 		height 120
@@ -25,106 +37,222 @@
 	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
 
-//		container Panel(KdTree/BreakPanel)
-//		{
-//			metrics_mode pixels
-//			left 5 
-//			top 22
-//			width 210
-//			height 1
-//			material Core/StatsBreak
-//		}
-
-		element TextArea(KdTree/RenderMethod)
-		{
-			metrics_mode pixels
-			left 5
-			top 5
-			width 90
-			height 30
-			font_name TrebuchetMSBold
-			char_height 16
-			caption [SPACE] Algorithm:
-			colour_top 0.5 0.7 0.5
-			colour_bottom 0.3 0.5 0.3
-		}
-		element TextArea(KdTree/BuildMethod)
-		{
-			metrics_mode pixels
-			left 5
-			top 20
-			width 90
-			height 30
-			font_name TrebuchetMSBold
-			char_height 16
-			caption [X] Build Method:
-			colour_top 0.5 0.7 0.5
-			colour_bottom 0.3 0.5 0.3
-		}
-		element TextArea(KdTree/Depth)
-		{
-			metrics_mode pixels
-			left 5
-			top 35
-			width 90
-			height 30
-			font_name TrebuchetMSBold
-			char_height 16
-			caption [1][2] Max Tree Depth:
-			colour_top 0.5 0.7 0.5
-			colour_bottom 0.3 0.5 0.3
-//			colour_top 1 1 0.7
-//			colour_bottom 1 1 0.7
-		}
-		element TextArea(KdTree/Highlight)
-		{
-			metrics_mode pixels
-			left 5
-			top 50
-			width 90
-			height 30
-			font_name TrebuchetMSBold
-			char_height 16
-			caption [3][4] Highlight:
-			colour_top 0.5 0.7 0.5
-			colour_bottom 0.3 0.5 0.3
-		}
-		element TextArea(KdTree/KT)
-		{
-			metrics_mode pixels
-			left 5
-			top 65
-			width 90
-			height 30
-			font_name TrebuchetMSBold
-			char_height 16
-			caption [5][6] KT:
-			colour_top 0.5 0.7 0.5
-			colour_bottom 0.3 0.5 0.3
-		}
-		element TextArea(KdTree/KI)
-		{
-			metrics_mode pixels
-			left 5
-			top 80
-			width 90
-			height 30
-			font_name TrebuchetMSBold
-			char_height 16
-			caption [7][8] KI:
-			colour_top 0.5 0.7 0.5
-			colour_bottom 0.3 0.5 0.3
-		}
-		element TextArea(KdTree/Movement)
-		{
-			metrics_mode pixels
-			left 5
-			top 95
-			width 90
-			height 30
-			font_name TrebuchetMSBold
-			char_height 16
-			caption [Q] Movement:
-			colour_top 0.5 0.7 0.5
-			colour_bottom 0.3 0.5 0.3
+		element TextArea(KdTree/RenderMethod): KdTree/Templates/BasicText
+		{
+			left 5
+			width 120
+			height 30
+			caption [SPACE] Algorithm
+		}
+		element TextArea(KdTree/RenderMethodInfo): KdTree/Templates/BasicText
+		{
+			left 160
+			width 180
+			height 30
+			caption :
+		}
+		element TextArea(KdTree/BuildMethod): KdTree/Templates/BasicText
+		{
+			left 5
+			width 120
+			height 30
+			caption [X] Build Method
+		}
+		element TextArea(KdTree/BuildMethodInfo): KdTree/Templates/BasicText
+		{
+			left 160
+			width 180
+			height 30
+			caption :
+		}
+		element TextArea(KdTree/KdTreeMaxDepth): KdTree/Templates/BasicText
+		{
+			left 5
+			width 120
+			height 30
+			caption [1][2] Max Tree Depth
+		}
+		element TextArea(KdTree/KdTreeMaxDepthInfo): KdTree/Templates/BasicText
+		{
+			left 160
+			width 180
+			height 30
+			caption :
+		}
+		element TextArea(KdTree/HighlightLevel): KdTree/Templates/BasicText
+		{
+			left 5
+			width 120
+			height 30
+			caption [3][4] Highlight
+		}
+		element TextArea(KdTree/HighlightLevelInfo): KdTree/Templates/BasicText
+		{
+			left 160
+			width 180
+			height 30
+			caption :
+		}
+		element TextArea(KdTree/KT): KdTree/Templates/BasicText
+		{
+			left 5
+			width 120
+			height 30
+			caption [5][6] KT
+		}
+		element TextArea(KdTree/KTInfo): KdTree/Templates/BasicText
+		{
+			left 160
+			width 180
+			height 30
+			caption :
+		}
+		element TextArea(KdTree/KI): KdTree/Templates/BasicText
+		{
+			left 5
+			width 120
+			height 30
+			caption [7][8] KI
+		}
+		element TextArea(KdTree/KIInfo): KdTree/Templates/BasicText
+		{
+			left 160
+			width 180
+			height 30
+			caption :
+		}
+		element TextArea(KdTree/Movement): KdTree/Templates/BasicText
+		{
+			left 5
+			width 120
+			height 30
+			caption [Q] Movement
+		}
+		element TextArea(KdTree/MovementInfo): KdTree/Templates/BasicText
+		{
+			left 160
+			width 180
+			height 30
+			caption :
+		}
+	}
+	
+	container BorderPanel(KdTree/VisibilityStatsPanel)
+	{
+		metrics_mode pixels
+		vert_align top
+		horz_align right
+		left -250 
+		top 5
+		width 320
+		height 135
+		material Core/StatsBlockCenter
+        	border_size 1 1 1 1
+        	border_material Core/StatsBlockBorder
+        	border_topleft_uv     0.0000 1.0000 0.0039 0.9961
+	    	border_top_uv         0.0039 1.0000 0.9961 0.9961
+	    	border_topright_uv    0.9961 1.0000 1.0000 0.9961
+	    	border_left_uv        0.0000 0.9961 0.0039 0.0039
+	    	border_right_uv       0.9961 0.9961 1.0000 0.0039
+	    	border_bottomleft_uv  0.0000 0.0039 0.0039 0.0000
+        	border_bottom_uv      0.0039 0.0039 0.9961 0.0000
+	    	border_bottomright_uv 0.9961 0.0039 1.0000 0.0000
+
+		element TextArea(KdTree/Visibility/FrustumCulledNodes): KdTree/Templates/BasicText
+		{
+			left 5
+			width 180
+			height 30
+			caption Frustum Culled Nodes
+		}
+		element TextArea(KdTree/Visibility/FrustumCulledNodesInfo): KdTree/Templates/BasicText
+		{
+			left 180
+			width 90
+			height 30
+			caption :
+		}
+		element TextArea(KdTree/Visibility/QueryCulledNodes): KdTree/Templates/BasicText
+		{
+			left 5
+			width 180
+			height 30
+			caption Query Culled Nodes
+		}	
+		element TextArea(KdTree/Visibility/QueryCulledNodesInfo): KdTree/Templates/BasicText
+		{
+			left 180
+			width 90
+			height 30
+			caption :
+		}
+		element TextArea(KdTree/Visibility/TraversedNodes): KdTree/Templates/BasicText
+		{
+			left 5
+			width 180
+			height 30
+			caption Traversed Nodes
+		}	
+		element TextArea(KdTree/Visibility/TraversedNodesInfo): KdTree/Templates/BasicText
+		{
+			left 180
+			width 90
+			height 30
+			caption :
+		}
+		element TextArea(KdTree/Visibility/HierarchyNodes): KdTree/Templates/BasicText
+		{
+			left 5
+			width 180
+			height 30
+			caption Hierarchy Nodes
+		}	
+		element TextArea(KdTree/Visibility/HierarchyNodesInfo): KdTree/Templates/BasicText
+		{
+			left 180
+			width 90
+			height 30
+			caption :
+		}
+		element TextArea(KdTree/Visibility/RenderedNodes): KdTree/Templates/BasicText
+		{
+			left 5
+			width 180
+			height 30
+			caption Rendered Nodes
+		}	
+		element TextArea(KdTree/Visibility/RenderedNodesInfo): KdTree/Templates/BasicText
+		{
+			left 180
+			width 90
+			height 30
+			caption :
+		}
+		element TextArea(KdTree/Visibility/ObjectsCount): KdTree/Templates/BasicText
+		{
+			left 5
+			width 180
+			height 30
+			caption Number of objects
+		}	
+		element TextArea(KdTree/Visibility/ObjectsCountInfo): KdTree/Templates/BasicText
+		{
+			left 180
+			width 90
+			height 30
+			caption :
+		}
+		element TextArea(KdTree/Visibility/QueriesIssued): KdTree/Templates/BasicText
+		{
+			left 5
+			width 180
+			height 30
+			caption Queries issued
+		}	
+		element TextArea(KdTree/Visibility/QueriesIssuedInfo): KdTree/Templates/BasicText
+		{
+			left 180
+			width 90
+			height 30
+			caption :			
 		}
 	}
