/
if #Torta.db.profile.lists > 0 then |
local lists = Torta.db.profile.lists; |
FauxScrollFrame_Update(explorerScrollBar, #Torta.db.profile.lists, #self.exListButtons, 16, nil, nil, nil, nil, nil, nil, true) |
local loadedListID = Torta.db.profile.cfg.loadedList; |
for line = 1, #self.exListButtons do |
lineplusoffset = line + FauxScrollFrame_GetOffset(explorerScrollBar); |
button = self.exListButtons[line]; |
if not lists[lineplusoffset] then return end |
button:SetText(lists[lineplusoffset].meta.listName); |
button:SetID(lineplusoffset); |
if lineplusoffset ~= loadedListID then |
button:UnlockHighlight(); |
else |
button:LockHighlight(); |
end |
button:Show(); |
else |
button:Hide(); |
else |
self:RemoveCLButtons(numButtons - numButtonsCanFit); |
end |
end |
function Torta.gui:CreateCLButtons(num) |
button.text:SetText("|cffffd000" .. lineplusoffset .. ".)|r " .. self.data.text[lineplusoffset]); |
button.check:SetChecked(self.data.stat[lineplusoffset]); |
button:SetID(lineplusoffset); |
if lineplusoffset ~= Torta.cl3.openTask then |
button:UnlockHighlight(); |
else |
button:LockHighlight(); |
end |
button:Show(); |
else |
button:Hide(); |
FauxScrollFrame_OnVerticalScroll(self, offset, 32, Torta.gui.UpdateCLScrollBar); |
</OnVerticalScroll> |
<OnShow> |
-- Torta.gui:CheckCLButtons(); |
Torta.gui:CheckCLButtons(); |
Torta.gui:UpdateCLScrollBar(true); |
getglobal(self:GetName() .. "ScrollBar"):SetValue(0); |
</OnShow> |
<OnUpdate> |
Torta.gui:CheckCLButtons() |
Torta.gui:CheckCLButtons(); |
</OnUpdate> |
</Scripts> |
</ScrollFrame> |
<Scripts> |
<OnEscapePressed> |
self:ClearFocus(); |
if IsShiftKeyDown() then |
Torta.cl3:ModifyOpenTask( getglobal( self:GetParent():GetName() .. "EditBox" ):GetText() ); |
Torta.gui:UpdateCLScrollBar(); |
end |
</OnEscapePressed> |
<OnEnterPressed> |
self:ClearFocus(); |
<Button name="TortaChecklistTaskButton" inherits="TortaListboxButtonTemplate" virtual="true"> |
<Size y="32"/> |
<Layers> |
<Layer level="ARTWORK"> |
<FontString name="$parentText" inherits="TortaCLFontStringTemplate" nonSpaceWrap="true"> |
<Anchors> |
<Anchor point="LEFT" relativePoint="RIGHT"/> |
<Anchor point="RIGHT" relativeTo=""/> |
</Anchors> |
</FontString> |
</Layer> |
</Layers> |
<!-- LISTBUTTON SCRIPTS --> |
<Scripts> |
<OnClick> |
<!-- CHECKBUTTON SCRIPTS --> |
<Scripts> |
<OnLoad> |
local fs = self:CreateFontString(nil, "ARTWORK", "TortaCLFontStringTemplate"); |
fs:SetPoint("LEFT", self, "RIGHT", 3); |
fs:SetPoint("RIGHT", self:GetParent(), "RIGHT", -3); |
local fs = self:GetParent():CreateFontString(nil, "ARTWORK", "TortaCLFontStringTemplate"); |
fs:SetPoint("LEFT", self, "RIGHT"); |
fs:SetText("Hello, World!"); |
fs:SetJustifyH("LEFT"); |
fs:SetJustifyV("TOP"); |
fs:SetNonSpaceWrap(true); |
self:GetParent().text = fs; |
self:GetParent().check = self; |
</OnLoad> |
<OnUpdate> |
-- This is retardedly hackish, but the anchors trick doesnt work for some reason (WTF?!?!?!) |
-- This is roughly how Checklist2 does it. |
self:GetParent().text:SetWidth(self:GetParent():GetWidth() - 38); |
</OnUpdate> |
</Scripts> |
</CheckButton> |
</Frames> |
local parentWindow = self:GetParent(); |
parentWindow:StopMovingOrSizing(); |
parentWindow.isSizing = false; |
Torta.gui:CheckCLButtons(); |
Torta.gui:CheckExplorerWindow(); |
</OnMouseUp> |
</Scripts> |
<Layers> |
</Button> |
</Frames> |
<Scripts> |
<OnShow> |
Torta.gui:CheckExplorerWindow(); |
</OnShow> |
<OnUpdate> |
Torta.gui:CheckExplorerWindow(); |
if TortaParentFrame.isSizing then |
Torta.gui:CheckExplorerWindow(); |
end |
</OnUpdate> |
</Scripts> |
</Frame> |
Copyright (c) 2008, Lawrence Patrick Calulo |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
modification, are permitted provided that the following conditions |
are met: |
* Redistributions of source code must retain the above copyright |
notice, this list of conditions and the following disclaimer. |
* Redistributions in binary form must reproduce the above |
copyright notice, this list of conditions and the following |
disclaimer in the documentation and/or other materials provided |
with the distribution. |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
POSSIBILITY OF SUCH DAMAGE. |
widgets.cl3HeaderText:SetText("Torta Checklist"); |
gui:UpdateCLScrollBar(); |
Torta.db.profile.cfg.loadedList = false; |
self.openTask = nil; |
else |
-- Do the opposite! |
Torta.gui.data = lists[listID]; |
getglobal(widgets.clScrollBar:GetName() .. "ScrollBar"):SetValue(0); |
widgets.cl3HeaderText:SetText(lists[listID].meta.listName); |
Torta.db.profile.cfg.loadedList = listID; |
self.openTask = nil; |
gui:UpdateCLScrollBar(); |
end |
gui:UpdateExplorerScrollBar(); |
end |
self.openTask = taskID; |
widgets.editTaskEB:SetText(Torta.db.profile.lists[Torta.db.profile.cfg.loadedList].text[taskID]); |
end |
gui:UpdateCLScrollBar(); |
end |