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

GUI.GUIPage


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
// ====================================================================
//  Class:  GUI.GUIPage
//
//	GUIPages are the base for a full page menu.  They contain the
//	Control stack for the page.
//
//  Written by Joe Wilcox
//  (c) 2002, Epic Games, Inc.  All Rights Reserved
// ====================================================================
/*=============================================================================
	In Game GUI Editor System V1.0
	2003 - Irrational Games, LLC.
	* Dan Kaplan
=============================================================================*/
#if !IG_GUI_LAYOUT
#error This code requires IG_GUI_LAYOUT to be defined due to extensive revisions of the origional code. [DKaplan]
#endif
/*===========================================================================*/

class GUIPage extends GUIMultiComponent
        HideCategories(Menu,Object)
	Native;

cpptext
{
		UBOOL NativeKeyEvent(BYTE& iKey, BYTE& State, FLOAT Delta );
		void UpdateTimers(float DeltaTime);
		UBOOL MousePressed(UBOOL IsRepeat);					// The Mouse was pressed
		UBOOL MouseReleased();								// The Mouse was released

        UBOOL XControllerEvent(int Id, eXControllerCodes iCode);

}

// Variables
var(GUIPage) Editinline Editconst const	array<GUIComponent>		Timers "List of components with Active Timers if last on the stack.";
																			
var(GUIPage) config                      bool                    bIsOverlay "If true, underlaying components should remain active";
var(GUIPage) config                      bool                    bIsHUD "If true, underlaying systems should remain active for input (gui should not swallow invalid input)";

var(GUIPage) Editinline config GUILabel HelpText "The label that displays the hint for the watched component on this page";
#if IG_TRIBES3	// michaelj:  Allow subclasses to specify a different dialog class
var(GUIPage) config						string					DialogClassName;
#endif
// Delegates

delegate OnDlgReturned( int returnButton, optional string Passback );
delegate OnPopupReturned( GUIListElem returnObj, optional string Passback );

event Activate()
{
	EnableComponent();
	Super.Activate();
	Focus();
}

event DeActivate()
{
	DisableComponent();
	Super.DeActivate();
	if (!bPersistent)       // keep access to the controller if we are not up
	    Free();
}


event Show()
{
    if( Style != None )
        PlayerOwner().TriggerEffectEvent('UIMenuLoop',,,,,,,,Style.EffectCategory);
    Super.Show();
}

event Hide()
{
    if( Style != None )
        PlayerOwner().UnTriggerEffectEvent('UIMenuLoop');
    Super.Hide();
}

//=================================================
// InitComponent is responsible for initializing all components on the page.

function InitComponent(GUIComponent MyOwner)
{
	Super.InitComponent(MyOwner);
	
	MapControls();		// Figure out links
}

event ChangeHint(string NewHint)
{
    if( HelpText == None )
        return;
        
    HelpText.SetCaption( NewHint );
    HelpText.SetVisibility( !Controller.bDontDisplayHelpText && NewHint != "" );
}

event HandleParameters(string Param1, string Param2, optional int param3);	// Should be subclassed

event NotifyLevelChange();

event Free( optional bool bForce ) 			// This control is no longer needed
{
	local int i;
    for (i=0;i<Timers.Length;i++)
    	Timers[i]=None;
    Timers.Remove( 0, Timers.Length );
    
    HelpText=None;

    Super.Free( bForce );
}

#if IG_TRIBES3 // dbeswick: return Dialog object
final function GUIDlg OpenDlg( String Caption, optional int TheButtons, optional string Passback, optional int TimeOut )
#else
final function OpenDlg( String Caption, optional int TheButtons, optional string Passback, optional int TimeOut )
#endif
{
    local GUIDlg Dialog;
    local bool bProp;
    
    bProp=PropagateState;
	DisableComponent();
	PropagateState=bProp;
    
    Dialog = GUIDlg(AddComponent( DialogClassName, self.Name$"_"$Passback, true ));
    Dialog.SetupDlg( Caption, Passback, TheButtons, TimeOut );
    
    Dialog.Show();
    Dialog.Activate();

#if IG_TRIBES3 // dbeswick: return Dialog object
	return Dialog;
#endif
}

final function DlgReturned( GUIDlg Dialog )
{
    local bool bProp;
    
    Dialog.DeActivate();
    Dialog.Hide();
    
    bProp=PropagateState;
	EnableComponent();
	PropagateState=bProp;
	Focus();
    
    OnDlgReturned( Dialog.Selection, Dialog.Passback ); //call the delegate

#if !IG_TRIBES3 // dbeswick: moved this to fix assert
    //remove the dialog after it has been closed and processed
    RemoveComponent( Dialog );
#endif
}

#if IG_TRIBES3	// michaelj:  Added ability for GUIPages to respond to gameplay messages
function onGameplayMessage(Message msg)
{
}
#endif

#if IG_TRIBES3 // dbeswick: all download notification is done through the GUI system
function OnProgress(string Str1, string Str2)
{
}
#endif

defaultproperties
{
	bAcceptsInput=true
	bPersistent=true
    bTabStop=false
    bIsOverlay=true
	WinTop=0.0
	WinLeft=0.0
	WinWidth=1.0
	WinHeight=1.0
	bSwallowAllKeyEvents=True
	DialogClassName="GUI.GUIDlg"
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: ne 5.9.2004 16:02:10.000 - Creation time: st 23.5.2018 00:10:43.877 - Created with UnCodeX