comparison Libs/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua @ 0:169f5211fc7f

First public revision. At this point ItemAuditor watches mail for auctions sold or purchased, watches for buy/sell (money and 1 item type change) and conversions/tradeskills. Milling isn't working yet because there is too much time between the first event and the last event.
author Asa Ayers <Asa.Ayers@Gmail.com>
date Thu, 20 May 2010 19:22:19 -0700
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:169f5211fc7f
1 local AceGUI = LibStub("AceGUI-3.0")
2
3 -- WoW APIs
4 local CreateFrame, UIParent = CreateFrame, UIParent
5
6 --------------------------
7 -- Heading --
8 --------------------------
9 do
10 local Type = "Heading"
11 local Version = 5
12
13 local function OnAcquire(self)
14 self:SetText("")
15 self:SetFullWidth()
16 self:SetHeight(18)
17 end
18
19 local function OnRelease(self)
20 self.frame:ClearAllPoints()
21 self.frame:Hide()
22 end
23
24 local function SetText(self, text)
25 self.label:SetText(text or "")
26 if (text or "") == "" then
27 self.left:SetPoint("RIGHT",self.frame,"RIGHT",-3,0)
28 self.right:Hide()
29 else
30 self.left:SetPoint("RIGHT",self.label,"LEFT",-5,0)
31 self.right:Show()
32 end
33 end
34
35 local function Constructor()
36 local frame = CreateFrame("Frame",nil,UIParent)
37 local self = {}
38 self.type = Type
39
40 self.OnRelease = OnRelease
41 self.OnAcquire = OnAcquire
42 self.SetText = SetText
43 self.frame = frame
44 frame.obj = self
45
46 frame:SetHeight(18)
47
48 local label = frame:CreateFontString(nil,"BACKGROUND","GameFontNormal")
49 label:SetPoint("TOP",frame,"TOP",0,0)
50 label:SetPoint("BOTTOM",frame,"BOTTOM",0,0)
51 label:SetJustifyH("CENTER")
52 label:SetHeight(18)
53 self.label = label
54
55 local left = frame:CreateTexture(nil, "BACKGROUND")
56 self.left = left
57 left:SetHeight(8)
58 left:SetPoint("LEFT",frame,"LEFT",3,0)
59 left:SetPoint("RIGHT",label,"LEFT",-5,0)
60 left:SetTexture("Interface\\Tooltips\\UI-Tooltip-Border")
61 left:SetTexCoord(0.81, 0.94, 0.5, 1)
62
63 local right = frame:CreateTexture(nil, "BACKGROUND")
64 self.right = right
65 right:SetHeight(8)
66 right:SetPoint("RIGHT",frame,"RIGHT",-3,0)
67 right:SetPoint("LEFT",label,"RIGHT",5,0)
68 right:SetTexture("Interface\\Tooltips\\UI-Tooltip-Border")
69 right:SetTexCoord(0.81, 0.94, 0.5, 1)
70
71 AceGUI:RegisterAsWidget(self)
72 return self
73 end
74
75 AceGUI:RegisterWidgetType(Type,Constructor,Version)
76 end