Core.Object | +--UWindow.UWindowBase | +--UWindow.UWindowWindow | +--UWindow.UWindowGrid | +--UBrowser.UBrowserRulesGrid
string
RuleText
ValueText
void
Created()
PaintColumn(Canvas C, UWindowGridColumn Column, float MouseX, float MouseY)
RightClickRow(int Row, float X, float Y)
SelectRow(int Row)
SortColumn(UWindowGridColumn Column)
00001 //============================================================================= 00002 // UBrowserRulesGrid 00003 //============================================================================= 00004 class UBrowserRulesGrid extends UWindowGrid; 00005 00006 var localized string RuleText; 00007 var localized string ValueText; 00008 00009 function Created() 00010 { 00011 Super.Created(); 00012 00013 RowHeight = 12; 00014 00015 AddColumn(RuleText, 150); 00016 AddColumn(ValueText, 150); 00017 } 00018 00019 function PaintColumn(Canvas C, UWindowGridColumn Column, float MouseX, float MouseY) 00020 { 00021 local UBrowserServerList Server; 00022 local UBrowserRulesList RulesList, l; 00023 local int Visible; 00024 local int Count; 00025 local int Skipped; 00026 local int Y; 00027 local int TopMargin; 00028 local int BottomMargin; 00029 00030 if(bShowHorizSB) 00031 BottomMargin = LookAndFeel.Size_ScrollbarWidth; 00032 else 00033 BottomMargin = 0; 00034 00035 TopMargin = LookAndFeel.ColumnHeadingHeight; 00036 00037 Server = UBrowserInfoClientWindow(GetParent(class'UBrowserInfoClientWindow')).Server; 00038 if(Server == None) 00039 return; 00040 RulesList = Server.RulesList; 00041 if(RulesList == None) 00042 return; 00043 Count = RulesList.Count(); 00044 00045 C.Font = Root.Fonts[F_Normal]; 00046 Visible = int((WinHeight - (TopMargin + BottomMargin))/RowHeight); 00047 00048 VertSB.SetRange(0, Count+1, Visible); 00049 TopRow = VertSB.Pos; 00050 00051 Skipped = 0; 00052 00053 Y = 1; 00054 l = UBrowserRulesList(RulesList.Next); 00055 while((Y < RowHeight + WinHeight - RowHeight - (TopMargin + BottomMargin)) && (l != None)) 00056 { 00057 if(Skipped >= VertSB.Pos) 00058 { 00059 switch(Column.ColumnNum) 00060 { 00061 case 0: 00062 Column.ClipText( C, 2, Y + TopMargin, l.Rule ); 00063 break; 00064 case 1: 00065 Column.ClipText( C, 2, Y + TopMargin, l.Value ); 00066 break; 00067 } 00068 00069 Y = Y + RowHeight; 00070 } 00071 Skipped ++; 00072 l = UBrowserRulesList(l.Next); 00073 } 00074 } 00075 00076 function RightClickRow(int Row, float X, float Y) 00077 { 00078 local UBrowserInfoMenu Menu; 00079 local float MenuX, MenuY; 00080 local UWindowWindow W; 00081 00082 W = GetParent(class'UBrowserInfoWindow'); 00083 if(W == None) 00084 return; 00085 Menu = UBrowserInfoWindow(W).Menu; 00086 00087 WindowToGlobal(X, Y, MenuX, MenuY); 00088 Menu.WinLeft = MenuX; 00089 Menu.WinTop = MenuY; 00090 00091 Menu.ShowWindow(); 00092 } 00093 00094 function SortColumn(UWindowGridColumn Column) 00095 { 00096 UBrowserInfoClientWindow(GetParent(class'UBrowserInfoClientWindow')).Server.RulesList.SortByColumn(Column.ColumnNum); 00097 } 00098 00099 function SelectRow(int Row) 00100 { 00101 } 00102 00103 defaultproperties 00104 { 00105 RuleText="Rule" 00106 ValueText="Value" 00107 bNoKeyboard=True 00108 }