lotrointerface.com
Search Downloads

LoTROInterface SVN SequenceBars

[/] [trunk/] [Thurallor/] [SequenceBars/] [BarsGroupsTab.lua] - Blame information for rev 175

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 175 Thurallor-7095
BarsGroupsTab = class(Thurallor.UI.TabCard);
2 Thurallor-7095
 
3 Thurallor-7095
local function AddInstructions(panel, top, maxLines)
4 Thurallor-7095
    local label = Turbine.UI.Label();
5 Thurallor-7095
    label:SetParent(panel);
6 Thurallor-7095
    label:SetMultiline(true);
7 Thurallor-7095
    label:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft);
8 Thurallor-7095
    label:SetHeight(maxLines * 14);
9 Thurallor-7095
    label:SetFont(Turbine.UI.Lotro.Font.TrajanPro14);
10 Thurallor-7095
    label:SetForeColor(Turbine.UI.Color.PaleGoldenrod);
11 Thurallor-7095
    label:SetTop(top);
12 Thurallor-7095
    AddCallback(panel, "SizeChanged", function()
13 Thurallor-7095
        label:SetWidth(panel:GetWidth());
14 Thurallor-7095
    end);
15 Thurallor-7095
    return label, top + label:GetHeight();
16 Thurallor-7095
end
17 Thurallor-7095
 
18 Thurallor-7095
function BarsGroupsTab:Constructor(manager)
19 Thurallor-7095
    Thurallor.UI.TabCard.Constructor(self, false, true);
20 Thurallor-7095
    self.manager = manager;
21 Thurallor-7095
 
22 Thurallor-7095
    self.inside = Turbine.UI.Control();
23 Thurallor-7095
    self:SetInteriorControl(self.inside);
24 Thurallor-7095
    self:SetInteriorAlignment(Turbine.UI.ContentAlignment.TopLeft);
25 Thurallor-7095
 
26 Thurallor-7095
    local top = 0;
27 Thurallor-7095
    self.instructions, top = AddInstructions(self.inside, top, 2);
28 Thurallor-7095
    self:Redraw();
29 Thurallor-7095
end
30 Thurallor-7095
 
31 Thurallor-7095
function BarsGroupsTab:Localize()
32 Thurallor-7095
    self:SetTabText(L:GetText("/DirectoryWindow/BarHeading"));
33 Thurallor-7095
    self.instructions:SetText(L:GetText("/DirectoryWindow/BarInstructions"));
34 Thurallor-7095
    self:Redraw();
35 Thurallor-7095
end
36 Thurallor-7095
 
37 Thurallor-7095
function BarsGroupsTab:Redraw()
38 Thurallor-7095
    if (self.tree) then
39 Thurallor-7095
        self.tree:SetParent(nil);
40 Thurallor-7095
    end
41 Thurallor-7095
    self.tree = BarTreeControl(self.manager);
42 Thurallor-7095
    self.tree:SetParent(self.inside);
43 Thurallor-7095
    self.tree:SetPosition(0, self.instructions:GetHeight() + 2);
44 Thurallor-7095
    AddCallback(self.tree, "SizeChanged", function()
45 Thurallor-7095
        self:TreeSizeChanged();
46 Thurallor-7095
    end);
47 Thurallor-7095
    self:SetSize(self:GetSize());
48 Thurallor-7095
    self:TreeSizeChanged();
49 Thurallor-7095
end
50 Thurallor-7095
 
51 Thurallor-7095
function BarsGroupsTab:SetSize(width, height)
52 Thurallor-7095
    Thurallor.UI.TabCard.SetSize(self, width, height);
53 Thurallor-7095
    self.inside:SetWidth(width - 10);
54 Thurallor-7095
    self.tree:SetWidth(width - 16);
55 Thurallor-7095
end
56 Thurallor-7095
 
57 Thurallor-7095
function BarsGroupsTab:TreeSizeChanged()
58 Thurallor-7095
    local height = self.tree:GetTop() + self.tree:GetHeight();
59 Thurallor-7095
    self.inside:SetHeight(height);
60 Thurallor-7095
end

All times are GMT -5. The time now is 05:48 AM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui