lotrointerface.com
Search Downloads

LoTROInterface SVN SequenceBars

[/] [trunk/] [Thurallor/] [SequenceBars/] [BarsGroupsTab.lua] - Rev 175

Compare with Previous | Blame | View Log

BarsGroupsTab = class(Thurallor.UI.TabCard);

local function AddInstructions(panel, top, maxLines)
    local label = Turbine.UI.Label();
    label:SetParent(panel);
    label:SetMultiline(true);
    label:SetTextAlignment(Turbine.UI.ContentAlignment.MiddleLeft);
    label:SetHeight(maxLines * 14);
    label:SetFont(Turbine.UI.Lotro.Font.TrajanPro14);
    label:SetForeColor(Turbine.UI.Color.PaleGoldenrod);
    label:SetTop(top);
    AddCallback(panel, "SizeChanged", function()
        label:SetWidth(panel:GetWidth());
    end);
    return label, top + label:GetHeight();
end

function BarsGroupsTab:Constructor(manager)
    Thurallor.UI.TabCard.Constructor(self, false, true);
    self.manager = manager;
    
    self.inside = Turbine.UI.Control();
    self:SetInteriorControl(self.inside);
    self:SetInteriorAlignment(Turbine.UI.ContentAlignment.TopLeft);

    local top = 0;
    self.instructions, top = AddInstructions(self.inside, top, 2);
    self:Redraw();
end

function BarsGroupsTab:Localize()
    self:SetTabText(L:GetText("/DirectoryWindow/BarHeading"));
    self.instructions:SetText(L:GetText("/DirectoryWindow/BarInstructions"));
    self:Redraw();
end

function BarsGroupsTab:Redraw()
    if (self.tree) then
        self.tree:SetParent(nil);
    end
    self.tree = BarTreeControl(self.manager);
    self.tree:SetParent(self.inside);
    self.tree:SetPosition(0, self.instructions:GetHeight() + 2);
    AddCallback(self.tree, "SizeChanged", function()
        self:TreeSizeChanged();
    end);
    self:SetSize(self:GetSize());
    self:TreeSizeChanged();
end

function BarsGroupsTab:SetSize(width, height)
    Thurallor.UI.TabCard.SetSize(self, width, height);
    self.inside:SetWidth(width - 10);
    self.tree:SetWidth(width - 16);
end

function BarsGroupsTab:TreeSizeChanged()
    local height = self.tree:GetTop() + self.tree:GetHeight();
    self.inside:SetHeight(height);
end

Compare with Previous | Blame


All times are GMT -5. The time now is 07:41 AM.


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