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

XInterface.GUIButton


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
// ====================================================================
//  Class:  UT2K4UI.GUIButton
//
//	GUIButton - The basic button class
//
//  Written by Joe Wilcox
//  (c) 2002, Epic Games, Inc.  All Rights Reserved
// ====================================================================

class GUIButton extends GUIComponent
		Native;

cpptext
{
	void PreDraw(UCanvas* Canvas);
	void Draw(UCanvas* Canvas);
}

var()   eTextAlign					CaptionAlign;
var() editconst 	GUIStyles		CaptionEffectStyle;
var() 	string						CaptionEffectStyleName;
var()	localized	string			Caption;


var() struct native PaddingPercent
{ var() float HorzPerc, VertPerc; }  AutoSizePadding; // Padding (space) to insert around caption if autosizing

// When multiple buttons should be the same size, set this value to the longest caption of the group
// and all buttons will be sized using this caption instead
var()   string                      SizingCaption;
var()   bool						bAutoSize;	     // Size according to caption size.
var()   bool                        bAutoShrink;     // Reduce size of button if bAutoSize & caption is smaller than WinWidth
var()   bool                        bWrapCaption;    // Wrap the caption if its too long - ignored if bAutoSize = true
var()	bool						bUseCaptionHeight; // Get the Height from the caption


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

    if (CaptionEffectStyleName!="")
    	CaptionEffectStyle = Controller.GetStyle(CaptionEffectStyleName,x);

}

function bool InternalOnKeyEvent(out byte Key, out byte State, float delta)
{
	if ((key==0x0D || Key == 0x20) && State==1)	// ENTER or Space Pressed
	{
		OnClick(self);
		return true;
	}

	return false;
}

defaultproperties
{
	OnKeyEvent=InternalOnKeyEvent
	StyleName="SquareButton"
	bAcceptsInput=true
	bCaptureMouse=True
	bNeverFocus=false
	bTabStop=true
	WinHeight=0.04
	bMouseOverSound=true
	OnClickSound=CS_Click
    CaptionEffectStyleName=""
    CaptionAlign=TXTA_Center
    AutoSizePadding=(HorzPerc=0.125)
    StandardHeight=0.04
	bAutoShrink=true
    Begin Object Class=GUIToolTip Name=GUIButtonToolTip
    End Object
    ToolTip=GUIButtonToolTip
    bUseCaptionHeight=false
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Di 5.9.2006 22:36:28.000 - Creation time: Do 14.8.2014 09:58:39.850 - Created with UnCodeX