local t,M="\066\108\105\122\079\112\116\105\111\110\115\071\114\111\117\112",26 local u=LibStub and LibStub("\065\099\101\071\085\073-\051\046\048",true)if not u or(u:GetWidgetVersion(t)or 0)>=M then return end local r=pairs local W=CreateFrame local function d(t)t.obj:Fire("\079\110\083\104\111\119")end local function g(t)t.obj:Fire("\079\110\072\105\100\101")end local function V(t)t.obj:Fire("\111\107\097\121")end local function a(t)t.obj:Fire("\099\097\110\099\101\108")end local function L(t)t.obj:Fire("\100\101\102\097\117\108\116")end local function e(t)t.obj:Fire("\114\101\102\114\101\115\104")end local X={OnAcquire=function(t)t:SetName()t:SetTitle()end,OnWidthSet=function(t,M)local u=t.content local r=M-63 if r<0 then r=0 end u:SetWidth(r)u.width=r end;OnHeightSet=function(t,M)local u=t.content local r=M-26 if r<0 then r=0 end u:SetHeight(r)u.height=r end,SetName=function(t,M,u)t.frame.name=M t.frame.parent=u end,SetTitle=function(t,M)local u=t.content u:ClearAllPoints()if not M or M==""then u:SetPoint("\084\079\080\076\069\070\084",10,-10)t.label:SetText("")else u:SetPoint("\084\079\080\076\069\070\084",10,-40)t.label:SetText(M)end u:SetPoint("\066\079\084\084\079\077\082\073\071\072\084",-10,10)end}local function S()local M=W("\070\114\097\109\101",nil,InterfaceOptionsFramePanelContainer)M:Hide()M.okay=V M.cancel=a M.default=L M.refresh=e M.OnCommit=V M.OnDefault=L M.OnRefresh=e M:SetScript("\079\110\072\105\100\101",g)M:SetScript("\079\110\083\104\111\119",d)local S=M:CreateFontString(nil,"\079\086\069\082\076\065\089","\071\097\109\101\070\111\110\116\078\111\114\109\097\108\076\097\114\103\101")S:SetPoint("\084\079\080\076\069\070\084",10,-15)S:SetPoint("\066\079\084\084\079\077\082\073\071\072\084",M,"\084\079\080\082\073\071\072\084",10,-45)S:SetJustifyH("\076\069\070\084")S:SetJustifyV("\084\079\080")local Q=W("\070\114\097\109\101",nil,M)Q:SetPoint("\084\079\080\076\069\070\084",10,-10)Q:SetPoint("\066\079\084\084\079\077\082\073\071\072\084",-10,10)local A={label=S,frame=M,content=Q;type=t}for t,M in r(X)do A[t]=M end return u:RegisterAsContainer(A)end u:RegisterWidgetType(t,S,M)
--[[-----------------------------------------------------------------------------
BlizOptionsGroup Container
Simple container widget for the integration of AceGUI into the Blizzard Interface Options
-------------------------------------------------------------------------------]]
local Type, Version = "BlizOptionsGroup", 26
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 = CreateFrame

--[[-----------------------------------------------------------------------------
Scripts
-------------------------------------------------------------------------------]]

local function OnShow(frame)
	frame.obj:Fire("OnShow")
end

local function OnHide(frame)
	frame.obj:Fire("OnHide")
end

--[[-----------------------------------------------------------------------------
Support functions
-------------------------------------------------------------------------------]]

local function okay(frame)
	frame.obj:Fire("okay")
end

local function cancel(frame)
	frame.obj:Fire("cancel")
end

local function default(frame)
	frame.obj:Fire("default")
end

local function refresh(frame)
	frame.obj:Fire("refresh")
end

--[[-----------------------------------------------------------------------------
Methods
-------------------------------------------------------------------------------]]

local methods = {
	["OnAcquire"] = function(self)
		self:SetName()
		self:SetTitle()
	end,

	-- ["OnRelease"] = nil,

	["OnWidthSet"] = function(self, width)
		local content = self.content
		local contentwidth = width - 63
		if contentwidth < 0 then
			contentwidth = 0
		end
		content:SetWidth(contentwidth)
		content.width = contentwidth
	end,

	["OnHeightSet"] = function(self, height)
		local content = self.content
		local contentheight = height - 26
		if contentheight < 0 then
			contentheight = 0
		end
		content:SetHeight(contentheight)
		content.height = contentheight
	end,

	["SetName"] = function(self, name, parent)
		self.frame.name = name
		self.frame.parent = parent
	end,

	["SetTitle"] = function(self, title)
		local content = self.content
		content:ClearAllPoints()
		if not title or title == "" then
			content:SetPoint("TOPLEFT", 10, -10)
			self.label:SetText("")
		else
			content:SetPoint("TOPLEFT", 10, -40)
			self.label:SetText(title)
		end
		content:SetPoint("BOTTOMRIGHT", -10, 10)
	end
}

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

	-- support functions for the Blizzard Interface Options
	frame.okay = okay
	frame.cancel = cancel
	frame.default = default
	frame.refresh = refresh

	-- 10.0 support function aliases (cancel has been removed)
	frame.OnCommit = okay
	frame.OnDefault = default
	frame.OnRefresh = refresh

	frame:SetScript("OnHide", OnHide)
	frame:SetScript("OnShow", OnShow)

	local label = frame:CreateFontString(nil, "OVERLAY", "GameFontNormalLarge")
	label:SetPoint("TOPLEFT", 10, -15)
	label:SetPoint("BOTTOMRIGHT", frame, "TOPRIGHT", 10, -45)
	label:SetJustifyH("LEFT")
	label:SetJustifyV("TOP")

	--Container Support
	local content = CreateFrame("Frame", nil, frame)
	content:SetPoint("TOPLEFT", 10, -10)
	content:SetPoint("BOTTOMRIGHT", -10, 10)

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

	return AceGUI:RegisterAsContainer(widget)
end

AceGUI:RegisterWidgetType(Type, Constructor, Version)
