/********************************************************************** 

Filename	:	Civ4Theme_Border.thm
Content		:	Civ4 - GBorder control theme
Created		:	May 1, 2005
Authors		:	Sven Dixon

Copyright	:	(c) 2005 Scaleform Corp. All Rights Reserved.

Licensees may use this file in accordance with the valid Scaleform
GFC Commercial License Agreement provided with the software.

This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING 
THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR ANY PURPOSE.

For information regarding GFC Commercial License Agreements go to:
	online - http://www.scaleform.com/licensing.html or
	email  - sales@scaleform.com 

**********************************************************************/

// *** Main Border control namespace 

with GFC_Control_Border
{
	
	GFC_Control_DefaultBorder_Style
	{
		GFC_Control_Renderer_Control			=	GFC_CtrlTheme_Bitmap_Control_Border_Renderer_ControlStandard;			
													
		.Child_Title							=	GFC_CtrlTheme_Bitmap_Control_Border_Child_TitleLabel;
													
		.StyleId_Title_Inside					=	GPropertyId(GFC_Control_StandardLabel_Style);
		.StyleId_Title_Outside					=	GPropertyId(GFC_Control_StandardLabel_Style);
		.StyleId_Title_Center					=	GPropertyId(GFC_Control_StandardLabel_Style);
	
		with GFC_Control_Flag
		{
			// Base control flags
			.Transparent						=	GFlags(GCtrl, GFC_CF_TRANSPARENT);
			.HitTest							=	GFlags(GCtrl, GFC_CF_HITTEST);
			.SolidInner							=	0;	//GFlags(GCtrl, GFC_CF_SOLIDINNER);
			.SolidBackground					=	0;	//GFlags(GCtrl, GFC_CF_SOLIDBACKGROUND);
			.RegionClip							=	0;	//GFlags(GCtrl, GFC_CF_REGIONCLIP);
			.RegionClipParent					=	0;	//GFlags(GCtrl, GFC_CF_REGIONCLIP_PARENT);
			.NoExternalWindow					=	0;	//GFlags(GCtrl, GFC_CF_NOEXTERNALWINDOW);
			.TopLayer							=	0;	//GFlags(GCtrl, GFC_CF_TOPLAYER);
			.TopLayerBitmap						=	0;	//GFlags(GCtrl, GFC_CF_TOPLAYERBITMAP);
			.BottomLayerBitmap					=	0;	//GFlags(GCtrl, GFC_CF_BOTTOMLAYERBITMAP);
											
			// Control flag change masks	
			.Mask_InvalidateControl				=	GFlags(GCtrl, GFC_CF_DISABLED, GFC_CF_TRANSPARENT, GFC_CF_TOPLAYER);
		}

		with .Flag
		{
			// Border flags
			.Title_Loc							=	GFlags(GBorderCtrl, GFC_CF_BORDER_TITLE_LOC_TOP);	
			.Title_Just							=	GFlags(GBorderCtrl, GFC_CF_BORDER_TITLE_JUST_BEGIN);	
			.Title_Pos							=	GFlags(GBorderCtrl, GFC_CF_BORDER_TITLE_POS_CENTER);
			.Title_Crop							=	GFlags(GBorderCtrl, GFC_CF_BORDER_TITLE_CROP_CHAR);
			.Title_CropDotted					=	GFlags(GBorderCtrl, GFC_CF_BORDER_TITLE_CROP_DOTTED);

			// Border flag change masks	
			//.BorderMask_InvalidateControl		=	GFlags(GBorderCtrl);
		}		

		with .Size
		{			
			.Margin								=	GRectMargin(2,2,2,2);
			.ExtraMargin						=	GRectMargin(0,0,0,0);
			.HitTestMargin        				= 	GRectMargin(0,0,0,0);
			.ForceHitTestMargin					=	GRectMargin(0,0,0,0);
			.ForceSizableMargin					=	GRectMargin(0,0,0,0);
			.ForceMovableMargin					=	GRectMargin(0,0,0,0);
			.ForceUpdateMargin					=	GRectMargin(0,0,0,0);

			// Drag corner sizes				
			.DragCorner_TopLeft					=	GSize(16,16);
			.DragCorner_TopRight				=	.DragCorner_TopLeft;
			.DragCorner_BottomLeft				=	.DragCorner_TopLeft;
			.DragCorner_BottomRight				=	.DragCorner_TopLeft;
								
			.TitleBorderMargin_Inside			=	GRectMargin(0,0,0,0);
			.TitleBorderMargin_Outside			=	GRectMargin(0,0,0,0);
			.TitleBorderMargin_Center			=	GRectMargin(4,0,4,0);
												
			.TitleInsetMargin_Inside			=	GRectMargin(4,4,4,4);
			.TitleInsetMargin_Outside			=	GRectMargin(1,2,1,4);
			.TitleInsetMargin_Center			=	GRectMargin(4,2,4,2);						
		}
													
		with .Color									
		{								
			.Inner								=	GFC_Control_Color_Surface;
			.Frame								=	GFC_Control_Color_Surface;
		}										
													
		with .Combine								
		{						
			.Inner								=	GFC_Control_Combine_Inner_Default;
			.Frame								=	GFC_Control_Combine_Border_Default;
		}										
													
		with .Cursor								
		{										
			.Size_Top							=	GFC_Control_Cursor_Size_UpDown;
			.Size_Bottom						=	GFC_Control_Cursor_Size_UpDown;
			.Size_Left							=	GFC_Control_Cursor_Size_LeftRight;
			.Size_Right							=	GFC_Control_Cursor_Size_LeftRight;
			.Size_TopLeft						=	GFC_Control_Cursor_Size_UpLeft;
			.Size_TopRight						=	GFC_Control_Cursor_Size_UpRight;
			.Size_BottomLeft					=	GFC_Control_Cursor_Size_DownLeft;
			.Size_BottomRight					=	GFC_Control_Cursor_Size_DownRight;
													
			.Move_Top							=	GFC_Control_Cursor_Arrow;
			.Move_Bottom						=	GFC_Control_Cursor_Arrow;
			.Move_Left							=	GFC_Control_Cursor_Arrow;
			.Move_Right							=	GFC_Control_Cursor_Arrow;
			.Move_TopLeft						=	GFC_Control_Cursor_Arrow;
			.Move_TopRight						=	GFC_Control_Cursor_Arrow;
			.Move_BottomLeft					=	GFC_Control_Cursor_Arrow;
			.Move_BottomRight					=	GFC_Control_Cursor_Arrow;
		}


		// ******* Initialize all the Bitmap theme Border properties to avoid inheritance problems

		with GFC_CtrlTheme_Bitmap_Control_Border
		{

			with .Skin
			{
				.Full_Default					=	0;
				.Full_Disable					=	0;
				.Full_Inactive					=	0;
				.Full_InactiveDisable			=	0;
				.Full_Winoff					=	0;
				.Full_WinoffDisable				=	0;
													
				.Top_Default					=	0;
				.Top_Disable					=	0;
				.Top_Inactive					=	0;
				.Top_InactiveDisable			=	0;
				.Top_Winoff						=	0;
				.Top_WinoffDisable				=	0;
				.Bottom_Default					=	0;
				.Bottom_Disable					=	0;
				.Bottom_Inactive				=	0;
				.Bottom_InactiveDisable			=	0;
				.Bottom_Winoff					=	0;
				.Bottom_WinoffDisable			=	0;
				.Left_Default					=	0;
				.Left_Disable					=	0;
				.Left_Inactive					=	0;
				.Left_InactiveDisable			=	0;
				.Left_Winoff					=	0;
				.Left_WinoffDisable				=	0;
				.Right_Default					=	0;
				.Right_Disable					=	0;
				.Right_Inactive					=	0;
				.Right_InactiveDisable			=	0;
				.Right_Winoff					=	0;
				.Right_WinoffDisable			=	0;
			}
			with .SkinId
			{
				.TopLeftCorner					=	GPropertyId(.Flag_Top);
				.TopRightCorner					=	GPropertyId(.Flag_Top);
				.BottomLeftCorner				=	GPropertyId(.Flag_Bottom);
				.BottomRightCorner				=	GPropertyId(.Flag_Bottom);
			}								
		}			

		map GFC_Control			=	GFC_Control_DefaultControl_Style;
	}	// end GFC_Control_DefaultBorder_Style



	// ** Normal style

	GFC_Control_StandardBorder_Style
	{
		GFC_CtrlTheme_Bitmap_Control_Border_Skin_Full_Default
		{
			layer {
				DestCombine		= GColorCombine(BlendSource,Disable);
				Image			= GBitmap("Civ4/border_panel.tga", HVGrid, 1, 4, 0, 1);
				Margin			= GRectMargin(6,6,6,6);
			}
		}

		map GFC_CtrlTheme_Bitmap_Control_Border		=	GFC_Control_DefaultBorder_Style;
		map GFC_Control								=	GFC_Control_DefaultBorder_Style;
	}


	// ** In style

	GFC_Control_InBorder_Style
	{
		.Size_Margin							=	GRectMargin(6,6,6,6);
		
		with GFC_CtrlTheme_Bitmap_Control_Border_Skin
		{
			with .Full
			{
				.Default
				{
					layer {
						LayerFlags		= GFlags(GCtrlBitmapSkin, GFC_BITMAPSKIN_CENTER_EMPTY);
						DestCombine		= GColorCombine(BlendSource,Disable);
						Image			= GBitmap("Civ4/border_panel.tga", HVGrid, 1, 4, 0, 2);
						Margin			= GRectMargin(6,6,6,6);
					}
					layer {
						DestCombine		= GColorCombine(BlendSource,Disable);
						Image			= GBitmap("Civ4/border_panel.tga", HVGrid, 1, 4, 0, 1);
						Margin			= GRectMargin(6,6,6,6);
					}
				}
			}
			with .Indent
			{
				.Default
				{
					layer {
						LayerFlags		= GFlags(GCtrlBitmapSkin, GFC_BITMAPSKIN_CENTER_SCALE);
						DestCombine		= GColorCombine(BlendSource,Disable);
						Image			= GBitmap("Civ4/black_25.tga", HVGrid, 1, 1, 0, 0);
						Margin			= GRectMargin(0,0,0,0);
					}	
				}
				.Disable				=	.Default;
				.Inactive				=	.Default;
				.InactiveDisable		=	.Disable;
				.Winoff					=	.Default;
				.WinoffDisable			=	.Disable;
			}
		}
			
		map GFC_CtrlTheme_Bitmap_Control_Border		=	GFC_Control_DefaultBorder_Style;
		map GFC_Control								=	GFC_Control_DefaultBorder_Style;
	}


	// ** Out style

	GFC_Control_OutBorder_Style
	{
		GFC_CtrlTheme_Bitmap_Control_Border_Skin_Full_Default
		{
			layer {
				DestCombine		= GColorCombine(BlendSource,Disable);
				Image			= GBitmap("Civ4/border_panel.tga", HVGrid, 1, 4, 0, 0);
				Margin			= GRectMargin(6,6,6,6);
			}
		}

		map GFC_CtrlTheme_Bitmap_Control_Border		=	GFC_Control_DefaultBorder_Style;
		map GFC_Control								=	GFC_Control_DefaultBorder_Style;
	}


	// ** Flat style

	GFC_Control_FlatBorder_Style
	{
		//.Renderer_Control						=	GFC_CtrlTheme_Bitmap_Control_Border_Renderer_ControlStandard;		
		.Size_Margin							=	GRectMargin(6,6,6,6);
		.Size_TitleBorderMargin_Center			=	GRectMargin(5,0,5,0);

		with GFC_CtrlTheme_Bitmap_Control_Border_Skin
		{
			with .Full
			{
				.Default
				{
					layer {
						LayerFlags		= GFlags(GCtrlBitmapSkin, GFC_BITMAPSKIN_CENTER_EMPTY);
						DestCombine		= GColorCombine(BlendSource,Disable);
						Image			= GBitmap("Civ4/border_panel.tga", HVGrid, 1, 4, 0, 2);
						Margin			= GRectMargin(6,6,6,6);
					}
				}
			}
			with .Indent
			{
				.Default
				{
					layer {
						LayerFlags		= GFlags(GCtrlBitmapSkin, GFC_BITMAPSKIN_CENTER_SCALE);
						DestCombine		= GColorCombine(BlendSource,Disable);
						Image			= GBitmap("Civ4/black_25.tga", HVGrid, 1, 1, 0, 0);
						Margin			= GRectMargin(0,0,0,0);
					}	
				}
				.Disable				=	.Default;
				.Inactive				=	.Default;
				.InactiveDisable		=	.Disable;
				.Winoff					=	.Default;
				.WinoffDisable			=	.Disable;
			}
		}
		
		map GFC_CtrlTheme_Bitmap_Control_Border		=	GFC_Control_DefaultBorder_Style;
		map GFC_Control								=	GFC_Control_DefaultBorder_Style;
	}


	// ** Solid style
	
	GFC_Control_SolidBorder_Style
	{
		//.Renderer_Control							=	GFC_CtrlTheme_Bitmap_Control_Border_Renderer_ControlStandard;		
		.Size_TitleBorderMargin_Center				=	GRectMargin(6,0,6,0);
		.Size_Margin								=	GRectMargin(1,1,1,1);

		with GFC_CtrlTheme_Bitmap_Control_Border_Skin
		{
			with .Full
			{
				.Default
				{
					layer {
						LayerFlags		=	GFlags(GCtrlBitmapSkin, GFC_BITMAPSKIN_CENTER_EMPTY, GFC_BITMAPSKIN_SIDES_FILL);
						FactorColor		=	GFC_Control_Border_Color_Inner;
						Margin			=	GRectMargin(1,1,1,1);
					}									
				}
				.Disable				=	.Default;
				.Winoff					=	.Default;
				.WinoffDisable			=	.Winoff;
			}
			with .Indent
			{
				.Default
				{
					layer {
						LayerFlags		=	GFlags(GCtrlBitmapSkin, GFC_BITMAPSKIN_CENTER_FILL);
						CenterColor		=	GFC_Control_Border_Color_Inner;
					}	
				}
				.Disable				=	.Default;
				.Inactive				=	.Default;
				.InactiveDisable		=	.Disable;
				.Winoff					=	.Default;
				.WinoffDisable			=	.Disable;
			}
		}

		map GFC_CtrlTheme_Bitmap_Control_Border		=	GFC_Control_DefaultBorder_Style;
		map GFC_Control								=	GFC_Control_DefaultBorder_Style;
	}


	// ** Empty style
	
	GFC_Control_EmptyBorder_Style
	{
		GFC_Control_Renderer_Control			=	GFC_CtrlTheme_Bitmap_Control_Border_Renderer_ControlEmpty;
		.Size_Margin							=	GRectMargin(0,0,0,0);
		.Size_TitleBorderMargin_Center			=	GRectMargin(6,0,6,0);

		map GFC_CtrlTheme_Bitmap_Control_Border		=	GFC_Control_DefaultBorder_Style;
		map GFC_Control								=	GFC_Control_DefaultBorder_Style;
	}


	// ** External border label style

	style SF_CtrlTheme_Civ4_Control_Label_External_Style	
	{
		GFC_Control_Color_Background				=	GFC_Control_ExternalBorder_Style[GFC_Control_Border_Color_Inner];
		GFC_Control_Combine_Background				=	GFC_Control_ExternalBorder_Style[GFC_Control_Border_Combine_Inner];

		GFC_Control_Label_Size_Margin				=	GRectMargin(6,4,8,5);

			
		with GFC_Control_Label_Color
		{	
			.Text_Default						=	GFC_Control_Color_Text_Default;
			.Text_Disable						=	GFC_Control_Color_Text_Disable;
			.Text_Winoff						=	.Text_Default;
			.Text_WinoffDisable					=	.Text_Disable;
												
			.TextShadow_Default					=	GFC_Control_Color_TextShadow_Default;
			.TextShadow_Disable					=	GFC_Control_Color_TextShadow_Disable;
			.TextShadow_Winoff					=	.TextShadow_Default;
			.TextShadow_WinoffDisable			=	.TextShadow_Disable;
		}
		
		with GFC_CtrlTheme_Bitmap_Control_Label_Skin
		{
			.Default
			{
				layer
				{
					LayerFlags		= GFlags(GCtrlBitmapSkin, GFC_BITMAPSKIN_SIDES_SCALE, GFC_BITMAPSKIN_CENTER_EMPTY, GFC_BITMAPSKIN_BACKCAPS_REGION, GFC_BITMAPSKIN_NOHITTEST);
					DestCombine		= GColorCombine(BlendSource,Disable);
					FactorCombine	= GColorCombine(Modulate,Source);
					FactorColor		= SF_CtrlTheme_Civ4_Control_Color_BG;
					Image			= GBitmap("Civ4/white.tga", HVGrid, 1, 1, 0, 0);
					Margin			= GRectMargin(6,6,6,6);
				}
				layer {
					LayerFlags		= GFlags(GCtrlBitmapSkin, GFC_BITMAPSKIN_CENTER_SCALE, GFC_BITMAPSKIN_SIDES_SCALE);
					DestCombine		= GColorCombine(BlendSource,Disable);
					FactorCombine	= GColorCombine(Modulate,Source);
					FactorColor		= SF_CtrlTheme_Civ4_Control_Color_BG;
					Image			= GBitmap("Civ4/border_external.tga", HVGrid, 1, 2, 0, 1);
					Margin			= GRectMargin(6,6,6,6);
				}
				layer {
					LayerFlags		= GFlags(GCtrlBitmapSkin, GFC_BITMAPSKIN_CENTER_EMPTY, GFC_BITMAPSKIN_SIDES_SCALE);
					DestCombine		= GColorCombine(BlendSource,Disable);
					Image			= GBitmap("Civ4/border_external.tga", HVGrid, 1, 2, 0, 0);
					Margin			= GRectMargin(6,6,6,6);
					}
			}
			.Disable				= .Default;
			.Inactive				= .Default;
			.InactiveDisable		= .Inactive;
			.Winoff					= .Default;
			.WinoffDisable			= .Winoff;
		}
		
		map GFC_CtrlTheme_Bitmap_Control_Label					=	GFC_Control_DefaultLabel_Style;
		map GFC_Control											=	GFC_Control_DefaultLabel_Style;
	}


	// ** External style

	GFC_Control_ExternalBorder_Style
	{
		.Size_Margin							=	GRectMargin(6,6,6,6);
		.Size_TitleBorderMargin_Center			=	GRectMargin(0,0,0,0);

		with GFC_CtrlTheme_Bitmap_Control_Border_Skin
		{
			with .Full
			{
				.Default
				{
					layer
					{
						LayerFlags		= GFlags(GCtrlBitmapSkin, GFC_BITMAPSKIN_SIDES_SCALE, GFC_BITMAPSKIN_CENTER_EMPTY, GFC_BITMAPSKIN_BACKCAPS_REGION, GFC_BITMAPSKIN_NOHITTEST);
						DestCombine		= GColorCombine(BlendSource,Disable);
						FactorCombine	= GColorCombine(Modulate,Source);
						FactorColor		= SF_CtrlTheme_Civ4_Control_Color_BG;
						Image			= GBitmap("Civ4/white.tga", HVGrid, 1, 1, 0, 0);
						Margin			= GRectMargin(6,6,6,6);
					}
					layer {
						LayerFlags		= GFlags(GCtrlBitmapSkin, GFC_BITMAPSKIN_CENTER_EMPTY, GFC_BITMAPSKIN_SIDES_SCALE);
						DestCombine		= GColorCombine(BlendSource,Disable);
						FactorCombine	= GColorCombine(Modulate,Source);
						FactorColor		= SF_CtrlTheme_Civ4_Control_Color_BG;
						Image			= GBitmap("Civ4/border_panel.tga", HVGrid, 1, 4, 0, 3);
						Margin			= GRectMargin(6,6,6,6);
					}
					layer {
						LayerFlags		= GFlags(GCtrlBitmapSkin, GFC_BITMAPSKIN_CENTER_EMPTY, GFC_BITMAPSKIN_SIDES_SCALE);
						DestCombine		= GColorCombine(BlendSource,Disable);
						Image			= GBitmap("Civ4/border_panel.tga", HVGrid, 1, 4, 0, 0);
						Margin			= GRectMargin(6,6,6,6);
					}
					layer
					{
						LayerFlags		= GFlags(GCtrlBitmapSkin, GFC_BITMAPSKIN_SIDES_SCALE, GFC_BITMAPSKIN_CENTER_EMPTY, GFC_BITMAPSKIN_NOTVISIBLE,
															  	  GFC_BITMAPSKIN_BACKCAPS_REGION, GFC_BITMAPSKIN_REGION_TRANSPARENT, GFC_BITMAPSKIN_COLORKEY);
						DestCombine		= GColorCombine(BlendSource,Disable);
						Image			= GBitmap("Civ4/panel_mask.tga", HVGrid, 1, 1, 0, 0);
						Margin			= GRectMargin(6,6,6,6);
						ColorKey		= GColor(0,0,0,0);
						ColorKeyMax		= GColor(0,0,0,96);
						ColorKeyMask	= GColor(0,0,0,255);
					}
				}
				.Disable				=	.Default;
				.Winoff					=	.Default;
				.WinoffDisable			=	.Winoff;
			}
			with .Indent
			{
				.Default
				{
					layer
					{
						LayerFlags		=	GFlags(GCtrlBitmapSkin, GFC_BITMAPSKIN_CENTER_FILL, GFC_BITMAPSKIN_BACKCAPS_REGION);
						CenterColor		=	SF_CtrlTheme_Civ4_Control_Color_BG; 
					}
					layer {
						LayerFlags		= GFlags(GCtrlBitmapSkin, GFC_BITMAPSKIN_CENTER_SCALE);
						DestCombine		= GColorCombine(BlendSource,Disable);
						FactorCombine	= GColorCombine(Modulate,Source);
						FactorColor		= SF_CtrlTheme_Civ4_Control_Color_BG;
						Image			= GBitmap("Civ4/border_indent.tga", HVGrid, 1, 1, 0, 0);
						Margin			= GRectMargin(0,0,0,0);
					}	
				}
				.Disable				=	.Default;
				.Inactive				=	.Default;
				.InactiveDisable		=	.Disable;
				.Winoff					=	.Default;
				.WinoffDisable			=	.Disable;
			}
		}
		
		map GFC_CtrlTheme_Bitmap_Control_Border		=	GFC_Control_DefaultBorder_Style;
		map GFC_Control								=	GFC_Control_DefaultBorder_Style;
	}

}	// end GFC_Control_Border
