vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 --$Id: cf-gui.lua 2106 2006-05-24 03:47:06Z kaelten $
2 local locals = KC_ET_LOCALS
3 local tablet = TabletLib:GetInstance('1.0')
4  
5 KC_EnhancedTrades.cf = {}
6 local cf = KC_EnhancedTrades.cf
7  
8 cf.frame = AceGUI:new()
9  
10 cf.config = {
11 name = "CF_",
12 elements = {
13 ClearButton = {
14 type = ACEGUI_BUTTON,
15 title = "Clear Cache",
16 disabled = FALSE,
17 OnClick = "ClearClick",
18 width = 120,
19 height = 22,
20 anchors = {
21 right = {
22 relTo = "CF_OptionsButton",
23 relPoint = "left",
24 xOffset = 5,
25 yOffset = 0,
26 }
27 },
28 },
29 OptionsButton = {
30 type = ACEGUI_BUTTON,
31 title = "Craft Option",
32 disabled = FALSE,
33 OnClick = "OptionsClick",
34 width = 135,
35 height = 22,
36 anchors = {
37 bottomright = {
38 relTo = "CraftCancelButton",
39 relPoint = "topleft",
40 xOffset = 0,
41 yOffset = 1,
42 }
43 },
44 },
45 },
46 }
47  
48 function cf.frame:SetParents()
49 CF_ClearButton:RegisterForClicks("LeftButtonDown", "RightButtonDown")
50 CF_ClearButton:SetParent("CraftFrame")
51 CF_OptionsButton:SetParent("CraftFrame")
52  
53 tablet:Register(CF_ClearButton, 'children', function() tablet:SetTitle("Clear Cache") tablet:SetHint("Left-Click to clear cache for the item.\nRight-Click to clear entire cache.") end, 'data', {}, 'point', function() return "TOPLEFT", "TOPRIGHT" end)
54 tablet:Register(CF_OptionsButton, 'children', function() tablet:SetTitle("Options") tablet:SetHint("Opens the options frame.") end, 'data', {}, 'point', function() return "TOPLEFT", "TOPRIGHT" end)
55 end
56  
57 function cf.frame:ClearClick()
58 if (arg1 == "LeftButton") then
59 local skillName = GetCraftInfo(self.app.cfid)
60 self.app.cache[skillName] = nil
61 self.app:Msg(format("The Datacache for \"%s\" has been purged.", skillName))
62 elseif (arg1 == "RightButton") then
63 self.app.cache = nil
64 self.app:Msg("The complete Datacache has been purged.")
65 end
66  
67 self.app:Update(true)
68 end
69  
70 function cf.frame:OptionsClick()
71 self.app.opt.frame:Initialize(self.app, self.app.opt.config)
72 self.app.opt.frame:Show()
73 end