/trunk
listName = "CL3 Test List" |
}, |
text = { |
[1] = "Hello, World!" |
[1] = "Hello, world from Lua!" |
}, |
stat = { |
[1] = true |
local clDisplayWindow = TortaParentFrameMainPageDisplaySubWindow; |
local clScrollBar = TortaParentFrameMainPageDisplaySubWindowScrollBar; |
local noLoadedListText = TortaParentFrameMainPageDisplaySubWindowNoLoadedListText; |
local noTasksText = TortaParentFrameMainPageDisplaySubWindowNoTasksText; |
local clTopButton = TortaParentFrameMainPageDisplaySubWindowTaskButton1; |
local cl3HeaderText = TortaParentFrameMainPageDisplaySubWindowHeaderText; |
local taskEditor = TortaParentFrameMainPageTaskEditorSubWindow; |
local EXPLORER_LISTBUTTON_HEIGHT = 16; |
local Torta = Torta; |
noLoadedListText:SetText("You currently do not have a list loaded. You can either select a list in Turtle Explorer or create a new one by clicking the Manage button."); |
noTasksText:SetText("The currently loaded list does not appear to have any tasks in it. You can create new tasks for this list by clicking the \"Add A Task\" button below."); |
-- Explorer subwindow stuff |
Torta.gui.exRecycleBin = {}; |
Torta.gui.exListButtons = { TortaParentFrameMainPageExplorerSubWindowListButton1 }; |
self = Torta.gui; |
local lineplusoffset; |
local button; |
noTasksText:Hide(); |
noLoadedListText:Hide(); |
if self.data then |
noLoadedListText:Hide(); |
FauxScrollFrame_Update(clScrollBar, #self.data.text, #self.clListButtons, 32, nil, nil, nil, nil, nil, nil, true) |
button:Hide(); |
end |
end |
if #self.data.text == 0 then |
noTasksText:Show(); |
clScrollBar:Hide() |
else |
noTasksText:Hide(); |
clScrollBar:Show(); |
end |
else |
noLoadedListText:Show(); |
clScrollBar:Hide(); |
-- print(offset, scrollBar:GetValue()); |
end |
-- Dropdown menu stuff |
local clExplorerDropdownInfo = { |
{ |
text = "Turtle Explorer", |
isTitle = true |
}, |
{ |
text = "Create a new list", |
func = function() Torta.cl3:CreateList(); end |
}, |
{ |
text = "", |
notClickable = true |
}, |
{ |
text = "Close", |
func = function() TortaDropDownMenuFrame:Hide(); end |
} |
} |
local clListDropdownInfo = { |
{ |
text = "<will get replaced by list name>", |
isTitle = true |
}, |
{ |
text = "Create a new list", |
func = function() Torta.cl3:CreateList(); end, |
}, |
{ |
text = "Rename this list", |
func = function() end |
}, |
{ |
text = "Delete this list", |
func = function() end |
}, |
{ |
text = "", |
notClickable = true |
}, |
{ |
text = "Close", |
func = function() TortaDropDownMenuFrame:Hide(); end |
} |
} |
local dropdown = CreateFrame("Frame", "TortaDropDownMenuFrame", explorerWindow, "UIDropDownMenuTemplate"); |
function Torta.gui:clShowButtonDropdown(button) |
assert(button); |
clListDropdownInfo[1].text = button:GetText(); |
EasyMenu(clListDropdownInfo, dropdown, "cursor", 0, 0, "MENU", 3); |
end |
function Torta.gui:clShowExplorerDropdownMenu() |
EasyMenu(clExplorerDropdownInfo, dropdown, "cursor", 0, 0, "MENU", 3); |
end |
FauxScrollFrame_SetOffset(explorerScrollBar, 0); |
FauxScrollFrame_SetOffset(clScrollBar, 0); |
<Button name="TortaExplorerButtonTemplate" inherits="TortaListboxButtonTemplate" virtual="true"> |
<Scripts> |
<OnClick> |
Torta.cl3:LoadList(self:GetID()); |
if button == "LeftButton" then |
Torta.cl3:LoadList(self:GetID()); |
else |
Torta.gui:clShowButtonDropdown(self); |
end |
</OnClick> |
<OnLoad> |
self:RegisterForClicks("LeftButtonDown", "RightButtonDown"); |
</OnLoad> |
</Scripts> |
</Button> |
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ |
..\FrameXML\UI.xsd"> |
<Frame name="$parentExplorerSubWindow" parent="TortaParentFrameMainPage" inherits="TortaSubWindowTemplate"> |
<Frame name="$parentExplorerSubWindow" parent="TortaParentFrameMainPage" enableMouse="true" inherits="TortaSubWindowTemplate"> |
<Anchors> |
<Anchor point="TOPLEFT"> |
<Offset y="-2"/> |
Torta.gui:CheckExplorerWindow(); |
end |
</OnUpdate> |
<OnMouseDown> |
if button == "RightButton" then |
Torta.gui:clShowExplorerDropdownMenu() |
end |
</OnMouseDown> |
</Scripts> |
</Frame> |
</Ui> |
</Anchors> |
<Layers> |
<Layer level="ARTWORK"> |
<FontString name="$parentHeaderText" inherits="GameFontNormal" text="List Name Goes Here - Torta Checklist"> |
<FontString name="$parentHeaderText" inherits="GameFontNormal" text="List Name Goes Here"> |
<Anchors> |
<Anchor point="LEFT" relativeTo="$parentHeaderTexture"/> |
<Anchor point="RIGHT" relativeTo="$parentHeaderTexture"/> |
</Anchors> |
</FontString> |
<FontString name="$parentNoLoadedListText" inherits="GameFontHighlight" text="You currently do not have a list loaded. You can either select a list in Turtle Explorer or create a new one by clicking the Manage button."> |
<FontString name="$parentNoLoadedListText" inherits="GameFontHighlight"> |
<Anchors> |
<Anchor point="LEFT"> |
<Offset x="30"/> |
<Anchor point="BOTTOM"/> |
</Anchors> |
</FontString> |
<FontString name="$parentNoTasksText" inherits="GameFontHighlight" hidden="true"> |
<Anchors> |
<Anchor point="LEFT"> |
<Offset x="30"/> |
</Anchor> |
<Anchor point="RIGHT"> |
<Offset x="-30"/> |
</Anchor> |
<Anchor point="TOP"/> |
<Anchor point="BOTTOM"/> |
</Anchors> |
</FontString> |
</Layer> |
</Layers> |
<Frames> |
Copyright (c) 2008, Lawrence Patrick Calulo |
Copyright (c) 2008, Lawrence Patrick Calulo (Quezacolt) |
All rights reserved. |
Redistribution and use in source and binary forms, with or without |
gui:UpdateCLScrollBar(); |
self:HideTaskEditor(); |
end |
function Checklist3:CreateList() |
tinsert(Torta.db.profile.lists, { |
meta = { |
listName = "New List" |
}, |
text = {}, |
stat = {} |
}); |
gui:UpdateExplorerScrollBar(); |
end |
function Checklist3:DeleteList(index) |
end |
function Checklist3:RestoreList() |
end |