Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 00064 00065 00066 00067 00068 00069 00070 00071 00072 00073 00074 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 00087 00088 00089 00090 00091 00092 00093 00094 00095 00096 00097 00098 00099 00100 00101 00102 00103 00104 00105 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115 00116 00117 00118 00119 00120 00121 00122 00123 00124 00125 00126 00127 00128 00129 00130 00131 00132 00133 00134 00135 00136 00137 00138 00139 00140 00141 00142 00143 00144 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168 00169 00170 00171 00172 00173 00174 |
/** * Temporary widget for representing the region that displays the text currently being typed into the console * * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved. */ class ConsoleEntry extends UIObject native(UIPrivate) notplaceable; // notplaceable until I can resolve the circular docking relationship between the input box and the console prompt label /** displays the text that is currently being typed */ var UILabel ConsolePromptLabel; var UIImage ConsolePromptBackground; var UIEditBox InputBox; var UIImage LowerConsoleBorder; var UIImage UpperConsoleBorder; /** the current position of the cursor in InputBox's string */ var transient int CursorPosition; /** controls whether the underline cursor is rendered */ var() bool bRenderCursor; const ConsolePromptText = "(> "; // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) // (cpptext) event AddedChild( UIScreenObject WidgetOwner, UIObject NewChild ) { Super.AddedChild(WidgetOwner, NewChild); // if (InputText == None && UILabel(NewChild) != None ) // { // InputText = UILabel(NewChild); // InputText.IgnoreMarkup(true); // SetValue(""); // } // else if ( InputBox == None && UIEditBox(NewChild) != None ) // { // InputBox = UIEditBox(NewChild); // InputBox.IgnoreMarkup(true); // SetValue(""); // } } /** * Called immediately after a child has been removed from this screen object. Clears the NotifyPositionChanged delegate in the removed child * * @param WidgetOwner the screen object that the widget was removed from. * @param OldChild the widget that was removed * @param ExclusionSet used to indicate that multiple widgets are being removed in one batch; useful for preventing references * between the widgets being removed from being severed. * NOTE: If a value is specified, OldChild will ALWAYS be part of the ExclusionSet, since it is being removed. */ event RemovedChild( UIScreenObject WidgetOwner, UIObject OldChild, optional array<UIObject> ExclusionSet ) { Super.RemovedChild(WidgetOwner, OldChild, ExclusionSet); // if ( InputText == OldChild ) // { // InputText = None; // } // else if ( InputBox == OldChild ) // { // InputBox = None; // } } event PostInitialize() { Super.PostInitialize(); // setup docking links SetupDockingLinks(); // InputText = UILabel(FindChild('InputText')); // if ( InputText != None ) // { // InputText.IgnoreMarkup(true); // SetValue(""); // } // else // { // InputBox = UIEditBox(FindChild('InputBox')); // if ( InputBox != None ) // { // InputBox.IgnoreMarkup(true); // SetValue(""); // } // } } function SetupDockingLinks() { // set our own dock targets. // SetDockTarget(UIFACE_Top, UpperConsoleBorder, UIFACE_Top); SetDockTarget(UIFACE_Bottom, GetScene(), UIFACE_Bottom); // set the docktargets for the input box InputBox.SetDockTarget(UIFACE_Left, ConsolePromptLabel, UIFACE_Right); InputBox.SetDockTarget(UIFACE_Right, Self, UIFACE_Right); InputBox.SetDockTarget(UIFACE_Bottom, LowerConsoleBorder, UIFACE_Top); // console prompt background ConsolePromptBackground.SetDockTarget(UIFACE_Left, ConsolePromptLabel, UIFACE_Left); ConsolePromptBackground.SetDockTarget(UIFACE_Top, ConsolePromptLabel, UIFACE_Top); ConsolePromptBackground.SetDockTarget(UIFACE_Right, ConsolePromptLabel, UIFACE_Right); ConsolePromptBackground.SetDockTarget(UIFACE_Bottom, ConsolePromptLabel, UIFACE_Bottom); // console prompt ConsolePromptLabel.SetDockTarget(UIFACE_Left, Self, UIFACE_Left); ConsolePromptLabel.SetDockTarget(UIFACE_Top, InputBox, UIFACE_Top); ConsolePromptLabel.SetDockTarget(UIFACE_Bottom, InputBox, UIFACE_Bottom); // border images LowerConsoleBorder.SetDockParameters(UIFACE_Top, Self, UIFACE_Bottom, -2.f); LowerConsoleBorder.SetDockTarget(UIFACE_Bottom, Self, UIFACE_Bottom); UpperConsoleBorder.SetDockParameters(UIFACE_Top, InputBox, UIFACE_Top, -2.f); UpperConsoleBorder.SetDockTarget(UIFACE_Bottom, InputBox, UIFACE_Top); } function SetValue( string NewValue ) { if ( InputBox != None ) { InputBox.SetValue(NewValue); } } defaultproperties { ConsolePromptLabel=UILabel'Engine.Default__ConsoleEntry:ConsolePromptTemplate' ConsolePromptBackground=UIImage'Engine.Default__ConsoleEntry:ConsolePromptBackgroundTemplate' InputBox=UIEditBox'Engine.Default__ConsoleEntry:InputBoxTemplate' LowerConsoleBorder=UIImage'Engine.Default__ConsoleEntry:LowerConsoleBorderTemplate' UpperConsoleBorder=UIImage'Engine.Default__ConsoleEntry:UpperConsoleBorderTemplate' WidgetTag="ConsoleEntry" PrimaryStyle=(DefaultStyleTag="ConsoleStyle") bSupportsPrimaryStyle=False Children(0)=UIEditBox'Engine.Default__ConsoleEntry:InputBoxTemplate' Children(1)=UIImage'Engine.Default__ConsoleEntry:ConsolePromptBackgroundTemplate' Children(2)=UILabel'Engine.Default__ConsoleEntry:ConsolePromptTemplate' Children(3)=UIImage'Engine.Default__ConsoleEntry:LowerConsoleBorderTemplate' Children(4)=UIImage'Engine.Default__ConsoleEntry:UpperConsoleBorderTemplate' DefaultStates(2)=Class'Engine.UIState_Focused' Begin Object Class=UIComp_Event Name=WidgetEventComponent ObjName=WidgetEventComponent Archetype=UIComp_Event'Engine.Default__UIObject:WidgetEventComponent' ObjectArchetype=UIComp_Event'Engine.Default__UIObject:WidgetEventComponent' End Object EventProvider=WidgetEventComponent Name="Default__ConsoleEntry" ObjectArchetype=UIObject'Engine.Default__UIObject' } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |