UWindow
Class UWindowWin95LookAndFeel

source: c:\runehov\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		C.Font = W.Root.Fonts[W.Font];
00349		W.TextSize(C, W.Text, TW, TH);
00350		W.WinHeight = Max(TH+1, 16);
00351		
00352		switch(W.Align)
00353		{
00354		case TA_Left:
00355			W.ImageX = W.WinWidth - 16;
00356			W.TextX = 0;
00357			break;
00358		case TA_Right:
00359			W.ImageX = 0;	
00360			W.TextX = W.WinWidth - TW;
00361			break;
00362		case TA_Center:
00363			W.ImageX = (W.WinWidth - 16) / 2;
00364			W.TextX = (W.WinWidth - TW) / 2;
00365			break;
00366		}
00367	
00368		W.ImageY = (W.WinHeight - 16) / 2;
00369		W.TextY = (W.WinHeight - TH) / 2;
00370	
00371		if(W.bChecked) 
00372		{
00373			W.UpTexture = Texture'ChkChecked';
00374			W.DownTexture = Texture'ChkChecked';
00375			W.OverTexture = Texture'ChkChecked';
00376			W.DisabledTexture = Texture'ChkCheckedDisabled';
00377		}
00378		else 
00379		{
00380			W.UpTexture = Texture'ChkUnchecked';
00381			W.DownTexture = Texture'ChkUnchecked';
00382			W.OverTexture = Texture'ChkUnchecked';
00383			W.DisabledTexture = Texture'ChkUncheckedDisabled';
00384		}
00385	}
00386	
00387	function Combo_GetButtonBitmaps(UWindowComboButton W)
00388	{
00389		local Texture T;
00390	
00391		T = W.GetLookAndFeelTexture();
00392		
00393		W.bUseRegion = True;
00394	
00395		W.UpTexture = T;
00396		W.DownTexture = T;
00397		W.OverTexture = T;
00398		W.DisabledTexture = T;
00399	
00400		W.UpRegion = ComboBtnUp;
00401		W.DownRegion = ComboBtnDown;
00402		W.OverRegion = ComboBtnUp;
00403		W.DisabledRegion = ComboBtnDisabled;
00404	}
00405	
00406	function Editbox_SetupSizes(UWindowEditControl W, Canvas C)
00407	{
00408		local float TW, TH;
00409		local int B;
00410	
00411		B = EditBoxBevel;
00412			
00413		C.Font = W.Root.Fonts[W.Font];
00414		W.TextSize(C, W.Text, TW, TH);
00415		
00416		W.WinHeight = 12 + MiscBevelT[B].H + MiscBevelB[B].H;
00417		
00418		switch(W.Align)
00419		{
00420		case TA_Left:
00421			W.EditAreaDrawX = W.WinWidth - W.EditBoxWidth;
00422			W.TextX = 0;
00423			break;
00424		case TA_Right:
00425			W.EditAreaDrawX = 0;	
00426			W.TextX = W.WinWidth - TW;
00427			break;
00428		case TA_Center:
00429			W.EditAreaDrawX = (W.WinWidth - W.EditBoxWidth) / 2;
00430			W.TextX = (W.WinWidth - TW) / 2;
00431			break;
00432		}
00433	
00434		W.EditAreaDrawY = (W.WinHeight - 2) / 2;
00435		W.TextY = (W.WinHeight - TH) / 2;
00436	
00437		W.EditBox.WinLeft = W.EditAreaDrawX + MiscBevelL[B].W;
00438		W.EditBox.WinTop = MiscBevelT[B].H;
00439		W.EditBox.WinWidth = W.EditBoxWidth - MiscBevelL[B].W - MiscBevelR[B].W;
00440		W.EditBox.WinHeight = W.WinHeight - MiscBevelT[B].H - MiscBevelB[B].H;
00441	}
00442	
00443	function Editbox_Draw(UWindowEditControl W, Canvas C)
00444	{
00445		W.DrawMiscBevel(C, W.EditAreaDrawX, 0, W.EditBoxWidth, W.WinHeight, Misc, EditBoxBevel);
00446	
00447		if(W.Text != "")
00448		{
00449			C.DrawColor = W.TextColor;
00450			W.ClipText(C, W.TextX, W.TextY, W.Text);
00451			C.DrawColor.R = 255;
00452			C.DrawColor.G = 255;
00453			C.DrawColor.B = 255;
00454		}
00455	}
00456	
00457	function Tab_DrawTab(UWindowTabControlTabArea Tab, Canvas C, bool bActiveTab, bool bLeftmostTab, float X, float Y, float W, float H, string Text, bool bShowText)
00458	{
00459		local Region R;
00460		local Texture T;
00461		local float TW, TH;
00462	
00463		C.DrawColor.R = 255;
00464		C.DrawColor.G = 255;
00465		C.DrawColor.B = 255;
00466	
00467		T = Tab.GetLookAndFeelTexture();
00468		
00469		if(bActiveTab)
00470		{
00471			R = TabSelectedL;
00472			Tab.DrawStretchedTextureSegment( C, X, Y, R.W, R.H, R.X, R.Y, R.W, R.H, T );
00473	
00474			R = TabSelectedM;
00475			Tab.DrawStretchedTextureSegment( C, X+TabSelectedL.W, Y, 
00476											W - TabSelectedL.W
00477											- TabSelectedR.W,
00478											R.H, R.X, R.Y, R.W, R.H, T );
00479	
00480			R = TabSelectedR;
00481			Tab.DrawStretchedTextureSegment( C, X + W - R.W, Y, R.W, R.H, R.X, R.Y, R.W, R.H, T );
00482	
00483			C.Font = Tab.Root.Fonts[Tab.F_Bold];
00484			C.DrawColor.R = 0;
00485			C.DrawColor.G = 0;
00486			C.DrawColor.B = 0;
00487	
00488			if(bShowText)
00489			{
00490				Tab.TextSize(C, Text, TW, TH);
00491				Tab.ClipText(C, X + (W-TW)/2, Y + 3, Text, True);
00492			}
00493		}
00494		else
00495		{
00496			R = TabUnselectedL;
00497			Tab.DrawStretchedTextureSegment( C, X, Y, R.W, R.H, R.X, R.Y, R.W, R.H, T );
00498	
00499			R = TabUnselectedM;
00500			Tab.DrawStretchedTextureSegment( C, X+TabUnselectedL.W, Y, 
00501											W - TabUnselectedL.W
00502											- TabUnselectedR.W,
00503											R.H, R.X, R.Y, R.W, R.H, T );
00504	
00505			R = TabUnselectedR;
00506			Tab.DrawStretchedTextureSegment( C, X + W - R.W, Y, R.W, R.H, R.X, R.Y, R.W, R.H, T );
00507	
00508			C.Font = Tab.Root.Fonts[Tab.F_Normal];
00509			C.DrawColor.R = 0;
00510			C.DrawColor.G = 0;
00511			C.DrawColor.B = 0;
00512	
00513			if(bShowText)
00514			{
00515				Tab.TextSize(C, Text, TW, TH);
00516				Tab.ClipText(C, X + (W-TW)/2, Y + 4, Text, True);
00517			}
00518		}
00519	}
00520	
00521	function SB_SetupUpButton(UWindowSBUpButton W)
00522	{
00523		local Texture T;
00524	
00525		T = W.GetLookAndFeelTexture();
00526	
00527		W.bUseRegion = True;
00528	
00529		W.UpTexture = T;
00530		W.DownTexture = T;
00531		W.OverTexture = T;
00532		W.DisabledTexture = T;
00533	
00534		W.UpRegion = SBUpUp;
00535		W.DownRegion = SBUpDown;
00536		W.OverRegion = SBUpUp;
00537		W.DisabledRegion = SBUpDisabled;
00538	}
00539	
00540	function SB_SetupDownButton(UWindowSBDownButton W)
00541	{
00542		local Texture T;
00543	
00544		T = W.GetLookAndFeelTexture();
00545	
00546		W.bUseRegion = True;
00547	
00548		W.UpTexture = T;
00549		W.DownTexture = T;
00550		W.OverTexture = T;
00551		W.DisabledTexture = T;
00552	
00553		W.UpRegion = SBDownUp;
00554		W.DownRegion = SBDownDown;
00555		W.OverRegion = SBDownUp;
00556		W.DisabledRegion = SBDownDisabled;
00557	}
00558	
00559	
00560	
00561	function SB_SetupLeftButton(UWindowSBLeftButton W)
00562	{
00563		local Texture T;
00564	
00565		T = W.GetLookAndFeelTexture();
00566	
00567		W.bUseRegion = True;
00568	
00569		W.UpTexture = T;
00570		W.DownTexture = T;
00571		W.OverTexture = T;
00572		W.DisabledTexture = T;
00573	
00574		W.UpRegion = SBLeftUp;
00575		W.DownRegion = SBLeftDown;
00576		W.OverRegion = SBLeftUp;
00577		W.DisabledRegion = SBLeftDisabled;
00578	}
00579	
00580	function SB_SetupRightButton(UWindowSBRightButton W)
00581	{
00582		local Texture T;
00583	
00584		T = W.GetLookAndFeelTexture();
00585	
00586		W.bUseRegion = True;
00587	
00588		W.UpTexture = T;
00589		W.DownTexture = T;
00590		W.OverTexture = T;
00591		W.DisabledTexture = T;
00592	
00593		W.UpRegion = SBRightUp;
00594		W.DownRegion = SBRightDown;
00595		W.OverRegion = SBRightUp;
00596		W.DisabledRegion = SBRightDisabled;
00597	}
00598	
00599	function SB_VDraw(UWindowVScrollbar W, Canvas C)
00600	{
00601		local Region R;
00602		local Texture T;
00603	
00604		T = W.GetLookAndFeelTexture();
00605	
00606		R = SBBackground;
00607		W.DrawStretchedTextureSegment( C, 0, 0, W.WinWidth, W.WinHeight, R.X, R.Y, R.W, R.H, T);
00608		
00609		if(!W.bDisabled)
00610		{
00611			W.DrawUpBevel( C, 0, W.ThumbStart, Size_ScrollbarWidth,	W.ThumbHeight, T);
00612		}
00613	}
00614	
00615	function SB_HDraw(UWindowHScrollbar W, Canvas C)
00616	{
00617		local Region R;
00618		local Texture T;
00619	
00620		T = W.GetLookAndFeelTexture();
00621	
00622		R = SBBackground;
00623		W.DrawStretchedTextureSegment( C, 0, 0, W.WinWidth, W.WinHeight, R.X, R.Y, R.W, R.H, T);
00624		
00625		if(!W.bDisabled) 
00626		{
00627			W.DrawUpBevel( C, W.ThumbStart, 0, W.ThumbWidth, Size_ScrollbarWidth, T);
00628		}
00629	}
00630	
00631	function Tab_SetupLeftButton(UWindowTabControlLeftButton W)
00632	{
00633		local Texture T;
00634	
00635		T = W.GetLookAndFeelTexture();
00636	
00637	
00638		W.WinWidth = Size_ScrollbarButtonHeight;
00639		W.WinHeight = Size_ScrollbarWidth;
00640		W.WinTop = Size_TabAreaHeight - W.WinHeight;
00641		W.WinLeft = W.ParentWindow.WinWidth - 2*W.WinWidth;
00642	
00643		W.bUseRegion = True;
00644	
00645		W.UpTexture = T;
00646		W.DownTexture = T;
00647		W.OverTexture = T;
00648		W.DisabledTexture = T;
00649	
00650		W.UpRegion = SBLeftUp;
00651		W.DownRegion = SBLeftDown;
00652		W.OverRegion = SBLeftUp;
00653		W.DisabledRegion = SBLeftDisabled;
00654	}
00655	
00656	function Tab_SetupRightButton(UWindowTabControlRightButton W)
00657	{
00658		local Texture T;
00659	
00660		T = W.GetLookAndFeelTexture();
00661	
00662		W.WinWidth = Size_ScrollbarButtonHeight;
00663		W.WinHeight = Size_ScrollbarWidth;
00664		W.WinTop = Size_TabAreaHeight - W.WinHeight;
00665		W.WinLeft = W.ParentWindow.WinWidth - W.WinWidth;
00666	
00667		W.bUseRegion = True;
00668	
00669		W.UpTexture = T;
00670		W.DownTexture = T;
00671		W.OverTexture = T;
00672		W.DisabledTexture = T;
00673	
00674		W.UpRegion = SBRightUp;
00675		W.DownRegion = SBRightDown;
00676		W.OverRegion = SBRightUp;
00677		W.DisabledRegion = SBRightDisabled;
00678	}
00679	
00680	function Tab_SetTabPageSize(UWindowPageControl W, UWindowPageWindow P)
00681	{
00682		P.WinLeft = 2;
00683		P.WinTop = W.TabArea.WinHeight-(TabSelectedM.H-TabUnselectedM.H) + 3;
00684		P.SetSize(W.WinWidth - 4, W.WinHeight-(W.TabArea.WinHeight-(TabSelectedM.H-TabUnselectedM.H)) - 6);
00685	}
00686	
00687	function Tab_DrawTabPageArea(UWindowPageControl W, Canvas C, UWindowPageWindow P)
00688	{
00689		W.DrawUpBevel( C, 0, Size_TabAreaHeight, W.WinWidth, W.WinHeight-Size_TabAreaHeight, W.GetLookAndFeelTexture());
00690	}
00691	
00692	function Tab_GetTabSize(UWindowTabControlTabArea Tab, Canvas C, string Text, out float W, out float H)
00693	{
00694		local float TW, TH;
00695	
00696		C.Font = Tab.Root.Fonts[Tab.F_Normal];
00697	
00698		Tab.TextSize( C, Text, TW, TH );
00699		W = TW + Size_TabSpacing;
00700		H = TH;
00701	}
00702	
00703	function Menu_DrawMenuBar(UWindowMenuBar W, Canvas C)
00704	{
00705		W.DrawStretchedTexture( C, 16, 0, W.WinWidth - 32, 16, Texture'UWindow.MenuBar');
00706	}
00707	
00708	function Menu_DrawMenuBarItem(UWindowMenuBar B, UWindowMenuBarItem I, float X, float Y, float W, float H, Canvas C)
00709	{
00710		if(B.Selected == I)
00711		{
00712			B.DrawClippedTexture(C, X, 1, Texture'MenuHighlightL');
00713			B.DrawClippedTexture(C, X+W-1, 1, Texture'MenuHighlightR');
00714			B.DrawStretchedTexture(C, X+1, 1, W-2, 16, Texture'MenuHighlightM');
00715		}
00716	
00717		C.Font = B.Root.Fonts[F_Normal];
00718		C.DrawColor.R = 0;
00719		C.DrawColor.G = 0;
00720		C.DrawColor.B = 0;
00721	
00722		B.ClipText(C, X + B.Spacing / 2, 2, I.Caption, True);
00723	}
00724	
00725	function Menu_DrawPulldownMenuBackground(UWindowPulldownMenu W, Canvas C)
00726	{
00727		W.DrawClippedTexture(C, 0, 0, Texture'UWindow.MenuTL');
00728		W.DrawStretchedTexture(C, 2, 0, W.WinWidth-4, 2, Texture'UWindow.MenuT');
00729		W.DrawClippedTexture(C, W.WinWidth-2, 0, Texture'UWindow.MenuTR');
00730	
00731		W.DrawClippedTexture(C, 0, W.WinHeight-2, Texture'UWindow.MenuBL');
00732		W.DrawStretchedTexture(C, 2, W.WinHeight-2, W.WinWidth-4, 2, Texture'UWindow.MenuB');
00733		W.DrawClippedTexture(C, W.WinWidth-2, W.WinHeight-2, Texture'UWindow.MenuBR');
00734	
00735		W.DrawStretchedTexture(C, 0, 2, 2, W.WinHeight-4, Texture'UWindow.MenuL');
00736		W.DrawStretchedTexture(C, W.WinWidth-2, 2, 2, W.WinHeight-4, Texture'UWindow.MenuR');
00737		W.DrawStretchedTexture(C, 2, 2, W.WinWidth-4, W.WinHeight-4, Texture'UWindow.MenuArea');
00738	}
00739	
00740	function Menu_DrawPulldownMenuItem(UWindowPulldownMenu M, UWindowPulldownMenuItem Item, Canvas C, float X, float Y, float W, float H, bool bSelected)
00741	{
00742		C.DrawColor.R = 255;
00743		C.DrawColor.G = 255;
00744		C.DrawColor.B = 255;
00745	
00746		Item.ItemTop = Y + M.WinTop;
00747	
00748		if(Item.Caption == "-")
00749		{
00750			C.DrawColor.R = 255;
00751			C.DrawColor.G = 255;
00752			C.DrawColor.B = 255;
00753			M.DrawStretchedTexture(C, X, Y+5, W, 2, Texture'UWindow.MenuDivider');
00754			return;
00755		}
00756	
00757		C.Font = M.Root.Fonts[F_Normal];
00758	
00759		if(bSelected)
00760			M.DrawStretchedTexture(C, X, Y, W, H, Texture'UWindow.MenuHighlight');
00761	
00762		if(Item.bDisabled) 
00763		{
00764			// Black Shadow
00765			C.DrawColor.R = 96;
00766			C.DrawColor.G = 96;
00767			C.DrawColor.B = 96;
00768		}
00769		else
00770		{
00771			C.DrawColor.R = 0;
00772			C.DrawColor.G = 0;
00773			C.DrawColor.B = 0;
00774		}
00775	
00776		// DrawColor will render the tick black white or gray.
00777		if(Item.bChecked)
00778			M.DrawClippedTexture(C, X + 1, Y + 3, Texture'MenuTick');
00779	
00780		if(Item.SubMenu != None)
00781			M.DrawClippedTexture(C, X + W - 9, Y + 3, Texture'MenuSubArrow');
00782	
00783		M.ClipText(C, X + M.TextBorder + 2, Y + 3, Item.Caption, True);	
00784	}
00785	
00786	defaultproperties
00787	{
00788	     SBUpUp=(X=20,Y=16,W=12,H=10)
00789	     SBUpDown=(X=32,Y=16,W=12,H=10)
00790	     SBUpDisabled=(X=44,Y=16,W=12,H=10)
00791	     SBDownUp=(X=20,Y=26,W=12,H=10)
00792	     SBDownDown=(X=32,Y=26,W=12,H=10)
00793	     SBDownDisabled=(X=44,Y=26,W=12,H=10)
00794	     SBLeftUp=(X=20,Y=48,W=10,H=12)
00795	     SBLeftDown=(X=30,Y=48,W=10,H=12)
00796	     SBLeftDisabled=(X=40,Y=48,W=10,H=12)
00797	     SBRightUp=(X=20,Y=36,W=10,H=12)
00798	     SBRightDown=(X=30,Y=36,W=10,H=12)
00799	     SBRightDisabled=(X=40,Y=36,W=10,H=12)
00800	     SBBackground=(X=4,Y=79,W=1,H=1)
00801	     FrameSBL=(Y=112,W=2,H=16)
00802	     FrameSB=(X=32,Y=112,W=1,H=16)
00803	     FrameSBR=(X=112,Y=112,W=16,H=16)
00804	     CloseBoxUp=(X=4,Y=32,W=11,H=11)
00805	     CloseBoxDown=(X=4,Y=43,W=11,H=11)
00806	     CloseBoxOffsetX=3
00807	     CloseBoxOffsetY=5
00808	     Active=Texture'UWindow.Icons.ActiveFrame'
00809	     Inactive=Texture'UWindow.Icons.InactiveFrame'
00810	     ActiveS=Texture'UWindow.Icons.ActiveFrameS'
00811	     InactiveS=Texture'UWindow.Icons.InactiveFrameS'
00812	     Misc=Texture'UWindow.Icons.Misc'
00813	     FrameTL=(W=2,H=16)
00814	     FrameT=(X=32,W=1,H=16)
00815	     FrameTR=(X=126,W=2,H=16)
00816	     FrameL=(Y=32,W=2,H=1)
00817	     FrameR=(X=126,Y=32,W=2,H=1)
00818	     FrameBL=(Y=125,W=2,H=3)
00819	     FrameB=(X=32,Y=125,W=1,H=3)
00820	     FrameBR=(X=126,Y=125,W=2,H=3)
00821	     FrameActiveTitleColor=(R=255,G=255,B=255)
00822	     FrameInactiveTitleColor=(R=255,G=255,B=255)
00823	     FrameTitleX=6
00824	     FrameTitleY=4
00825	     BevelUpTL=(X=4,Y=16,W=2,H=2)
00826	     BevelUpT=(X=10,Y=16,W=1,H=2)
00827	     BevelUpTR=(X=18,Y=16,W=2,H=2)
00828	     BevelUpL=(X=4,Y=20,W=2,H=1)
00829	     BevelUpR=(X=18,Y=20,W=2,H=1)
00830	     BevelUpBL=(X=4,Y=30,W=2,H=2)
00831	     BevelUpB=(X=10,Y=30,W=1,H=2)
00832	     BevelUpBR=(X=18,Y=30,W=2,H=2)
00833	     BevelUpArea=(X=8,Y=20,W=1,H=1)
00834	     MiscBevelTL(0)=(Y=17,W=3,H=3)
00835	     MiscBevelTL(1)=(W=3,H=3)
00836	     MiscBevelTL(2)=(Y=33,W=2,H=2)
00837	     MiscBevelT(0)=(X=3,Y=17,W=116,H=3)
00838	     MiscBevelT(1)=(X=3,W=116,H=3)
00839	     MiscBevelT(2)=(X=2,Y=33,W=1,H=2)
00840	     MiscBevelTR(0)=(X=119,Y=17,W=3,H=3)
00841	     MiscBevelTR(1)=(X=119,W=3,H=3)
00842	     MiscBevelTR(2)=(X=11,Y=33,W=2,H=2)
00843	     MiscBevelL(0)=(Y=20,W=3,H=10)
00844	     MiscBevelL(1)=(Y=3,W=3,H=10)
00845	     MiscBevelL(2)=(Y=36,W=2,H=1)
00846	     MiscBevelR(0)=(X=119,Y=20,W=3,H=10)
00847	     MiscBevelR(1)=(X=119,Y=3,W=3,H=10)
00848	     MiscBevelR(2)=(X=11,Y=36,W=2,H=1)
00849	     MiscBevelBL(0)=(Y=30,W=3,H=3)
00850	     MiscBevelBL(1)=(Y=14,W=3,H=3)
00851	     MiscBevelBL(2)=(Y=44,W=2,H=2)
00852	     MiscBevelB(0)=(X=3,Y=30,W=116,H=3)
00853	     MiscBevelB(1)=(X=3,Y=14,W=116,H=3)
00854	     MiscBevelB(2)=(X=2,Y=44,W=1,H=2)
00855	     MiscBevelBR(0)=(X=119,Y=30,W=3,H=3)
00856	     MiscBevelBR(1)=(X=119,Y=14,W=3,H=3)
00857	     MiscBevelBR(2)=(X=11,Y=44,W=2,H=2)
00858	     MiscBevelArea(0)=(X=3,Y=20,W=116,H=10)
00859	     MiscBevelArea(1)=(X=3,Y=3,W=116,H=10)
00860	     MiscBevelArea(2)=(X=2,Y=35,W=9,H=9)
00861	     ComboBtnUp=(X=20,Y=60,W=12,H=12)
00862	     ComboBtnDown=(X=32,Y=60,W=12,H=12)
00863	     ComboBtnDisabled=(X=44,Y=60,W=12,H=12)
00864	     ColumnHeadingHeight=13
00865	     HLine=(X=5,Y=78,W=1,H=2)
00866	     EditBoxBevel=2
00867	     TabSelectedL=(X=4,Y=80,W=3,H=17)
00868	     TabSelectedM=(X=7,Y=80,W=1,H=17)
00869	     TabSelectedR=(X=55,Y=80,W=2,H=17)
00870	     TabUnselectedL=(X=57,Y=80,W=3,H=15)
00871	     TabUnselectedM=(X=60,Y=80,W=1,H=15)
00872	     TabUnselectedR=(X=109,Y=80,W=2,H=15)
00873	     TabBackground=(X=4,Y=79,W=1,H=1)
00874	     Size_ScrollbarWidth=12.000000
00875	     Size_ScrollbarButtonHeight=10.000000
00876	     Size_MinScrollbarHeight=6.000000
00877	     Size_TabAreaHeight=15.000000
00878	     Size_TabAreaOverhangHeight=2.000000
00879	     Size_TabSpacing=20.000000
00880	     Size_TabXOffset=1.000000
00881	     Pulldown_ItemHeight=15.000000
00882	     Pulldown_VBorder=3.000000
00883	     Pulldown_HBorder=3.000000
00884	     Pulldown_TextBorder=9.000000
00885	}

End Source Code