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 |
//----------------------------------------------------------- // ROGUIProportionalContainer // Class used to 'contain' other components. // This class differs from ROGuiContainer in that it uses // the contained control's scaling attributes. // emh -- 11/12/2005 //----------------------------------------------------------- class ROGUIProportionalContainer extends GUISectionBackground; var(Debug) bool bChangingPosValues; struct ComponentPosValues { var GUIComponent component; var float WinLeft, WinTop, WinWidth, WinHeight; }; var() array<ComponentPosValues> AlignOriginalValues; function bool ManageComponent(GUIComponent Component) { local bool result; result = super.ManageComponent(Component); InternalPreDraw(none); // This is used to position the controls before drawing them // (else you see the controls full screen for a split second, // which looks kinda odd) return result; } function bool InternalPreDraw(Canvas C) { local int i; local float AL, AT, AW, AH, LPad, RPad, TPad, BPad; local ComponentPosValues values; if ( AlignStack.Length == 0 ) return false; // for debug: let the user change the WinLeft, WinTop, etc values // when bChangingPosValues is set to true if (bChangingPosValues) { AlignOriginalValues.Length = 0; return false; } AL = ActualLeft(); AT = ActualTop(); AW = ActualWidth(); AH = ActualHeight(); LPad = (LeftPadding * AW) + ImageOffset[0]; TPad = (TopPadding * AH) + ImageOffset[1]; RPad = (RightPadding * AW) + ImageOffset[2]; BPad = (BottomPadding * AH) + ImageOffset[3]; if ( Style != none ) { LPad += BorderOffsets[0]; TPad += BorderOffsets[1]; RPad += BorderOffsets[2]; BPad += BorderOffsets[3]; } AL += LPad; AT += TPad; AW -= LPad + RPad; AH -= TPad + BPad; //log("InternalPreDraw called!"); //log("Actualleft = " $ AL); // ha, could this be any less efficient? for (i = 0; i < AlignStack.Length; i++) { values = getAlignOriginalValues(AlignStack[i]); AlignStack[i].WinLeft = RelativeLeft(values.WinLeft * AW + AL); AlignStack[i].WinTop = RelativeTop(values.WinTop * AH + AT); AlignStack[i].WinWidth = RelativeWidth(values.WinWidth * AW); AlignStack[i].WinHeight = RelativeHeight(values.WinHeight * AH); } return false; } function ComponentPosValues getAlignOriginalValues(GUIComponent component) { local ComponentPosValues values; local int i; // Search array to see if we can find the value in there for (i = 0; i < AlignOriginalValues.Length; i++) if (AlignOriginalValues[i].component == component) return AlignOriginalValues[i]; // Component not found in array, add original values to stack and return that values.component = component; values.WinLeft = component.WinLeft; values.WinTop = component.WinTop; values.WinWidth = component.WinWidth; values.WinHeight = component.WinHeight; AlignOriginalValues[AlignOriginalValues.length] = values; return values; } defaultproperties { } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |