UWindow
Class UWindowMessageBox

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

class UWindowMessageBox
extends UWindow.UWindowFramedWindow


Variables
 int FrameCount
 MessageBoxResult Result
 int TimeOut
 float TimeOutTime
 bool bSetupSize


Function Summary
 void AfterPaint(Canvas C, float X, float Y)
 void BeforePaint(Canvas C, float X, float Y)
 void Close(optional bool)
 void SetupMessageBox(string Title, string Message, MessageBoxButtons Buttons, MessageBoxResult InESCResult, optional MessageBoxResult, optional int)



Source Code


00001	class UWindowMessageBox expands UWindowFramedWindow;
00002	
00003	var MessageBoxResult Result;
00004	var float TimeOutTime;
00005	var int TimeOut;
00006	var bool bSetupSize;
00007	var int FrameCount;
00008	
00009	function SetupMessageBox(string Title, string Message, MessageBoxButtons Buttons, MessageBoxResult InESCResult, optional MessageBoxResult InEnterResult, optional int InTimeOut)
00010	{
00011		WindowTitle = Title;
00012		UWindowMessageBoxCW(ClientArea).SetupMessageBoxClient(Message, Buttons, InEnterResult);
00013		Result = InESCResult;
00014		TimeOutTime = 0;
00015		TimeOut = InTimeOut;
00016		FrameCount = 0;
00017	}
00018	
00019	function BeforePaint(Canvas C, float X, float Y)
00020	{
00021		local Region R;
00022	
00023		if(!bSetupSize)
00024		{
00025			SetSize(200, WinHeight);		
00026			R = LookAndFeel.FW_GetClientArea(Self);
00027			SetSize(200, (WinHeight - R.H) + UWindowMessageBoxCW(ClientArea).GetHeight(C));
00028			WinLeft = int((Root.WinWidth - WinWidth) / 2);
00029			WinTop = int((Root.WinHeight - WinHeight) / 2);
00030			bSetupSize = True;
00031		}
00032	
00033		Super.BeforePaint(C, X, Y);
00034	}
00035	
00036	function AfterPaint(Canvas C, float X, float Y)
00037	{
00038		Super.AfterPaint(C, X, Y);
00039	
00040		if(TimeOut != 0)
00041		{
00042			FrameCount++;
00043			
00044			if(FrameCount >= 5)
00045			{
00046				TimeOutTime = GetEntryLevel().TimeSeconds + TimeOut;
00047				TimeOut = 0;
00048			}
00049		}
00050	
00051		if(TimeOutTime != 0 && GetEntryLevel().TimeSeconds > TimeOutTime)
00052		{
00053			TimeOutTime = 0;
00054			Close();
00055		}
00056	}
00057	
00058	function Close(optional bool bByParent)
00059	{
00060		Super.Close(bByParent);
00061		OwnerWindow.MessageBoxDone(Self, Result);
00062	}
00063	
00064	defaultproperties
00065	{
00066	     ClientClass=Class'UWindow.UWindowMessageBoxCW'
00067	}

End Source Code