UWindow
Class UWindowLayoutControl

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

class UWindowLayoutControl
extends UWindow.UWindowLayoutBase


Variables
 float MinimumHeight
 float MinimumWidth
 UWindowDialogClientWindow OwnerWindow
 UWindowLayoutRow RowList
 float WinHeight
 float WinLeft
 float WinTop
 float WinWidth


Function Summary
 UWindowLayoutCell AddCell(optional int, optional int)
 UWindowLayoutRow AddRow()
 UWindowLayoutControl Create()
     
// Methods
 void PerformLayout()
     
/*
Layout procedure

1.  Calculate minimum (desired) row height by asking
    controls
2.  For each column, work out the minimum (desired) width for this column.
    Then add these up and 
	
	.
2.	If this is less than WinHeight, space cells to fit.
3.	If this is more than WinHeight, adjust parent
    window's DesiredWidth/DesiredHeight variables to cause scrolling.


*/



Source Code


00001	class UWindowLayoutControl extends UWindowLayoutBase;
00002	
00003	var UWindowDialogClientWindow	OwnerWindow;
00004	
00005	var float				WinTop;
00006	var float				WinLeft;
00007	var float				WinWidth;
00008	var float				WinHeight;
00009	
00010	var float				MinimumWidth;
00011	var float				MinimumHeight;
00012	
00013	
00014	var UWindowLayoutRow	RowList;
00015	
00016	
00017	// Methods
00018	static function UWindowLayoutControl Create()
00019	{
00020		local UWindowLayoutControl C;
00021	
00022		C = new class'UWindowLayoutControl';
00023		C.RowList = new class'UWindowLayoutRow';
00024		C.RowList.SetupSentinel();
00025	
00026		return C;
00027	}
00028	
00029	
00030	/*
00031	Layout procedure
00032	
00033	1.  Calculate minimum (desired) row height by asking
00034	    controls
00035	2.  For each column, work out the minimum (desired) width for this column.
00036	    Then add these up and 
00037		
00038		.
00039	2.	If this is less than WinHeight, space cells to fit.
00040	3.	If this is more than WinHeight, adjust parent
00041	    window's DesiredWidth/DesiredHeight variables to cause scrolling.
00042	
00043	
00044	*/
00045	
00046	function PerformLayout()
00047	{
00048		local UWindowLayoutRow R;
00049		local float TotalWidth;
00050		local float TotalHeight;
00051	
00052		for(R = UWindowLayoutRow(RowList.Next); R != None; R = UWindowLayoutRow(R.Next))
00053			TotalHeight += R.CalcMinHeight();
00054	
00055		
00056			TotalWidth += R.CalcMinHeight();
00057	
00058	
00059	}
00060	
00061	function UWindowLayoutRow AddRow()
00062	{
00063		return UWindowLayoutRow(RowList.Append(class'UWindowLayoutRow'));
00064	}
00065	
00066	function UWindowLayoutCell AddCell(optional int ColSpan, optional int RowSpan)
00067	{
00068		return RowList.AddCell(ColSpan, RowSpan);
00069	}
00070	
00071	defaultproperties
00072	{
00073	}

End Source Code