WoWInterface SVN Torta

Compare Revisions

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

Rev 25 → Rev 26

trunk/Torta/UIManager.lua
25,11 → 25,6
Torta.gui.clRecycleBin = {};
Torta.gui.clListButtons = { TortaParentFrameMainPageDisplaySubWindowTaskButton1 };
 
Torta.gui.data = {};
for i = 1, 100 do
Torta.gui.data[i] = "Item " .. i;
end
 
----------------------------------------------------------------------------------------
Torta.gui.elements = {};
local e = Torta.gui.elements;
229,7 → 224,6
lineplusoffset = line + FauxScrollFrame_GetOffset(clScrollBar);
button = self.clListButtons[line];
if lineplusoffset <= #self.data.text then
-- button.text:SetText("|cffffd000" .. lineplusoffset .. ".)|r " .. self.data.text[lineplusoffset]);
button.text:SetFormattedText("|cffffd000%i.)|r %s", lineplusoffset, self.data.text[lineplusoffset]);
button.check:SetChecked(self.data.stat[lineplusoffset]);
button:SetID(lineplusoffset);
270,6 → 264,21
clDisplayWindow:Show();
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);
self:UpdateCLScrollBar();
end
print(FauxScrollFrame_GetOffset(clScrollBar), iMax);
]]
end
 
FauxScrollFrame_SetOffset(explorerScrollBar, 0);
FauxScrollFrame_SetOffset(clScrollBar, 0);
 
trunk/Torta/Windows/Taskbar.xml
63,12 → 63,22
<Anchors>
<Anchor point="LEFT" relativeTo="$parentCheckAllButton" relativePoint="RIGHT"/>
</Anchors>
<Scripts>
<OnClick>
Torta.cl3:AddTask();
</OnClick>
</Scripts>
</Button>
<Button name="$parentRemoveTaskButton" inherits="UIPanelButtonTemplate" text="Remove Task">
<Size x="100" y="22"/>
<Anchors>
<Anchor point="LEFT" relativeTo="$parentAddTaskButton" relativePoint="RIGHT"/>
</Anchors>
<Scripts>
<OnClick>
Torta.cl3:RemoveTask();
</OnClick>
</Scripts>
</Button>
<Button name="$parentCloseButton" inherits="UIPanelButtonTemplate" text="Close">
<Size x="100" y="22"/>
trunk/Torta/Windows/DisplayWindow.xml
114,7 → 114,7
</OnClick>
</Scripts>
</Button>
<Button name="$parentEnterButton" inherits="UIPanelButtonTemplate" text="Save Task Text">
<Button name="$parentEnterButton" inherits="UIPanelButtonTemplate" text="Save And Close">
<Size x="125" y="23"/>
<Anchors>
<Anchor point="RIGHT" relativeTo="$parentCloseButton" relativePoint="LEFT"/>
124,6 → 124,7
Torta.cl3:ModifyOpenTask(Torta.gui.elements.editTaskEB:GetText());
Torta.gui.elements.editTaskEB:ClearFocus();
Torta.gui:UpdateCLScrollBar();
Torta.cl3:HideTaskEditor();
</OnClick>
</Scripts>
</Button>
196,6 → 197,7
if IsShiftKeyDown() then
Torta.cl3:ModifyOpenTask( getglobal( self:GetParent():GetName() .. "EditBox" ):GetText() );
Torta.gui:UpdateCLScrollBar();
Torta.cl3:HideTaskEditor();
end
</OnEscapePressed>
<OnEnterPressed>
trunk/Torta/Windows/Templates.xml
58,7 → 58,7
-- Override the one in CharacterFrameTabButtonTemplate
</OnShow>
<OnLoad>
PanelTemplates_TabResize(self, 3);
PanelTemplates_TabResize(self, 0);
</OnLoad>
</Scripts>
</Button>
102,6 → 102,12
<OnClick>
Torta.cl3:EditTask(self:GetID());
</OnClick>
<OnDragStart>
 
</OnDragStart>
<OnDragStop>
 
</OnDragStop>
</Scripts>
<Frames>
<CheckButton name="$parentCheckButton" inherits="UICheckButtonTemplate">
trunk/Torta/CL3.lua
13,7 → 13,9
else
self:LoadList(nil)
end
 
self:ListLoadedCheck();
 
if not self:IsEditTaskDialogOpen() then
widgets.removeTaskButton:Disable();
end
70,7 → 72,7
-- open the task editor
self:ShowTaskEditor(taskID);
self.openTask = taskID;
widgets.editTaskEB:SetText(Torta.db.profile.lists[Torta.db.profile.cfg.loadedList].text[taskID]);
widgets.editTaskEB:SetText(self:GetLoadedList().text[taskID]);
end
gui:UpdateCLScrollBar();
end
84,7 → 86,7
function Checklist3:ModifyOpenTask(newText)
assert(type(self.openTask) == "number");
local profile = Torta.db.profile;
profile.lists[profile.cfg.loadedList].text[self.openTask] = newText;
self:GetLoadedList().text[self.openTask] = newText;
end
 
 
95,6 → 97,7
tEditor:Hide();
self.openTask = nil;
widgets.removeTaskButton:Disable();
gui:UpdateCLScrollBar();
end
 
 
105,6 → 108,9
dispWnd:SetPoint("BOTTOMRIGHT", tEditor, "TOPRIGHT");
getglobal(tEditor:GetName() .. "HeaderText"):SetText("Task Editor: " .. (taskID or "|cffff0000No task ID|r"))
widgets.removeTaskButton:Enable();
gui:UpdateCLScrollBar();
gui:MakeTaskVisible(taskID);
gui:UpdateCLScrollBar();
end
 
 
126,10 → 132,31
 
 
function Checklist3:OnCheckClicked(id)
local list = self:GetLoadedList()
local list = self:GetLoadedList();
if list then
list.stat[id] = not list.stat[id];
end
gui:UpdateCLScrollBar();
end
 
 
function Checklist3:AddTask()
local list = self:GetLoadedList();
if not list then return end
 
local index = (self.openTask or #list.text) + 1;
tinsert(list.text, index, "");
tinsert(list.stat, index, false);
gui:UpdateCLScrollBar();
 
end
 
function Checklist3:RemoveTask()
local list = self:GetLoadedList();
if not list then return end
 
tremove(list.text, self.openTask);
tremove(list.stat, self.openTask);
gui:UpdateCLScrollBar();
self:HideTaskEditor();
end