Core.Object | +--UWindow.UWindowBase | +--UWindow.UWindowWindow | +--UWindow.UWindowDialogControl | +--UWindow.UWindowButton | +--UTMenu.NotifyButton
LabelWidth,
LabelHeight
font
MyFont
NotifyWindow
Texture
OtherTexture
string
Text
color
TextColor
float
XOffset
bool
bDontSetLabel
bLeftJustify
void
BeforePaint(Canvas C, float X, float Y)
CheckMousePassThrough(float X, float Y)
Notify(byte E)
Paint(Canvas C, float X, float Y)
SetColorFont(Font NewFont)
SetTextColor(color NewColor)
00001 class NotifyButton extends UWindowButton; 00002 00003 var NotifyWindow NotifyWindow; 00004 00005 var font MyFont; 00006 var color TextColor; 00007 00008 var string Text; 00009 00010 var bool bDontSetLabel; 00011 var float LabelWidth, LabelHeight; 00012 00013 var bool bLeftJustify; 00014 var float XOffset; 00015 00016 var texture OtherTexture; 00017 00018 function SetColorFont(Font NewFont) 00019 { 00020 MyFont = NewFont; 00021 } 00022 00023 function bool CheckMousePassThrough(float X, float Y) 00024 { 00025 if ((X > LabelWidth) && (LabelWidth != 0)) 00026 return true; 00027 if ((Y > LabelHeight) && (LabelHeight != 0)) 00028 return true; 00029 00030 return false; 00031 } 00032 00033 function BeforePaint(Canvas C, float X, float Y) 00034 { 00035 } 00036 00037 function Paint(Canvas C, float X, float Y) 00038 { 00039 local float Wx, Hy; 00040 local int W, H; 00041 00042 Super.Paint(C, X, Y); 00043 00044 W = WinWidth / 4; 00045 H = W; 00046 00047 if(W > 256 || H > 256) 00048 { 00049 W = 256; 00050 H = 256; 00051 } 00052 00053 if (bDontSetLabel) 00054 { 00055 if (LabelWidth == 0) 00056 LabelWidth = WinWidth; 00057 if (LabelHeight == 0) 00058 LabelHeight = WinHeight; 00059 } else { 00060 LabelWidth = WinWidth; 00061 LabelHeight = WinHeight; 00062 } 00063 00064 C.DrawColor = TextColor; 00065 C.Font = MyFont; 00066 TextSize(C, Text, Wx, Hy); 00067 if (bLeftJustify) 00068 ClipText(C, XOffset, 0, Text); 00069 else 00070 ClipText(C, (LabelWidth - Wx)/2, (LabelHeight - Hy)/2, Text); 00071 } 00072 00073 00074 function SetTextColor(color NewColor) 00075 { 00076 TextColor = NewColor; 00077 } 00078 00079 function Notify(byte E) 00080 { 00081 NotifyWindow.Notify(Self, E); 00082 } 00083 00084 defaultproperties 00085 { 00086 bIgnoreLDoubleClick=False 00087 }