UWindow
Class UWindowLabelControl

source: e:\games\UnrealTournament\UWindow\Classes\UWindowLabelControl.uc
Core.Object
   |
   +--UWindow.UWindowBase
      |
      +--UWindow.UWindowWindow
         |
         +--UWindow.UWindowDialogControl
            |
            +--UWindow.UWindowLabelControl
Direct Known Subclasses:UMenuLabelControl

class UWindowLabelControl
extends UWindow.UWindowDialogControl



Function Summary
 void BeforePaint(Canvas C, float X, float Y)
 void Created()
 void Paint(Canvas C, float X, float Y)



Source Code


00001	class UWindowLabelControl extends UWindowDialogControl;
00002	
00003	function Created()
00004	{
00005		TextX = 0;
00006		TextY = 0;
00007	}
00008	
00009	function BeforePaint(Canvas C, float X, float Y)
00010	{
00011		local float W, H;
00012		
00013		// Implemented in a child class
00014	
00015		Super.BeforePaint(C, X, Y);
00016		
00017		TextSize(C, Text, W, H);
00018		WinHeight = H+1;
00019		//WinWidth = W+1;
00020		TextY = (WinHeight - H) / 2;
00021		switch (Align)
00022		{
00023			case TA_Left:
00024				break;
00025			case TA_Center:
00026				TextX = (WinWidth - W)/2;
00027				break;
00028			case TA_Right:
00029				TextX = WinWidth - W;
00030				break;
00031		}	
00032	}
00033	
00034	function Paint(Canvas C, float X, float Y)
00035	{
00036		if(Text != "")
00037		{
00038			C.DrawColor = TextColor;
00039			C.Font = Root.Fonts[Font];
00040			ClipText(C, TextX, TextY, Text);
00041			C.DrawColor.R = 255;
00042			C.DrawColor.G = 255;
00043			C.DrawColor.B = 255;
00044		}
00045	}
00046	
00047	defaultproperties
00048	{
00049	}

End Source Code