Core.Object | +--UWindow.UWindowBase | +--UWindow.UWindowWindow | +--UWindow.UWindowClientWindow | +--UWindow.UWindowDialogClientWindow | +--UWindow.UWindowConsoleClientWindow
UWindowEditControl
EditControl
UWindowConsoleTextAreaControl
TextArea
void
BeforePaint(Canvas C, float X, float Y)
Created()
Notify(UWindowDialogControl C, byte E)
Paint(Canvas C, float X, float Y)
00001 class UWindowConsoleClientWindow extends UWindowDialogClientWindow; 00002 00003 var UWindowConsoleTextAreaControl TextArea; 00004 var UWindowEditControl EditControl; 00005 00006 function Created() 00007 { 00008 TextArea = UWindowConsoleTextAreaControl(CreateWindow(class'UWindowConsoleTextAreaControl', 0, 0, WinWidth, WinHeight)); 00009 EditControl = UWindowEditControl(CreateControl(class'UWindowEditControl', 0, WinHeight-16, WinWidth, 16)); 00010 EditControl.SetFont(F_Normal); 00011 EditControl.SetNumericOnly(False); 00012 EditControl.SetMaxLength(400); 00013 EditControl.SetHistory(True); 00014 } 00015 00016 function Notify(UWindowDialogControl C, byte E) 00017 { 00018 local string s; 00019 Super.Notify(C, E); 00020 00021 switch(E) 00022 { 00023 case DE_EnterPressed: 00024 switch(C) 00025 { 00026 case EditControl: 00027 if(EditControl.GetValue() != "") 00028 { 00029 s = EditControl.GetValue(); 00030 Root.Console.Message( None, "> "$s, 'Console' ); 00031 EditControl.Clear(); 00032 if( !Root.Console.ConsoleCommand( s ) ) 00033 Root.Console.Message( None, Localize("Errors","Exec","Core"), 'Console' ); 00034 } 00035 break; 00036 } 00037 break; 00038 case DE_WheelUpPressed: 00039 switch(C) 00040 { 00041 case EditControl: 00042 TextArea.VertSB.Scroll(-1); 00043 break; 00044 } 00045 break; 00046 case DE_WheelDownPressed: 00047 switch(C) 00048 { 00049 case EditControl: 00050 TextArea.VertSB.Scroll(1); 00051 break; 00052 } 00053 break; 00054 } 00055 } 00056 00057 function BeforePaint(Canvas C, float X, float Y) 00058 { 00059 Super.BeforePaint(C, X, Y); 00060 00061 EditControl.SetSize(WinWidth, 17); 00062 EditControl.WinLeft = 0; 00063 EditControl.WinTop = WinHeight - EditControl.WinHeight; 00064 EditControl.EditBoxWidth = WinWidth; 00065 00066 TextArea.SetSize(WinWidth, WinHeight - EditControl.WinHeight); 00067 } 00068 00069 function Paint(Canvas C, float X, float Y) 00070 { 00071 DrawStretchedTexture(C, 0, 0, WinWidth, WinHeight, Texture'BlackTexture'); 00072 } 00073 00074 defaultproperties 00075 { 00076 }