UWindow
Class UWindowScrollingDialogClient

source: e:\games\UnrealTournament\UWindow\Classes\UWindowScrollingDialogClient.uc
Core.Object
   |
   +--UWindow.UWindowBase
      |
      +--UWindow.UWindowWindow
         |
         +--UWindow.UWindowClientWindow
            |
            +--UWindow.UWindowDialogClientWindow
               |
               +--UWindow.UWindowPageWindow
                  |
                  +--UWindow.UWindowScrollingDialogClient
Direct Known Subclasses:UMenuAudioScrollClient, UMenuBotConfigSClient, UMenuBotSetupSC, UMenuCustomizeScrollClient, UMenuGameOptionsScrollClient, UMenuGameRulesSClient, UMenuGameSettingsSClient, UMenuHUDConfigScrollClient, UMenuInputOptionsScrollClient, UMenuLoadGameScrollClient, UMenuNetworkScrollClient, UMenuPlayerSetupScrollClient, UMenuSaveGameScrollClient, UMenuServerSetupSC, UMenuStartMatchScrollClient, UMenuTeamGameRulesSClient, UMenuVideoScrollClient, SpeechBinderSC, UTAssaultRulesSC, UTBotConfigSClient, UTIndivBotSetupSC, UTLMSRulesSC, UTRulesSClient, UTServerSetupSC, UTSettingsSClient, UTTeamRSClient, UTTeamSSClient

class UWindowScrollingDialogClient
extends UWindow.UWindowPageWindow


Variables
 UWindowBitmap BRBitmap
 UWindowDialogClientWindow ClientArea
 class ClientClass
 UWindowDialogClientWindow FixedArea
 class FixedAreaClass
 UWindowHScrollBar HorizSB
 UWindowVScrollBar VertSB
 bool bShowHorizSB
 bool bShowVertSB


Function Summary
 void BeforePaint(Canvas C, float X, float Y)
 void Created()
 void GetDesiredDimensions(out float, out float)
 void Paint(Canvas C, float X, float Y)



Source Code


00001	class UWindowScrollingDialogClient extends UWindowPageWindow;
00002	
00003	var bool bShowHorizSB;
00004	var bool bShowVertSB;
00005	
00006	var UWindowDialogClientWindow	ClientArea;
00007	var UWindowDialogClientWindow	FixedArea;
00008	var class<UWindowDialogClientWindow> ClientClass;
00009	var class<UWindowDialogClientWindow> FixedAreaClass;
00010	
00011	var UWindowVScrollBar VertSB;
00012	var UWindowHScrollBar HorizSB;
00013	var UWindowBitmap	  BRBitmap;
00014	
00015	function Created()
00016	{
00017		Super.Created();
00018	
00019		if(FixedAreaClass != None)
00020		{
00021			FixedArea = UWindowDialogClientWindow(CreateWindow(FixedAreaClass, 0, 0, 100, 100, OwnerWindow));
00022			FixedArea.bAlwaysOnTop = True;
00023		}
00024		else
00025			FixedArea = None;
00026	
00027		ClientArea = UWindowDialogClientWindow(CreateWindow(ClientClass, 0, 0, WinWidth, WinHeight, OwnerWindow));
00028	
00029		VertSB = UWindowVScrollbar(CreateWindow(class'UWindowVScrollbar', WinWidth-12, 0, 12, WinHeight));
00030		VertSB.bAlwaysOnTop = True;
00031		VertSB.HideWindow();
00032	
00033		HorizSB = UWindowHScrollbar(CreateWindow(class'UWindowHScrollbar', 0, WinHeight-12, WinWidth, 12));
00034		HorizSB.bAlwaysOnTop = True;
00035		HorizSB.HideWindow();
00036	
00037		BRBitmap = UWindowBitmap(CreateWindow(class'UWindowBitmap', WinWidth-12, WinHeight-12, 12, 12));
00038		BRBitmap.bAlwaysOnTop = True;
00039		BRBitmap.HideWindow();
00040		BRBitmap.bStretch = True;
00041	}
00042	
00043	function BeforePaint(Canvas C, float X, float Y)
00044	{
00045		local float ClientWidth, ClientHeight;
00046		local float FixedHeight;
00047	
00048	
00049		if(FixedArea != None)
00050			FixedHeight = FixedArea.WinHeight;
00051		else
00052			FixedHeight = 0;
00053	
00054		ClientWidth = ClientArea.DesiredWidth;
00055		ClientHeight = ClientArea.DesiredHeight;
00056	
00057		if(ClientWidth <= WinWidth)
00058			ClientWidth = WinWidth;
00059	
00060		if(ClientHeight <= WinHeight - FixedHeight)
00061			ClientHeight = WinHeight - FixedHeight;
00062	
00063		ClientArea.SetSize(ClientWidth, ClientHeight);
00064	
00065		bShowVertSB = (ClientHeight > WinHeight - FixedHeight);
00066		bShowHorizSB = (ClientWidth > WinWidth);
00067	
00068		if(bShowHorizSB)
00069		{
00070			// re-examine need for vertical SB now we've got smaller client area.
00071	
00072			ClientHeight = ClientArea.DesiredHeight;
00073	
00074			if(ClientHeight <= WinHeight - LookAndFeel.Size_ScrollbarWidth - FixedHeight)
00075				ClientHeight = WinHeight - LookAndFeel.Size_ScrollbarWidth - FixedHeight;
00076	
00077			bShowVertSB = (ClientHeight > WinHeight - LookAndFeel.Size_ScrollbarWidth - FixedHeight);
00078		}
00079	
00080		if(bShowVertSB)
00081		{
00082			VertSB.ShowWindow();
00083			VertSB.WinTop = 0;
00084			VertSB.WinLeft = WinWidth - LookAndFeel.Size_ScrollbarWidth;
00085			VertSB.WinWidth = LookAndFeel.Size_ScrollbarWidth;
00086			if(bShowHorizSB) 
00087			{
00088				BRBitmap.ShowWindow();
00089				BRBitmap.WinWidth = LookAndFeel.Size_ScrollbarWidth;
00090				BRBitmap.WinHeight = LookAndFeel.Size_ScrollbarWidth;
00091				BRBitmap.WinTop = WinHeight - LookAndFeel.Size_ScrollbarWidth - FixedHeight;
00092				BRBitmap.WinLeft = WinWidth - LookAndFeel.Size_ScrollbarWidth;
00093	
00094				BRBitmap.T = GetLookAndFeelTexture();
00095				//BRBitmap.R = LookAndFeel.SBBackground;
00096	
00097				VertSB.WinHeight = WinHeight - LookAndFeel.Size_ScrollbarWidth - FixedHeight;
00098			}
00099			else
00100			{
00101				BRBitmap.HideWindow();
00102				VertSB.WinHeight = WinHeight - FixedHeight;
00103			}
00104	
00105			VertSB.SetRange(0, ClientHeight, VertSB.WinHeight, 10);	
00106		}
00107		else
00108		{
00109			BRBitmap.HideWindow();
00110			VertSB.HideWindow();
00111			VertSB.Pos = 0;		
00112		}
00113	
00114		if(bShowHorizSB)
00115		{
00116			HorizSB.ShowWindow();
00117			HorizSB.WinLeft = 0;
00118			HorizSB.WinTop = WinHeight - LookAndFeel.Size_ScrollbarWidth - FixedHeight;
00119			HorizSB.WinHeight = LookAndFeel.Size_ScrollbarWidth;
00120			if(bShowVertSB)
00121				HorizSB.WinWidth = WinWidth - LookAndFeel.Size_ScrollbarWidth;
00122			else
00123				HorizSB.WinWidth = WinWidth;
00124	
00125			HorizSB.SetRange(0, ClientWidth, HorizSB.WinWidth, 10);	
00126		}
00127		else
00128		{
00129			HorizSB.HideWindow();
00130			HorizSB.Pos = 0;		
00131		}
00132	
00133		ClientArea.WinLeft = -HorizSB.Pos;
00134		ClientArea.WinTop = -VertSB.Pos;
00135	
00136		if(FixedArea != None)
00137		{
00138			FixedArea.WinLeft = 0;
00139			FixedArea.WinTop = WinHeight - FixedHeight;
00140			if(FixedArea.WinWidth != WinWidth)
00141				FixedArea.SetSize(WinWidth, FixedArea.WinHeight);
00142		}
00143	
00144		Super.BeforePaint(C, X, Y);
00145	}
00146	
00147	function GetDesiredDimensions(out float W, out float H)
00148	{	
00149		Super(UWindowWindow).GetDesiredDimensions(W, H);
00150	}
00151	
00152	function Paint(Canvas C, float X, float Y)
00153	{
00154	}
00155	
00156	defaultproperties
00157	{
00158	     ClientClass=Class'UWindow.UWindowDialogClientWindow'
00159	}

End Source Code