local p,K="\072\101\097\100\105\110\103",20 local a=LibStub and LibStub("\065\099\101\071\085\073-\051\046\048",true)if not a or(a:GetWidgetVersion(p)or 0)>=K then return end local w=pairs local R,H=CreateFrame,UIParent local C={OnAcquire=function(p)p:SetText()p:SetFullWidth()p:SetHeight(18)end,SetText=function(p,K)p.label:SetText(K or"")if K and K~=""then p.left:SetPoint("\082\073\071\072\084",p.label,"\076\069\070\084",-5,0)p.right:Show()else p.left:SetPoint("\082\073\071\072\084",-3,0)p.right:Hide()end end}local function c()local K=R("\070\114\097\109\101",nil,H)K:Hide()local c=K: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 f=K:CreateTexture(nil,"\066\065\067\075\071\082\079\085\078\068")f:SetHeight(8)f:SetPoint("\076\069\070\084",3,0)f:SetPoint("\082\073\071\072\084",c,"\076\069\070\084",-5,0)f:SetTexture(137057)f:SetTexCoord(.81,.94,.5,1)local U=K:CreateTexture(nil,"\066\065\067\075\071\082\079\085\078\068")U:SetHeight(8)U:SetPoint("\082\073\071\072\084",-3,0)U:SetPoint("\076\069\070\084",c,"\082\073\071\072\084",5,0)U:SetTexture(137057)U:SetTexCoord(.81,.94,.5,1)local W={label=c,left=f,right=U;frame=K;type=p}for p,K in w(C)do W[p]=K end return a:RegisterAsWidget(W)end a:RegisterWidgetType(p,c,K)
--[[-----------------------------------------------------------------------------
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)
