Mercurial > wow > itemauditor
comparison Modules/Frames.lua @ 59:4ec321eb0dfe
Adding a crafing tab to the ItemAuditor window.
author | Asa Ayers <Asa.Ayers@Gmail.com> |
---|---|
date | Sun, 25 Jul 2010 15:51:13 -0700 |
parents | bdf3aba93aa9 |
children | e7d287cc3b02 |
comparison
equal
deleted
inserted
replaced
58:bdf3aba93aa9 | 59:4ec321eb0dfe |
---|---|
3 | 3 |
4 local AceGUI = LibStub("AceGUI-3.0") | 4 local AceGUI = LibStub("AceGUI-3.0") |
5 | 5 |
6 local tabs = {} | 6 local tabs = {} |
7 | 7 |
8 function addon:RegisterTab(text, value, width, callback) | 8 function addon:RegisterTab(text, value, callback) |
9 tabs[value] = {text=text, callback=callback, width=width} | 9 tabs[value] = {text=text, callback=callback} |
10 end | 10 end |
11 | 11 |
12 local displayFrame = false | 12 local displayFrame = false |
13 local currentContent = false | 13 local currentContent = false |
14 local function switchTab(container, event, group) | 14 local function switchTab(container, event, group) |
23 currentContent:Hide() | 23 currentContent:Hide() |
24 if displayFrame then | 24 if displayFrame then |
25 displayFrame:SetStatusText('') | 25 displayFrame:SetStatusText('') |
26 end | 26 end |
27 end | 27 end |
28 | 28 |
29 currentContent = cb(container) | 29 currentContent = cb(container) |
30 end | 30 end |
31 | 31 |
32 | 32 |
33 function addon:CreateFrame(selectedTab) | 33 function addon:CreateFrame(selectedTab) |
34 --@debug@ | 34 |
35 -- This is here so I can verify that all of the callbacks and tab switching works. | |
36 -- The real crafting tab will become its own module. | |
37 -- addon:RegisterTab('Placeholder Crafting', 'tab_crafting', 400, function() addon:Print('crafting') end) | |
38 --@end-debug@ | |
39 | |
40 if not displayFrame then | 35 if not displayFrame then |
41 -- Create the frame container | 36 -- Create the frame container |
42 displayFrame = AceGUI:Create("Frame") | 37 displayFrame = AceGUI:Create("Frame") |
43 ItemAuditor:RegisterFrame(displayFrame) | 38 ItemAuditor:RegisterFrame(displayFrame) |
44 local window = displayFrame.frame; | 39 local window = displayFrame.frame; |