UBrowser
Class UBrowserIRCPageBase

source: e:\games\UnrealTournament\UBrowser\Classes\UBrowserIRCPageBase.uc
Core.Object
   |
   +--UWindow.UWindowBase
      |
      +--UWindow.UWindowWindow
         |
         +--UWindow.UWindowClientWindow
            |
            +--UWindow.UWindowDialogClientWindow
               |
               +--UWindow.UWindowPageWindow
                  |
                  +--UBrowser.UBrowserIRCPageBase
Direct Known Subclasses:UBrowserIRCChannelPage, UBrowserIRCPrivPage, UBrowserIRCSystemPage

class UBrowserIRCPageBase
extends UWindow.UWindowPageWindow


Variables
 UWindowEditControl EditControl
 string HasJoinedText
 string HasLeftText
 UWindowPulldownMenu Menu
 string NowKnownAsText
 string QuitText
 class RightClickMenuClass
 string SetsModeText
 UWindowDynamicTextArea TextArea
 string TextAreaClass
 string WasKickedByText


Function Summary
 void AddedText()
 void BeforePaint(Canvas C, float X, float Y)
 void Close(optional bool)
 void ClosePage()
 void Created()
 void Notify(UWindowDialogControl C, byte E)
 void Paint(Canvas C, float X, float Y)
 void ProcessInput(string Text)
 void RMouseUp(float X, float Y)
 void Setup()
 void WindowShown()



Source Code


00001	class UBrowserIRCPageBase expands UWindowPageWindow;
00002	
00003	var UWindowDynamicTextArea TextArea;
00004	var UWindowEditControl	EditControl;
00005	
00006	var config string TextAreaClass;
00007	
00008	var localized string HasLeftText;
00009	var localized string HasJoinedText;
00010	var localized string WasKickedByText;
00011	var localized string NowKnownAsText;
00012	var localized string QuitText;
00013	var localized string SetsModeText;
00014	
00015	var class<UWindowPulldownMenu> RightClickMenuClass;
00016	var UWindowPulldownMenu Menu;
00017	
00018	function Created()
00019	{
00020		local class<UWindowDynamicTextArea> TAClass;
00021	
00022		Super.Created();
00023	
00024		TAClass = class<UWindowDynamicTextArea>(DynamicLoadObject(TextAreaClass, class'Class'));
00025		if(TAClass == None)
00026			TAClass = class'UBrowserIRCTextArea';
00027	
00028		TextArea = UWindowDynamicTextArea(CreateControl(TAClass, 0, 0, WinWidth, WinHeight, Self));
00029		EditControl = UWindowEditControl(CreateControl(class'UWindowEditControl', 0, WinHeight-16, WinWidth, 16));
00030		EditControl.SetFont(F_Normal);
00031		EditControl.SetNumericOnly(False);
00032		EditControl.SetMaxLength(400);
00033		EditControl.SetHistory(True);
00034	}
00035	
00036	function Setup()
00037	{
00038		if(RightClickMenuClass != None)
00039		{
00040			Menu = UWindowPulldownMenu(Root.CreateWindow(RightClickMenuClass, 0, 0, 100, 100, Self));
00041			Menu.HideWindow();
00042		}
00043	}
00044	
00045	function RMouseUp(float X, float Y)
00046	{
00047		local float MenuX, MenuY;
00048		
00049		if(Menu != None)
00050		{
00051			WindowToGlobal(X, Y, MenuX, MenuY);
00052			Menu.WinLeft = MenuX;
00053			Menu.WinTop = MenuY;
00054			Menu.ShowWindow();
00055		}
00056	}
00057	
00058	function Close(optional bool bByParent)
00059	{
00060		Super.Close(bByParent);
00061	
00062		if(Menu != None && Menu.bWindowVisible)
00063			Menu.CloseUp();
00064	}
00065	
00066	function ClosePage()
00067	{
00068	}
00069	
00070	function WindowShown()
00071	{
00072		Super.WindowShown();
00073		OwnerTab.bFlash = False;
00074	}
00075	
00076	function AddedText()
00077	{
00078		if(!bWindowVisible)
00079			OwnerTab.bFlash = True;
00080		else
00081			OwnerTab.bFlash = False;
00082	}
00083	
00084	function BeforePaint(Canvas C, float X, float Y)
00085	{
00086		Super.BeforePaint(C, X, Y);
00087	
00088		EditControl.SetSize(WinWidth, 17);
00089		EditControl.WinLeft = 0;
00090		EditControl.WinTop = WinHeight - EditControl.WinHeight;
00091		EditControl.EditBoxWidth = WinWidth;
00092	
00093		TextArea.SetSize(WinWidth, WinHeight - EditControl.WinHeight);
00094	}
00095	
00096	function Paint(Canvas C, float X, float Y)
00097	{
00098		DrawStretchedTexture(C, 0, 0, WinWidth, WinHeight, Texture'BlackTexture');
00099	}
00100	
00101	function Notify(UWindowDialogControl C, byte E)
00102	{
00103		Super.Notify(C, E);
00104	
00105		switch(E)
00106		{
00107		case DE_EnterPressed:
00108			switch(C)
00109			{
00110			case EditControl:
00111				ProcessInput(EditControl.GetValue());
00112				EditControl.Clear();
00113				break;
00114			}
00115			break;
00116		case DE_WheelUpPressed:
00117			switch(C)
00118			{
00119			case EditControl:
00120				TextArea.VertSB.Scroll(-1);
00121				break;
00122			}
00123			break;
00124		case DE_WheelDownPressed:
00125			switch(C)
00126			{
00127			case EditControl:
00128				TextArea.VertSB.Scroll(1);
00129				break;
00130			}
00131			break;
00132		}
00133	}
00134	
00135	function ProcessInput(string Text);
00136	
00137	defaultproperties
00138	{
00139	     TextAreaClass="UBrowser.UBrowserIRCTextArea"
00140	     HasLeftText="has left"
00141	     HasJoinedText="has joined"
00142	     WasKickedByText="was kicked by"
00143	     NowKnownAsText="is now known as"
00144	     QuitText="Quit"
00145	     SetsModeText="sets mode"
00146	}

End Source Code