local M,d="\072\101\097\100\105\110\103",20 local l=LibStub and LibStub("\065\099\101\071\085\073-\051\046\048",true)if not l or(l:GetWidgetVersion(M)or 0)>=d then return end local U=pairs local j,v=CreateFrame,UIParent local x={OnAcquire=function(M)M:SetText()M:SetFullWidth()M:SetHeight(18)end;SetText=function(M,d)M.label:SetText(d or"")if d and d~=""then M.left:SetPoint("\082\073\071\072\084",M.label,"\076\069\070\084",-5,0)M.right:Show()else M.left:SetPoint("\082\073\071\072\084",-3,0)M.right:Hide()end end}local function C()local d=j("\070\114\097\109\101",nil,v)d:Hide()local C=d:CreateFontString(nil,"\066\065\067\075\071\082\079\085\078\068","\071\097\109\101\070\111\110\116\078\111\114\109\097\108")C:SetPoint("\084\079\080")C:SetPoint("\066\079\084\084\079\077")C:SetJustifyH("\067\069\078\084\069\082")local i=d:CreateTexture(nil,"\066\065\067\075\071\082\079\085\078\068")i:SetHeight(8)i:SetPoint("\076\069\070\084",3,0)i:SetPoint("\082\073\071\072\084",C,"\076\069\070\084",-5,0)i:SetTexture(137057)i:SetTexCoord(.81,.94,.5,1)local A=d:CreateTexture(nil,"\066\065\067\075\071\082\079\085\078\068")A:SetHeight(8)A:SetPoint("\082\073\071\072\084",-3,0)A:SetPoint("\076\069\070\084",C,"\082\073\071\072\084",5,0)A:SetTexture(137057)A:SetTexCoord(.81,.94,.5,1)local m={label=C,left=i;right=A;frame=d;type=M}for M,d in U(x)do m[M]=d end return l:RegisterAsWidget(m)end l:RegisterWidgetType(M,C,d)
--[[-----------------------------------------------------------------------------
Heading Widget
-------------------------------------------------------------------------------]]
local Type, Version = "Heading", 20
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end

-- Lua APIs
local pairs = pairs

-- WoW APIs
local CreateFrame, UIParent = CreateFrame, UIParent

--[[-----------------------------------------------------------------------------
Methods
-------------------------------------------------------------------------------]]
local methods = {
	["OnAcquire"] = function(self)
		self:SetText()
		self:SetFullWidth()
		self:SetHeight(18)
	end,

	-- ["OnRelease"] = nil,

	["SetText"] = function(self, text)
		self.label:SetText(text or "")
		if text and text ~= "" then
			self.left:SetPoint("RIGHT", self.label, "LEFT", -5, 0)
			self.right:Show()
		else
			self.left:SetPoint("RIGHT", -3, 0)
			self.right:Hide()
		end
	end
}

--[[-----------------------------------------------------------------------------
Constructor
-------------------------------------------------------------------------------]]
local function Constructor()
	local frame = CreateFrame("Frame", nil, UIParent)
	frame:Hide()

	local label = frame:CreateFontString(nil, "BACKGROUND", "GameFontNormal")
	label:SetPoint("TOP")
	label:SetPoint("BOTTOM")
	label:SetJustifyH("CENTER")

	local left = frame:CreateTexture(nil, "BACKGROUND")
	left:SetHeight(8)
	left:SetPoint("LEFT", 3, 0)
	left:SetPoint("RIGHT", label, "LEFT", -5, 0)
	left:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border
	left:SetTexCoord(0.81, 0.94, 0.5, 1)

	local right = frame:CreateTexture(nil, "BACKGROUND")
	right:SetHeight(8)
	right:SetPoint("RIGHT", -3, 0)
	right:SetPoint("LEFT", label, "RIGHT", 5, 0)
	right:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border
	right:SetTexCoord(0.81, 0.94, 0.5, 1)

	local widget = {
		label = label,
		left  = left,
		right = right,
		frame = frame,
		type  = Type
	}
	for method, func in pairs(methods) do
		widget[method] = func
	end

	return AceGUI:RegisterAsWidget(widget)
end

AceGUI:RegisterWidgetType(Type, Constructor, Version)
