UWindow
Class UWindowWin95LookAndFeel

source: e:\games\UnrealTournament\UWindow\Classes\UWindowWin95LookAndFeel.uc
Core.Object
   |
   +--UWindow.UWindowBase
      |
      +--UWindow.UWindowLookAndFeel
         |
         +--UWindow.UWindowWin95LookAndFeel
Direct Known Subclasses:None

class UWindowWin95LookAndFeel
extends UWindow.UWindowLookAndFeel


Variables
 Region CloseBoxDown
 int CloseBoxOffsetX
 int CloseBoxOffsetY
 Region CloseBoxUp
 Region FrameSB
 Region FrameSBL
 Region FrameSBR
 Region SBBackground
 Region SBDownDisabled
 Region SBDownDown
 Region SBDownUp
 Region SBLeftDisabled
 Region SBLeftDown
 Region SBLeftUp
 Region SBRightDisabled
 Region SBRightDown
 Region SBRightUp
 Region SBUpDisabled
 Region SBUpDown
 Region SBUpUp


Function Summary
 void Checkbox_SetupSizes(UWindowCheckbox W, Canvas C)
 void ComboList_DrawBackground(UWindowComboList W, Canvas C)
 void ComboList_DrawItem(UWindowComboList Combo, Canvas C, float X, float Y, float W, float H, string Text, bool bSelected)
 void Combo_Draw(UWindowComboControl W, Canvas C)
 void Combo_GetButtonBitmaps(UWindowComboButton W)
 void Combo_SetupSizes(UWindowComboControl W, Canvas C)
     
/* Combo Drawing Functions */
 void DrawClientArea(UWindowClientWindow W, Canvas C)
     
/* Client Area Drawing Functions */
 void Editbox_Draw(UWindowEditControl W, Canvas C)
 void Editbox_SetupSizes(UWindowEditControl W, Canvas C)
 void FW_DrawWindowFrame(UWindowFramedWindow W, Canvas C)
     
/* Framed Window Drawing Functions */
 Region FW_GetClientArea(UWindowFramedWindow W)
 FrameHitTest FW_HitTest(UWindowFramedWindow W, float X, float Y)
 void FW_SetupFrameButtons(UWindowFramedWindow W, Canvas C)
 void Menu_DrawMenuBar(UWindowMenuBar W, Canvas C)
 void Menu_DrawMenuBarItem(UWindowMenuBar B, UWindowMenuBarItem I, float X, float Y, float W, float H, Canvas C)
 void Menu_DrawPulldownMenuBackground(UWindowPulldownMenu W, Canvas C)
 void Menu_DrawPulldownMenuItem(UWindowPulldownMenu M, UWindowPulldownMenuItem Item, Canvas C, float X, float Y, float W, float H, bool bSelected)
 void SB_HDraw(UWindowHScrollBar W, Canvas C)
 void SB_SetupDownButton(UWindowSBDownButton W)
 void SB_SetupLeftButton(UWindowSBLeftButton W)
 void SB_SetupRightButton(UWindowSBRightButton W)
 void SB_SetupUpButton(UWindowSBUpButton W)
 void SB_VDraw(UWindowVScrollBar W, Canvas C)
 void Tab_DrawTab(UWindowTabControlTabArea Tab, Canvas C, bool bActiveTab, bool bLeftmostTab, float X, float Y, float W, float H, string Text, bool bShowText)
 void Tab_DrawTabPageArea(UWindowPageControl W, Canvas C, UWindowPageWindow P)
 void Tab_GetTabSize(UWindowTabControlTabArea Tab, Canvas C, string Text, out float, out float)
 void Tab_SetTabPageSize(UWindowPageControl W, UWindowPageWindow P)
 void Tab_SetupLeftButton(UWindowTabControlLeftButton W)
 void Tab_SetupRightButton(UWindowTabControlRightButton W)



Source Code


00001	class UWindowWin95LookAndFeel expands UWindowLookAndFeel;
00002	
00003	#exec TEXTURE IMPORT NAME=ActiveFrame FILE=Textures\ActiveFrame.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
00004	#exec TEXTURE IMPORT NAME=InactiveFrame FILE=Textures\InactiveFrame.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
00005	#exec TEXTURE IMPORT NAME=ActiveFrameS FILE=Textures\ActiveFrameS.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
00006	#exec TEXTURE IMPORT NAME=InactiveFrameS FILE=Textures\InactiveFrameS.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
00007	
00008	#exec TEXTURE IMPORT NAME=Misc FILE=Textures\Misc.bmp GROUP="Icons" MIPS=OFF
00009	
00010	#exec TEXTURE IMPORT NAME=ChkChecked FILE=Textures\ChkChecked.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
00011	#exec TEXTURE IMPORT NAME=ChkUnchecked FILE=Textures\ChkUnchecked.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
00012	#exec TEXTURE IMPORT NAME=ChkCheckedDisabled FILE=Textures\ChkCheckedDisabled.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
00013	#exec TEXTURE IMPORT NAME=ChkUncheckedDisabled FILE=Textures\ChkUncheckedDisabled.bmp GROUP="Icons" FLAGS=2 MIPS=OFF
00014	
00015	#exec TEXTURE IMPORT NAME=MenuBar FILE=Textures\MenuBar.bmp GROUP="Icons" MIPS=OFF
00016	#exec TEXTURE IMPORT NAME=MenuHighlightL FILE=Textures\MenuHighlightL.bmp FLAGS=2 GROUP="Icons" MIPS=OFF
00017	#exec TEXTURE IMPORT NAME=MenuHighlightM FILE=Textures\MenuHighlightM.bmp FLAGS=2 GROUP="Icons" MIPS=OFF
00018	#exec TEXTURE IMPORT NAME=MenuHighlightR FILE=Textures\MenuHighlightR.bmp FLAGS=2 GROUP="Icons" MIPS=OFF
00019	
00020	#exec TEXTURE IMPORT NAME=MenuArea FILE=Textures\MenuArea.bmp GROUP="Icons" MIPS=OFF
00021	#exec TEXTURE IMPORT NAME=MenuTL FILE=Textures\MenuTL.bmp GROUP="Icons" MIPS=OFF
00022	#exec TEXTURE IMPORT NAME=MenuT FILE=Textures\MenuT.bmp GROUP="Icons" MIPS=OFF
00023	#exec TEXTURE IMPORT NAME=MenuTR FILE=Textures\MenuTR.bmp GROUP="Icons" MIPS=OFF
00024	#exec TEXTURE IMPORT NAME=MenuL FILE=Textures\MenuL.bmp GROUP="Icons" MIPS=OFF
00025	#exec TEXTURE IMPORT NAME=MenuR FILE=Textures\MenuR.bmp GROUP="Icons" MIPS=OFF
00026	#exec TEXTURE IMPORT NAME=MenuBL FILE=Textures\MenuBL.bmp GROUP="Icons" MIPS=OFF
00027	#exec TEXTURE IMPORT NAME=MenuB FILE=Textures\MenuB.bmp GROUP="Icons" MIPS=OFF
00028	#exec TEXTURE IMPORT NAME=MenuBR FILE=Textures\MenuBR.bmp GROUP="Icons" MIPS=OFF
00029	#exec TEXTURE IMPORT NAME=MenuHighlight FILE=Textures\MenuHighlight.bmp GROUP="Icons" MIPS=OFF
00030	
00031	var() Region	SBUpUp;
00032	var() Region	SBUpDown;
00033	var() Region	SBUpDisabled;
00034	
00035	var() Region	SBDownUp;
00036	var() Region	SBDownDown;
00037	var() Region	SBDownDisabled;
00038	
00039	var() Region	SBLeftUp;
00040	var() Region	SBLeftDown;
00041	var() Region	SBLeftDisabled;
00042	
00043	var() Region	SBRightUp;
00044	var() Region	SBRightDown;
00045	var() Region	SBRightDisabled;
00046	
00047	var() Region	SBBackground;
00048	
00049	var() Region	FrameSBL;
00050	var() Region	FrameSB;
00051	var() Region	FrameSBR;
00052	
00053	var() Region	CloseBoxUp;
00054	var() Region	CloseBoxDown;
00055	var() int		CloseBoxOffsetX;
00056	var() int		CloseBoxOffsetY;
00057	
00058	
00059	const SIZEBORDER = 3;
00060	const BRSIZEBORDER = 15;
00061	
00062	/* Framed Window Drawing Functions */
00063	function FW_DrawWindowFrame(UWindowFramedWindow W, Canvas C)
00064	{
00065		local Texture T;
00066		local Region R, Temp;
00067	
00068		C.DrawColor.r = 255;
00069		C.DrawColor.g = 255;
00070		C.DrawColor.b = 255;
00071	
00072		T = W.GetLookAndFeelTexture();
00073	
00074		R = FrameTL;
00075		W.DrawStretchedTextureSegment( C, 0, 0, R.W, R.H, R.X, R.Y, R.W, R.H, T );
00076	
00077		R = FrameT;
00078		W.DrawStretchedTextureSegment( C, FrameTL.W, 0, 
00079										W.WinWidth - FrameTL.W
00080										- FrameTR.W,
00081										R.H, R.X, R.Y, R.W, R.H, T );
00082	
00083		R = FrameTR;
00084		W.DrawStretchedTextureSegment( C, W.WinWidth - R.W, 0, R.W, R.H, R.X, R.Y, R.W, R.H, T );
00085		
00086	
00087		if(W.bStatusBar)
00088			Temp = FrameSBL;
00089		else
00090			Temp = FrameBL;
00091		
00092		R = FrameL;
00093		W.DrawStretchedTextureSegment( C, 0, FrameTL.H,
00094										R.W,  
00095										W.WinHeight - FrameTL.H
00096										- Temp.H,
00097										R.X, R.Y, R.W, R.H, T );
00098	
00099		R = FrameR;
00100		W.DrawStretchedTextureSegment( C, W.WinWidth - R.W, FrameTL.H,
00101										R.W,  
00102										W.WinHeight - FrameTL.H
00103										- Temp.H,
00104										R.X, R.Y, R.W, R.H, T );
00105	
00106		if(W.bStatusBar)
00107			R = FrameSBL;
00108		else
00109			R = FrameBL;
00110		W.DrawStretchedTextureSegment( C, 0, W.WinHeight - R.H, R.W, R.H, R.X, R.Y, R.W, R.H, T );
00111	
00112		if(W.bStatusBar)
00113		{
00114			R = FrameSB;
00115			W.DrawStretchedTextureSegment( C, FrameBL.W, W.WinHeight - R.H, 
00116											W.WinWidth - FrameSBL.W
00117											- FrameSBR.W,
00118											R.H, R.X, R.Y, R.W, R.H, T );
00119		}
00120		else
00121		{
00122			R = FrameB;
00123			W.DrawStretchedTextureSegment( C, FrameBL.W, W.WinHeight - R.H, 
00124											W.WinWidth - FrameBL.W
00125											- FrameBR.W,
00126											R.H, R.X, R.Y, R.W, R.H, T );
00127		}
00128	
00129		if(W.bStatusBar)
00130			R = FrameSBR;
00131		else
00132			R = FrameBR;
00133		W.DrawStretchedTextureSegment( C, W.WinWidth - R.W, W.WinHeight - R.H, R.W, R.H, R.X, R.Y, 
00134										R.W, R.H, T );
00135	
00136	
00137		C.Font = W.Root.Fonts[W.F_Normal];
00138		if(W.ParentWindow.ActiveWindow == W)
00139			C.DrawColor = FrameActiveTitleColor;
00140		else
00141			C.DrawColor = FrameInactiveTitleColor;
00142	
00143	
00144		W.ClipTextWidth(C, FrameTitleX, FrameTitleY, 
00145						W.WindowTitle, W.WinWidth - 22);
00146	
00147		if(W.bStatusBar) 
00148		{
00149			C.DrawColor.r = 0;
00150			C.DrawColor.g = 0;
00151			C.DrawColor.b = 0;
00152	
00153			W.ClipTextWidth(C, 6, W.WinHeight - 13, W.StatusBarText, W.WinWidth - 22);
00154	
00155			C.DrawColor.r = 255;
00156			C.DrawColor.g = 255;
00157			C.DrawColor.b = 255;
00158		}
00159	}
00160	
00161	function FW_SetupFrameButtons(UWindowFramedWindow W, Canvas C)
00162	{
00163		local Texture T;
00164	
00165		T = W.GetLookAndFeelTexture();
00166	
00167		W.CloseBox.WinLeft = W.WinWidth - CloseBoxOffsetX - CloseBoxUp.W;
00168		W.CloseBox.WinTop = CloseBoxOffsetY;
00169	
00170		W.CloseBox.SetSize(CloseBoxUp.W, CloseBoxUp.H);
00171		W.CloseBox.bUseRegion = True;
00172	
00173		W.CloseBox.UpTexture = T;
00174		W.CloseBox.DownTexture = T;
00175		W.CloseBox.OverTexture = T;
00176		W.CloseBox.DisabledTexture = T;
00177	
00178		W.CloseBox.UpRegion = CloseBoxUp;
00179		W.CloseBox.DownRegion = CloseBoxDown;
00180		W.CloseBox.OverRegion = CloseBoxUp;
00181		W.CloseBox.DisabledRegion = CloseBoxUp;
00182	}
00183	
00184	function Region FW_GetClientArea(UWindowFramedWindow W)
00185	{
00186		local Region R;
00187	
00188		R.X = FrameL.W;
00189		R.Y	= FrameT.H;
00190		R.W = W.WinWidth - (FrameL.W + FrameR.W);
00191		if(W.bStatusBar) 
00192			R.H = W.WinHeight - (FrameT.H + FrameSB.H);
00193		else
00194			R.H = W.WinHeight - (FrameT.H + FrameB.H);
00195	
00196		return R;
00197	}
00198	
00199	
00200	function FrameHitTest FW_HitTest(UWindowFramedWindow W, float X, float Y)
00201	{
00202		if((X >= 3) && (X <= W.WinWidth-3) && (Y >= 3) && (Y <= 14))
00203			return HT_TitleBar;
00204		if((X < BRSIZEBORDER && Y < SIZEBORDER) || (X < SIZEBORDER && Y < BRSIZEBORDER)) 
00205			return HT_NW;
00206		if((X > W.WinWidth - SIZEBORDER && Y < BRSIZEBORDER) || (X > W.WinWidth - BRSIZEBORDER && Y < SIZEBORDER))
00207			return HT_NE;
00208		if((X < BRSIZEBORDER && Y > W.WinHeight - SIZEBORDER)|| (X < SIZEBORDER && Y > W.WinHeight - BRSIZEBORDER)) 
00209			return HT_SW;
00210		if((X > W.WinWidth - BRSIZEBORDER) && (Y > W.WinHeight - BRSIZEBORDER))
00211			return HT_SE;
00212		if(Y < SIZEBORDER)
00213			return HT_N;
00214		if(Y > W.WinHeight - SIZEBORDER)
00215			return HT_S;
00216		if(X < SIZEBORDER)
00217			return HT_W;
00218		if(X > W.WinWidth - SIZEBORDER)	
00219			return HT_E;
00220	
00221		return HT_None;	
00222	}
00223	
00224	/* Client Area Drawing Functions */
00225	function DrawClientArea(UWindowClientWindow W, Canvas C)
00226	{
00227		W.DrawStretchedTexture(C, 0, 0, W.WinWidth, W.WinHeight, Texture'BlackTexture');
00228	}
00229	
00230	
00231	/* Combo Drawing Functions */
00232	function Combo_SetupSizes(UWindowComboControl W, Canvas C)
00233	{
00234		local float TW, TH;
00235	
00236		C.Font = W.Root.Fonts[W.Font];
00237		W.TextSize(C, W.Text, TW, TH);
00238		
00239		W.WinHeight = 12 + MiscBevelT[2].H + MiscBevelB[2].H;
00240		
00241		switch(W.Align)
00242		{
00243		case TA_Left:
00244			W.EditAreaDrawX = W.WinWidth - W.EditBoxWidth;
00245			W.TextX = 0;
00246			break;
00247		case TA_Right:
00248			W.EditAreaDrawX = 0;	
00249			W.TextX = W.WinWidth - TW;
00250			break;
00251		case TA_Center:
00252			W.EditAreaDrawX = (W.WinWidth - W.EditBoxWidth) / 2;
00253			W.TextX = (W.WinWidth - TW) / 2;
00254			break;
00255		}
00256	
00257		W.EditAreaDrawY = (W.WinHeight - 2) / 2;
00258		W.TextY = (W.WinHeight - TH) / 2;
00259	
00260		W.EditBox.WinLeft = W.EditAreaDrawX + MiscBevelL[2].W;
00261		W.EditBox.WinTop = MiscBevelT[2].H;
00262		W.Button.WinWidth = ComboBtnUp.W;
00263	
00264		if(W.bButtons)
00265		{
00266			W.EditBox.WinWidth = W.EditBoxWidth - MiscBevelL[2].W - MiscBevelR[2].W - ComboBtnUp.W - SBLeftUp.W - SBRightUp.W;
00267			W.EditBox.WinHeight = W.WinHeight - MiscBevelT[2].H - MiscBevelB[2].H;
00268			W.Button.WinLeft = W.WinWidth - ComboBtnUp.W - MiscBevelR[2].W - SBLeftUp.W - SBRightUp.W;
00269			W.Button.WinTop = W.EditBox.WinTop;
00270	
00271			W.LeftButton.WinLeft = W.WinWidth - MiscBevelR[2].W - SBLeftUp.W - SBRightUp.W;
00272			W.LeftButton.WinTop = W.EditBox.WinTop;
00273			W.RightButton.WinLeft = W.WinWidth - MiscBevelR[2].W - SBRightUp.W;
00274			W.RightButton.WinTop = W.EditBox.WinTop;
00275	
00276			W.LeftButton.WinWidth = SBLeftUp.W;
00277			W.LeftButton.WinHeight = SBLeftUp.H;
00278			W.RightButton.WinWidth = SBRightUp.W;
00279			W.RightButton.WinHeight = SBRightUp.H;
00280		}
00281		else
00282		{
00283			W.EditBox.WinWidth = W.EditBoxWidth - MiscBevelL[2].W - MiscBevelR[2].W - ComboBtnUp.W;
00284			W.EditBox.WinHeight = W.WinHeight - MiscBevelT[2].H - MiscBevelB[2].H;
00285			W.Button.WinLeft = W.WinWidth - ComboBtnUp.W - MiscBevelR[2].W;
00286			W.Button.WinTop = W.EditBox.WinTop;
00287		}
00288		W.Button.WinHeight = W.EditBox.WinHeight;
00289	}
00290	
00291	function Combo_Draw(UWindowComboControl W, Canvas C)
00292	{
00293		W.DrawMiscBevel(C, W.EditAreaDrawX, 0, W.EditBoxWidth, W.WinHeight, Misc, 2);
00294	
00295		if(W.Text != "")
00296		{
00297			C.DrawColor = W.TextColor;
00298			W.ClipText(C, W.TextX, W.TextY, W.Text);
00299			C.DrawColor.R = 255;
00300			C.DrawColor.G = 255;
00301			C.DrawColor.B = 255;
00302		}
00303	}
00304	
00305	function ComboList_DrawBackground(UWindowComboList W, Canvas C)
00306	{
00307		W.DrawClippedTexture(C, 0, 0, Texture'UWindow.MenuTL');
00308		W.DrawStretchedTexture(C, 4, 0, W.WinWidth-8, 4, Texture'UWindow.MenuT');
00309		W.DrawClippedTexture(C, W.WinWidth-4, 0, Texture'UWindow.MenuTR');
00310	
00311		W.DrawClippedTexture(C, 0, W.WinHeight-4, Texture'UWindow.MenuBL');
00312		W.DrawStretchedTexture(C, 4, W.WinHeight-4, W.WinWidth-8, 4, Texture'UWindow.MenuB');
00313		W.DrawClippedTexture(C, W.WinWidth-4, W.WinHeight-4, Texture'UWindow.MenuBR');
00314	
00315		W.DrawStretchedTexture(C, 0, 4, 4, W.WinHeight-8, Texture'UWindow.MenuL');
00316		W.DrawStretchedTexture(C, W.WinWidth-4, 4, 4, W.WinHeight-8, Texture'UWindow.MenuR');
00317	
00318		W.DrawStretchedTexture(C, 4, 4, W.WinWidth-8, W.WinHeight-8, Texture'UWindow.MenuArea');
00319	}
00320	
00321	function ComboList_DrawItem(UWindowComboList Combo, Canvas C, float X, float Y, float W, float H, string Text, bool bSelected)
00322	{
00323		C.DrawColor.R = 255;
00324		C.DrawColor.G = 255;
00325		C.DrawColor.B = 255;
00326	
00327		if(bSelected)
00328		{
00329			Combo.DrawStretchedTexture(C, X, Y, W, H, Texture'UWindow.MenuHighlight');
00330			C.DrawColor.R = 0;
00331			C.DrawColor.G = 0;
00332			C.DrawColor.B = 0;
00333		}
00334		else
00335		{
00336			C.DrawColor.R = 0;
00337			C.DrawColor.G = 0;
00338			C.DrawColor.B = 0;
00339		}
00340	
00341		Combo.ClipText(C, X + Combo.TextBorder + 2, Y + 3, Text);
00342	}
00343	
00344	function Checkbox_SetupSizes(UWindowCheckbox W, Canvas C)
00345	{
00346		local float TW, TH;
00347	
00348		W.TextSize(C, W.Text, TW, TH);
00349		W.WinHeight = Max(TH+1, 16);
00350		
00351		switch(W.Align)
00352		{
00353		case TA_Left:
00354			W.ImageX = W.WinWidth - 16;
00355			W.TextX = 0;
00356			break;
00357		case TA_Right:
00358			W.ImageX = 0;	
00359			W.TextX = W.WinWidth - TW;
00360			break;
00361		case TA_Center:
00362			W.ImageX = (W.WinWidth - 16) / 2;
00363			W.TextX = (W.WinWidth - TW) / 2;
00364			break;
00365		}
00366	
00367		W.ImageY = (W.WinHeight - 16) / 2;
00368		W.TextY = (W.WinHeight - TH) / 2;
00369	
00370		if(W.bChecked) 
00371		{
00372			W.UpTexture = Texture'ChkChecked';
00373			W.DownTexture = Texture'ChkChecked';
00374			W.OverTexture = Texture'ChkChecked';
00375			W.DisabledTexture = Texture'ChkCheckedDisabled';
00376		}
00377		else 
00378		{
00379			W.UpTexture = Texture'ChkUnchecked';
00380			W.DownTexture = Texture'ChkUnchecked';
00381			W.OverTexture = Texture'ChkUnchecked';
00382			W.DisabledTexture = Texture'ChkUncheckedDisabled';
00383		}
00384	}
00385	
00386	function Combo_GetButtonBitmaps(UWindowComboButton W)
00387	{
00388		local Texture T;
00389	
00390		T = W.GetLookAndFeelTexture();
00391		
00392		W.bUseRegion = True;
00393	
00394		W.UpTexture = T;
00395		W.DownTexture = T;
00396		W.OverTexture = T;
00397		W.DisabledTexture = T;
00398	
00399		W.UpRegion = ComboBtnUp;
00400		W.DownRegion = ComboBtnDown;
00401		W.OverRegion = ComboBtnUp;
00402		W.DisabledRegion = ComboBtnDisabled;
00403	}
00404	
00405	function Editbox_SetupSizes(UWindowEditControl W, Canvas C)
00406	{
00407		local float TW, TH;
00408		local int B;
00409	
00410		B = EditBoxBevel;
00411			
00412		C.Font = W.Root.Fonts[W.Font];
00413		W.TextSize(C, W.Text, TW, TH);
00414		
00415		W.WinHeight = 12 + MiscBevelT[B].H + MiscBevelB[B].H;
00416		
00417		switch(W.Align)
00418		{
00419		case TA_Left:
00420			W.EditAreaDrawX = W.WinWidth - W.EditBoxWidth;
00421			W.TextX = 0;
00422			break;
00423		case TA_Right:
00424			W.EditAreaDrawX = 0;	
00425			W.TextX = W.WinWidth - TW;
00426			break;
00427		case TA_Center:
00428			W.EditAreaDrawX = (W.WinWidth - W.EditBoxWidth) / 2;
00429			W.TextX = (W.WinWidth - TW) / 2;
00430			break;
00431		}
00432	
00433		W.EditAreaDrawY = (W.WinHeight - 2) / 2;
00434		W.TextY = (W.WinHeight - TH) / 2;
00435	
00436		W.EditBox.WinLeft = W.EditAreaDrawX + MiscBevelL[B].W;
00437		W.EditBox.WinTop = MiscBevelT[B].H;
00438		W.EditBox.WinWidth = W.EditBoxWidth - MiscBevelL[B].W - MiscBevelR[B].W;
00439		W.EditBox.WinHeight = W.WinHeight - MiscBevelT[B].H - MiscBevelB[B].H;
00440	}
00441	
00442	function Editbox_Draw(UWindowEditControl W, Canvas C)
00443	{
00444		W.DrawMiscBevel(C, W.EditAreaDrawX, 0, W.EditBoxWidth, W.WinHeight, Misc, EditBoxBevel);
00445	
00446		if(W.Text != "")
00447		{
00448			C.DrawColor = W.TextColor;
00449			W.ClipText(C, W.TextX, W.TextY, W.Text);
00450			C.DrawColor.R = 255;
00451			C.DrawColor.G = 255;
00452			C.DrawColor.B = 255;
00453		}
00454	}
00455	
00456	function Tab_DrawTab(UWindowTabControlTabArea Tab, Canvas C, bool bActiveTab, bool bLeftmostTab, float X, float Y, float W, float H, string Text, bool bShowText)
00457	{
00458		local Region R;
00459		local Texture T;
00460		local float TW, TH;
00461	
00462		C.DrawColor.R = 255;
00463		C.DrawColor.G = 255;
00464		C.DrawColor.B = 255;
00465	
00466		T = Tab.GetLookAndFeelTexture();
00467		
00468		if(bActiveTab)
00469		{
00470			R = TabSelectedL;
00471			Tab.DrawStretchedTextureSegment( C, X, Y, R.W, R.H, R.X, R.Y, R.W, R.H, T );
00472	
00473			R = TabSelectedM;
00474			Tab.DrawStretchedTextureSegment( C, X+TabSelectedL.W, Y, 
00475											W - TabSelectedL.W
00476											- TabSelectedR.W,
00477											R.H, R.X, R.Y, R.W, R.H, T );
00478	
00479			R = TabSelectedR;
00480			Tab.DrawStretchedTextureSegment( C, X + W - R.W, Y, R.W, R.H, R.X, R.Y, R.W, R.H, T );
00481	
00482			C.Font = Tab.Root.Fonts[Tab.F_Bold];
00483			C.DrawColor.R = 0;
00484			C.DrawColor.G = 0;
00485			C.DrawColor.B = 0;
00486	
00487			if(bShowText)
00488			{
00489				Tab.TextSize(C, Text, TW, TH);
00490				Tab.ClipText(C, X + (W-TW)/2, Y + 3, Text, True);
00491			}
00492		}
00493		else
00494		{
00495			R = TabUnselectedL;
00496			Tab.DrawStretchedTextureSegment( C, X, Y, R.W, R.H, R.X, R.Y, R.W, R.H, T );
00497	
00498			R = TabUnselectedM;
00499			Tab.DrawStretchedTextureSegment( C, X+TabUnselectedL.W, Y, 
00500											W - TabUnselectedL.W
00501											- TabUnselectedR.W,
00502											R.H, R.X, R.Y, R.W, R.H, T );
00503	
00504			R = TabUnselectedR;
00505			Tab.DrawStretchedTextureSegment( C, X + W - R.W, Y, R.W, R.H, R.X, R.Y, R.W, R.H, T );
00506	
00507			C.Font = Tab.Root.Fonts[Tab.F_Normal];
00508			C.DrawColor.R = 0;
00509			C.DrawColor.G = 0;
00510			C.DrawColor.B = 0;
00511	
00512			if(bShowText)
00513			{
00514				Tab.TextSize(C, Text, TW, TH);
00515				Tab.ClipText(C, X + (W-TW)/2, Y + 4, Text, True);
00516			}
00517		}
00518	}
00519	
00520	function SB_SetupUpButton(UWindowSBUpButton W)
00521	{
00522		local Texture T;
00523	
00524		T = W.GetLookAndFeelTexture();
00525	
00526		W.bUseRegion = True;
00527	
00528		W.UpTexture = T;
00529		W.DownTexture = T;
00530		W.OverTexture = T;
00531		W.DisabledTexture = T;
00532	
00533		W.UpRegion = SBUpUp;
00534		W.DownRegion = SBUpDown;
00535		W.OverRegion = SBUpUp;
00536		W.DisabledRegion = SBUpDisabled;
00537	}
00538	
00539	function SB_SetupDownButton(UWindowSBDownButton W)
00540	{
00541		local Texture T;
00542	
00543		T = W.GetLookAndFeelTexture();
00544	
00545		W.bUseRegion = True;
00546	
00547		W.UpTexture = T;
00548		W.DownTexture = T;
00549		W.OverTexture = T;
00550		W.DisabledTexture = T;
00551	
00552		W.UpRegion = SBDownUp;
00553		W.DownRegion = SBDownDown;
00554		W.OverRegion = SBDownUp;
00555		W.DisabledRegion = SBDownDisabled;
00556	}
00557	
00558	
00559	
00560	function SB_SetupLeftButton(UWindowSBLeftButton W)
00561	{
00562		local Texture T;
00563	
00564		T = W.GetLookAndFeelTexture();
00565	
00566		W.bUseRegion = True;
00567	
00568		W.UpTexture = T;
00569		W.DownTexture = T;
00570		W.OverTexture = T;
00571		W.DisabledTexture = T;
00572	
00573		W.UpRegion = SBLeftUp;
00574		W.DownRegion = SBLeftDown;
00575		W.OverRegion = SBLeftUp;
00576		W.DisabledRegion = SBLeftDisabled;
00577	}
00578	
00579	function SB_SetupRightButton(UWindowSBRightButton W)
00580	{
00581		local Texture T;
00582	
00583		T = W.GetLookAndFeelTexture();
00584	
00585		W.bUseRegion = True;
00586	
00587		W.UpTexture = T;
00588		W.DownTexture = T;
00589		W.OverTexture = T;
00590		W.DisabledTexture = T;
00591	
00592		W.UpRegion = SBRightUp;
00593		W.DownRegion = SBRightDown;
00594		W.OverRegion = SBRightUp;
00595		W.DisabledRegion = SBRightDisabled;
00596	}
00597	
00598	function SB_VDraw(UWindowVScrollbar W, Canvas C)
00599	{
00600		local Region R;
00601		local Texture T;
00602	
00603		T = W.GetLookAndFeelTexture();
00604	
00605		R = SBBackground;
00606		W.DrawStretchedTextureSegment( C, 0, 0, W.WinWidth, W.WinHeight, R.X, R.Y, R.W, R.H, T);
00607		
00608		if(!W.bDisabled)
00609		{
00610			W.DrawUpBevel( C, 0, W.ThumbStart, Size_ScrollbarWidth,	W.ThumbHeight, T);
00611		}
00612	}
00613	
00614	function SB_HDraw(UWindowHScrollbar W, Canvas C)
00615	{
00616		local Region R;
00617		local Texture T;
00618	
00619		T = W.GetLookAndFeelTexture();
00620	
00621		R = SBBackground;
00622		W.DrawStretchedTextureSegment( C, 0, 0, W.WinWidth, W.WinHeight, R.X, R.Y, R.W, R.H, T);
00623		
00624		if(!W.bDisabled) 
00625		{
00626			W.DrawUpBevel( C, W.ThumbStart, 0, W.ThumbWidth, Size_ScrollbarWidth, T);
00627		}
00628	}
00629	
00630	function Tab_SetupLeftButton(UWindowTabControlLeftButton W)
00631	{
00632		local Texture T;
00633	
00634		T = W.GetLookAndFeelTexture();
00635	
00636	
00637		W.WinWidth = Size_ScrollbarButtonHeight;
00638		W.WinHeight = Size_ScrollbarWidth;
00639		W.WinTop = Size_TabAreaHeight - W.WinHeight;
00640		W.WinLeft = W.ParentWindow.WinWidth - 2*W.WinWidth;
00641	
00642		W.bUseRegion = True;
00643	
00644		W.UpTexture = T;
00645		W.DownTexture = T;
00646		W.OverTexture = T;
00647		W.DisabledTexture = T;
00648	
00649		W.UpRegion = SBLeftUp;
00650		W.DownRegion = SBLeftDown;
00651		W.OverRegion = SBLeftUp;
00652		W.DisabledRegion = SBLeftDisabled;
00653	}
00654	
00655	function Tab_SetupRightButton(UWindowTabControlRightButton W)
00656	{
00657		local Texture T;
00658	
00659		T = W.GetLookAndFeelTexture();
00660	
00661		W.WinWidth = Size_ScrollbarButtonHeight;
00662		W.WinHeight = Size_ScrollbarWidth;
00663		W.WinTop = Size_TabAreaHeight - W.WinHeight;
00664		W.WinLeft = W.ParentWindow.WinWidth - W.WinWidth;
00665	
00666		W.bUseRegion = True;
00667	
00668		W.UpTexture = T;
00669		W.DownTexture = T;
00670		W.OverTexture = T;
00671		W.DisabledTexture = T;
00672	
00673		W.UpRegion = SBRightUp;
00674		W.DownRegion = SBRightDown;
00675		W.OverRegion = SBRightUp;
00676		W.DisabledRegion = SBRightDisabled;
00677	}
00678	
00679	function Tab_SetTabPageSize(UWindowPageControl W, UWindowPageWindow P)
00680	{
00681		P.WinLeft = 2;
00682		P.WinTop = W.TabArea.WinHeight-(TabSelectedM.H-TabUnselectedM.H) + 3;
00683		P.SetSize(W.WinWidth - 4, W.WinHeight-(W.TabArea.WinHeight-(TabSelectedM.H-TabUnselectedM.H)) - 6);
00684	}
00685	
00686	function Tab_DrawTabPageArea(UWindowPageControl W, Canvas C, UWindowPageWindow P)
00687	{
00688		W.DrawUpBevel( C, 0, Size_TabAreaHeight, W.WinWidth, W.WinHeight-Size_TabAreaHeight, W.GetLookAndFeelTexture());
00689	}
00690	
00691	function Tab_GetTabSize(UWindowTabControlTabArea Tab, Canvas C, string Text, out float W, out float H)
00692	{
00693		local float TW, TH;
00694	
00695		C.Font = Tab.Root.Fonts[Tab.F_Normal];
00696	
00697		Tab.TextSize( C, Text, TW, TH );
00698		W = TW + Size_TabSpacing;
00699		H = TH;
00700	}
00701	
00702	function Menu_DrawMenuBar(UWindowMenuBar W, Canvas C)
00703	{
00704		W.DrawStretchedTexture( C, 16, 0, W.WinWidth - 32, 16, Texture'UWindow.MenuBar');
00705	}
00706	
00707	function Menu_DrawMenuBarItem(UWindowMenuBar B, UWindowMenuBarItem I, float X, float Y, float W, float H, Canvas C)
00708	{
00709		if(B.Selected == I)
00710		{
00711			B.DrawClippedTexture(C, X, 1, Texture'MenuHighlightL');
00712			B.DrawClippedTexture(C, X+W-1, 1, Texture'MenuHighlightR');
00713			B.DrawStretchedTexture(C, X+1, 1, W-2, 16, Texture'MenuHighlightM');
00714		}
00715	
00716		C.Font = B.Root.Fonts[F_Normal];
00717		C.DrawColor.R = 0;
00718		C.DrawColor.G = 0;
00719		C.DrawColor.B = 0;
00720	
00721		B.ClipText(C, X + B.Spacing / 2, 2, I.Caption, True);
00722	}
00723	
00724	function Menu_DrawPulldownMenuBackground(UWindowPulldownMenu W, Canvas C)
00725	{
00726		W.DrawClippedTexture(C, 0, 0, Texture'UWindow.MenuTL');
00727		W.DrawStretchedTexture(C, 2, 0, W.WinWidth-4, 2, Texture'UWindow.MenuT');
00728		W.DrawClippedTexture(C, W.WinWidth-2, 0, Texture'UWindow.MenuTR');
00729	
00730		W.DrawClippedTexture(C, 0, W.WinHeight-2, Texture'UWindow.MenuBL');
00731		W.DrawStretchedTexture(C, 2, W.WinHeight-2, W.WinWidth-4, 2, Texture'UWindow.MenuB');
00732		W.DrawClippedTexture(C, W.WinWidth-2, W.WinHeight-2, Texture'UWindow.MenuBR');
00733	
00734		W.DrawStretchedTexture(C, 0, 2, 2, W.WinHeight-4, Texture'UWindow.MenuL');
00735		W.DrawStretchedTexture(C, W.WinWidth-2, 2, 2, W.WinHeight-4, Texture'UWindow.MenuR');
00736		W.DrawStretchedTexture(C, 2, 2, W.WinWidth-4, W.WinHeight-4, Texture'UWindow.MenuArea');
00737	}
00738	
00739	function Menu_DrawPulldownMenuItem(UWindowPulldownMenu M, UWindowPulldownMenuItem Item, Canvas C, float X, float Y, float W, float H, bool bSelected)
00740	{
00741		C.DrawColor.R = 255;
00742		C.DrawColor.G = 255;
00743		C.DrawColor.B = 255;
00744	
00745		Item.ItemTop = Y + M.WinTop;
00746	
00747		if(Item.Caption == "-")
00748		{
00749			C.DrawColor.R = 255;
00750			C.DrawColor.G = 255;
00751			C.DrawColor.B = 255;
00752			M.DrawStretchedTexture(C, X, Y+5, W, 2, Texture'UWindow.MenuDivider');
00753			return;
00754		}
00755	
00756		C.Font = M.Root.Fonts[F_Normal];
00757	
00758		if(bSelected)
00759			M.DrawStretchedTexture(C, X, Y, W, H, Texture'UWindow.MenuHighlight');
00760	
00761		if(Item.bDisabled) 
00762		{
00763			// Black Shadow
00764			C.DrawColor.R = 96;
00765			C.DrawColor.G = 96;
00766			C.DrawColor.B = 96;
00767		}
00768		else
00769		{
00770			C.DrawColor.R = 0;
00771			C.DrawColor.G = 0;
00772			C.DrawColor.B = 0;
00773		}
00774	
00775		// DrawColor will render the tick black white or gray.
00776		if(Item.bChecked)
00777			M.DrawClippedTexture(C, X + 1, Y + 3, Texture'MenuTick');
00778	
00779		if(Item.SubMenu != None)
00780			M.DrawClippedTexture(C, X + W - 9, Y + 3, Texture'MenuSubArrow');
00781	
00782		M.ClipText(C, X + M.TextBorder + 2, Y + 3, Item.Caption, True);	
00783	}
00784	
00785	defaultproperties
00786	{
00787	     SBUpUp=(X=20,Y=16,W=12,H=10)
00788	     SBUpDown=(X=32,Y=16,W=12,H=10)
00789	     SBUpDisabled=(X=44,Y=16,W=12,H=10)
00790	     SBDownUp=(X=20,Y=26,W=12,H=10)
00791	     SBDownDown=(X=32,Y=26,W=12,H=10)
00792	     SBDownDisabled=(X=44,Y=26,W=12,H=10)
00793	     SBLeftUp=(X=20,Y=48,W=10,H=12)
00794	     SBLeftDown=(X=30,Y=48,W=10,H=12)
00795	     SBLeftDisabled=(X=40,Y=48,W=10,H=12)
00796	     SBRightUp=(X=20,Y=36,W=10,H=12)
00797	     SBRightDown=(X=30,Y=36,W=10,H=12)
00798	     SBRightDisabled=(X=40,Y=36,W=10,H=12)
00799	     SBBackground=(X=4,Y=79,W=1,H=1)
00800	     FrameSBL=(Y=112,W=2,H=16)
00801	     FrameSB=(X=32,Y=112,W=1,H=16)
00802	     FrameSBR=(X=112,Y=112,W=16,H=16)
00803	     CloseBoxUp=(X=4,Y=32,W=11,H=11)
00804	     CloseBoxDown=(X=4,Y=43,W=11,H=11)
00805	     CloseBoxOffsetX=3
00806	     CloseBoxOffsetY=5
00807	     Active=Texture'UWindow.Icons.ActiveFrame'
00808	     Inactive=Texture'UWindow.Icons.InactiveFrame'
00809	     ActiveS=Texture'UWindow.Icons.ActiveFrameS'
00810	     InactiveS=Texture'UWindow.Icons.InactiveFrameS'
00811	     Misc=Texture'UWindow.Icons.Misc'
00812	     FrameTL=(W=2,H=16)
00813	     FrameT=(X=32,W=1,H=16)
00814	     FrameTR=(X=126,W=2,H=16)
00815	     FrameL=(Y=32,W=2,H=1)
00816	     FrameR=(X=126,Y=32,W=2,H=1)
00817	     FrameBL=(Y=125,W=2,H=3)
00818	     FrameB=(X=32,Y=125,W=1,H=3)
00819	     FrameBR=(X=126,Y=125,W=2,H=3)
00820	     FrameActiveTitleColor=(R=255,G=255,B=255)
00821	     FrameInactiveTitleColor=(R=255,G=255,B=255)
00822	     FrameTitleX=6
00823	     FrameTitleY=4
00824	     BevelUpTL=(X=4,Y=16,W=2,H=2)
00825	     BevelUpT=(X=10,Y=16,W=1,H=2)
00826	     BevelUpTR=(X=18,Y=16,W=2,H=2)
00827	     BevelUpL=(X=4,Y=20,W=2,H=1)
00828	     BevelUpR=(X=18,Y=20,W=2,H=1)
00829	     BevelUpBL=(X=4,Y=30,W=2,H=2)
00830	     BevelUpB=(X=10,Y=30,W=1,H=2)
00831	     BevelUpBR=(X=18,Y=30,W=2,H=2)
00832	     BevelUpArea=(X=8,Y=20,W=1,H=1)
00833	     MiscBevelTL(0)=(Y=17,W=3,H=3)
00834	     MiscBevelTL(1)=(W=3,H=3)
00835	     MiscBevelTL(2)=(Y=33,W=2,H=2)
00836	     MiscBevelT(0)=(X=3,Y=17,W=116,H=3)
00837	     MiscBevelT(1)=(X=3,W=116,H=3)
00838	     MiscBevelT(2)=(X=2,Y=33,W=1,H=2)
00839	     MiscBevelTR(0)=(X=119,Y=17,W=3,H=3)
00840	     MiscBevelTR(1)=(X=119,W=3,H=3)
00841	     MiscBevelTR(2)=(X=11,Y=33,W=2,H=2)
00842	     MiscBevelL(0)=(Y=20,W=3,H=10)
00843	     MiscBevelL(1)=(Y=3,W=3,H=10)
00844	     MiscBevelL(2)=(Y=36,W=2,H=1)
00845	     MiscBevelR(0)=(X=119,Y=20,W=3,H=10)
00846	     MiscBevelR(1)=(X=119,Y=3,W=3,H=10)
00847	     MiscBevelR(2)=(X=11,Y=36,W=2,H=1)
00848	     MiscBevelBL(0)=(Y=30,W=3,H=3)
00849	     MiscBevelBL(1)=(Y=14,W=3,H=3)
00850	     MiscBevelBL(2)=(Y=44,W=2,H=2)
00851	     MiscBevelB(0)=(X=3,Y=30,W=116,H=3)
00852	     MiscBevelB(1)=(X=3,Y=14,W=116,H=3)
00853	     MiscBevelB(2)=(X=2,Y=44,W=1,H=2)
00854	     MiscBevelBR(0)=(X=119,Y=30,W=3,H=3)
00855	     MiscBevelBR(1)=(X=119,Y=14,W=3,H=3)
00856	     MiscBevelBR(2)=(X=11,Y=44,W=2,H=2)
00857	     MiscBevelArea(0)=(X=3,Y=20,W=116,H=10)
00858	     MiscBevelArea(1)=(X=3,Y=3,W=116,H=10)
00859	     MiscBevelArea(2)=(X=2,Y=35,W=9,H=9)
00860	     ComboBtnUp=(X=20,Y=60,W=12,H=12)
00861	     ComboBtnDown=(X=32,Y=60,W=12,H=12)
00862	     ComboBtnDisabled=(X=44,Y=60,W=12,H=12)
00863	     ColumnHeadingHeight=13
00864	     HLine=(X=5,Y=78,W=1,H=2)
00865	     EditBoxBevel=2
00866	     TabSelectedL=(X=4,Y=80,W=3,H=17)
00867	     TabSelectedM=(X=7,Y=80,W=1,H=17)
00868	     TabSelectedR=(X=55,Y=80,W=2,H=17)
00869	     TabUnselectedL=(X=57,Y=80,W=3,H=15)
00870	     TabUnselectedM=(X=60,Y=80,W=1,H=15)
00871	     TabUnselectedR=(X=109,Y=80,W=2,H=15)
00872	     TabBackground=(X=4,Y=79,W=1,H=1)
00873	     Size_ScrollbarWidth=12.000000
00874	     Size_ScrollbarButtonHeight=10.000000
00875	     Size_MinScrollbarHeight=6.000000
00876	     Size_TabAreaHeight=15.000000
00877	     Size_TabAreaOverhangHeight=2.000000
00878	     Size_TabSpacing=20.000000
00879	     Size_TabXOffset=1.000000
00880	     Pulldown_ItemHeight=15.000000
00881	     Pulldown_VBorder=3.000000
00882	     Pulldown_HBorder=3.000000
00883	     Pulldown_TextBorder=9.000000
00884	}

End Source Code