Core.Object | +--UWindow.UWindowBase | +--UWindow.UWindowWindow | +--UWindow.UWindowProgressBar
float
Percent
void
Paint(Canvas C, float X, float Y)
SetPercent(float NewPercent)
00001 class UWindowProgressBar extends UWindowWindow; 00002 00003 var float Percent; 00004 const BlockWidth=7; 00005 00006 function SetPercent(float NewPercent) 00007 { 00008 Percent = NewPercent; 00009 } 00010 00011 function Paint(Canvas C, float X, float Y) 00012 { 00013 local float BlockX, BlockW; 00014 00015 DrawMiscBevel( C, 0, 0, WinWidth, WinHeight, LookAndFeel.Misc, 2 ); 00016 00017 C.DrawColor.R = 192; 00018 C.DrawColor.G = 192; 00019 C.DrawColor.B = 192; 00020 00021 DrawStretchedTextureSegment( 00022 C, 00023 LookAndFeel.MiscBevelL[2].W, 00024 LookAndFeel.MiscBevelT[2].H, 00025 WinWidth - LookAndFeel.MiscBevelL[2].W - LookAndFeel.MiscBevelR[2].W, 00026 WinHeight - LookAndFeel.MiscBevelT[2].H - LookAndFeel.MiscBevelB[2].H, 00027 0, 00028 0, 00029 1, 00030 1, 00031 Texture'WhiteTexture' 00032 ); 00033 00034 C.DrawColor.R = 0; 00035 C.DrawColor.G = 0; 00036 C.DrawColor.B = 255; 00037 00038 BlockX = LookAndFeel.MiscBevelL[2].W + 1; 00039 while( BlockX < 1 + LookAndFeel.MiscBevelL[2].W + Percent * (WinWidth - LookAndFeel.MiscBevelL[2].W - LookAndFeel.MiscBevelR[2].W - 2) / 100) 00040 { 00041 BlockW = Min(BlockWidth, WinWidth - LookAndFeel.MiscBevelR[2].W - BlockX - 1); 00042 00043 00044 00045 DrawStretchedTextureSegment( 00046 C, 00047 BlockX, 00048 LookAndFeel.MiscBevelT[2].H + 1, 00049 BlockW, 00050 WinHeight - LookAndFeel.MiscBevelT[2].H - LookAndFeel.MiscBevelB[2].H - 1, 00051 0, 00052 0, 00053 1, 00054 1, 00055 Texture'WhiteTexture' 00056 ); 00057 00058 BlockX += BlockWidth + 1; 00059 } 00060 00061 C.DrawColor.R = 255; 00062 C.DrawColor.G = 255; 00063 C.DrawColor.B = 255; 00064 } 00065 00066 defaultproperties 00067 { 00068 }