UWindow
Class UWindowScrollingDialogClient

source: c:\runehov\UWindow\Classes\UWindowScrollingDialogClient.uc
Core.Object
   |
   +--UWindow.UWindowBase
      |
      +--UWindow.UWindowWindow
         |
         +--UWindow.UWindowClientWindow
            |
            +--UWindow.UWindowDialogClientWindow
               |
               +--UWindow.UWindowPageWindow
                  |
                  +--UWindow.UWindowScrollingDialogClient
Direct Known Subclasses:ArenaMenuRulesSC, RuneMenuPlayerSetupScrollClient, RuneMenuRulesScrollClient, RuneMenuScrollingDialogClient, RuneMenuSettingsScrollClient

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

End Source Code