WoWInterface SVN Torta

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 26 to Rev 27
    Reverse comparison

Rev 26 → Rev 27

Torta/UIManager.lua
265,18 → 265,31
end
 
 
function Torta.gui:IsTaskVisible(id)
for k,button in pairs(self.clListButtons) do
if button:GetID() == id then
return true;
end
end
return false;
end
 
 
function Torta.gui:MakeTaskVisible(taskID)
--[[
local offset = FauxScrollFrame_GetOffset(clScrollBar);
local iMax = FauxScrollFrame_GetOffset(clScrollBar) + #self.clListButtons;
 
if (iMax - 3) < taskID then
FauxScrollFrame_SetOffset(clScrollBar, offset + 3);
-- getglobal(clScrollBar:GetName() .. "ScrollBar"):SetValue(offset + 3);
assert(type(taskID) == "number", "Assertion failed: method MakeTaskVisible requires a number parameter (taskID)");
local scrollBar = getglobal(clScrollBar:GetName() .. "ScrollBar");
local offset = FauxScrollFrame_GetOffset(clScrollBar) + 1;
for i = 1, 1000 do -- just so we don't go into an infinite loop
if self:IsTaskVisible(taskID) then break; end
-- scrollBar:SetValue(scrollBar:GetValue() + 1);
offset = offset + 1
FauxScrollFrame_SetOffset(clScrollBar, offset);
FauxScrollFrame_Update(clScrollBar, #self.data.text, #self.clListButtons, 32, nil, nil, nil, nil, nil, nil, true)
self:CheckCLButtons();
self:UpdateCLScrollBar();
end
print(FauxScrollFrame_GetOffset(clScrollBar), iMax);
]]
scrollBar:SetValue(floor(offset * 32 + 0.5));
print(offset, scrollBar:GetValue());
end
 
FauxScrollFrame_SetOffset(explorerScrollBar, 0);
Torta/CL3.lua
108,7 → 108,7
dispWnd:SetPoint("BOTTOMRIGHT", tEditor, "TOPRIGHT");
getglobal(tEditor:GetName() .. "HeaderText"):SetText("Task Editor: " .. (taskID or "|cffff0000No task ID|r"))
widgets.removeTaskButton:Enable();
gui:UpdateCLScrollBar();
gui:CheckCLButtons();
gui:MakeTaskVisible(taskID);
gui:UpdateCLScrollBar();
end