Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

XInterface.GUISectionBackground


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
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
// ====================================================================
// (C) 2002, Epic Games
// ====================================================================

class GUISectionBackground extends GUIImage
    Native;

var(Style) editconst noexport GUIStyles CaptionStyle; // must have a CaptionStyle to be drawn
var(Style)  string      CaptionStyleName;
var(Style)  int         AltCaptionOffset[4];
var(Style)  eTextAlign  AltCaptionAlign;
var(Style)  bool        bAltCaption;
var()       bool        bRemapStack;                // When components are added to the alignment stack, they are inserted based on their tab order
var()       bool        bFillClient;                // Adjust WinHeight of components so that they fill the client area


var() editinlinenotify noexport array<GUIComponent> AlignStack;
var() material HeaderTop,HeaderBar,HeaderBase;      // Top, Bar and base

var() localized string    Caption;
var() float               ColPadding,               // Padding between columns
                          LeftPadding,
                          RightPadding,
                          TopPadding,
                          BottomPadding;            // range is 0 - 1.0
var() float               ImageOffset[4];
var() int                 NumColumns;               // Number of columns to divide the managed components into
var() int                 MaxPerColumn;             // Applicable only when NumColumns > 0

// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)
// (cpptext)

function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
    Super.InitComponent(MyController, MyOwner);

    if (CaptionStyleName!="")
        CaptionStyle = Controller.GetStyle(CaptionStyleName,FontScale);

}

event SetVisibility(bool bIsVisible)
{
    local int i;

    Super.SetVisibility(bIsVisible);

    for (i=0;i<AlignStack.Length;i++)
        AlignStack[i].SetVisibility(bIsVisible);
}


// Components that are manage by the section background are auto aligned and placed
function bool ManageComponent(GUIComponent Component)
{
    local int i;

    if ( Component == None )
        return false;

    i = FindComponentIndex(Component);
    if ( i == -1 )
    {
        if ( bRemapStack )
        {
            for (i=0;i<AlignStack.Length;i++)
            {
                if (AlignStack[i].TabOrder > Component.TabOrder)
                    break;
            }
        }
        else i = AlignStack.Length;

        AlignStack.Insert(i, 1);
        AlignStack[i]=Component;

        return true;
    }

    return false;
}

function bool UnmanageComponent( GUIComponent Comp )
{
    local int i;

    i = FindComponentIndex(Comp);
    if ( i != -1 && i >= 0 && i < AlignStack.Length )
    {
        AlignStack.Remove(i,1);
        return true;
    }

    return false;
}

function int FindComponentIndex( GUIComponent Comp )
{
    local int i;

    if ( Comp == None )
        return -1;

    for ( i = 0; i < AlignStack.Length; i++ )
        if ( AlignStack[i] == Comp )
            return i;

    return -1;
}

function Reset()
{
    AlignStack.Remove( 0, AlignStack.Length );
    bInit = true;
}

function bool InternalPreDraw(Canvas C)
{
    local float AL, AT, AW, AH, LPad, RPad, TPad, BPad;

    if ( AlignStack.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];
    }

    AutoPosition( AlignStack,
        AL, AT, AL + AW, AT + AH,
        LPad, TPad, RPad, BPad,
        NumColumns, ColPadding );

    return false;
}

event ResolutionChanged(int ResX, int ResY)
{
    Super.ResolutionChanged(ResX, ResY);
    bInit = True;
}

function SetPosition( float NewLeft, float NewTop, float NewWidth, float NewHeight, optional bool bRelative )
{
    Super.SetPosition(NewLeft,NewTop,NewWidth,NewHeight,bRelative);
    bInit = true;
}

defaultproperties
{
     CaptionStyleName="TextLabel"
     bRemapStack=Wahr
     HeaderTop=Texture'2K4Menus.NewControls.ComboTickFocused'
     HeaderBar=Texture'2K4Menus.NewControls.NewSliderBar'
     HeaderBase=Texture'2K4Menus.NewControls.Display98'
     ColPadding=0.050000
     LeftPadding=0.050000
     RightPadding=0.050000
     ImageOffset(0)=16.000000
     ImageOffset(1)=44.000000
     ImageOffset(2)=16.000000
     ImageOffset(3)=18.000000
     NumColumns=1
     FontScale=FNS_Small
     RenderWeight=0.090000
     OnPreDraw=GUISectionBackground.InternalPreDraw
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Fr 30.3.2007 08:43:46.000 - Creation time: Mo 16.4.2007 11:20:48.125 - Created with UnCodeX