local h,m="\073\110\108\105\110\101\071\114\111\117\112",22 local t=LibStub and LibStub("\065\099\101\071\085\073-\051\046\048",true)if not t or(t:GetWidgetVersion(h)or 0)>=m then return end local a=pairs local N,z=CreateFrame,UIParent local s={OnAcquire=function(h)h:SetWidth(300)h:SetHeight(100)h:SetTitle("")end;SetTitle=function(h,m)h.titletext:SetText(m)end,LayoutFinished=function(h,m,t)if h.noAutoHeight then return end h:SetHeight((t or 0)+40)end;OnWidthSet=function(h,m)local t=h.content local a=m-20 if a<0 then a=0 end t:SetWidth(a)t.width=a end;OnHeightSet=function(h,m)local t=h.content local a=m-20 if a<0 then a=0 end t:SetHeight(a)t.height=a end}local S={bgFile="\073\110\116\101\114\102\097\099\101\092\067\104\097\116\070\114\097\109\101\092\067\104\097\116\070\114\097\109\101\066\097\099\107\103\114\111\117\110\100";edgeFile="\073\110\116\101\114\102\097\099\101\092\084\111\111\108\116\105\112\115\092\085\073-\084\111\111\108\116\105\112-\066\111\114\100\101\114",tile=true;tileSize=16,edgeSize=16,insets={left=3;right=3;top=5,bottom=3}}local function g()local m=N("\070\114\097\109\101",nil,z)m:SetFrameStrata("\070\085\076\076\083\067\082\069\069\078\095\068\073\065\076\079\071")local g=m:CreateFontString(nil,"\079\086\069\082\076\065\089","\071\097\109\101\070\111\110\116\078\111\114\109\097\108")g:SetPoint("\084\079\080\076\069\070\084",14,0)g:SetPoint("\084\079\080\082\073\071\072\084",-14,0)g:SetJustifyH("\076\069\070\084")g:SetHeight(18)local i=N("\070\114\097\109\101",nil,m,"\066\097\099\107\100\114\111\112\084\101\109\112\108\097\116\101")i:SetPoint("\084\079\080\076\069\070\084",0,-17)i:SetPoint("\066\079\084\084\079\077\082\073\071\072\084",-1,3)i:SetBackdrop(S)i:SetBackdropColor(.1,.1,.1,.5)i:SetBackdropBorderColor(.4,.4,.4)local j=N("\070\114\097\109\101",nil,i)j:SetPoint("\084\079\080\076\069\070\084",10,-10)j:SetPoint("\066\079\084\084\079\077\082\073\071\072\084",-10,10)local D={frame=m,content=j,titletext=g,type=h}for h,m in a(s)do D[h]=m end return t:RegisterAsContainer(D)end t:RegisterWidgetType(h,g,m)
--[[-----------------------------------------------------------------------------
InlineGroup Container
Simple container widget that creates a visible "box" with an optional title.
-------------------------------------------------------------------------------]]
local Type, Version = "InlineGroup", 22
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:SetWidth(300)
		self:SetHeight(100)
		self:SetTitle("")
	end,

	-- ["OnRelease"] = nil,

	["SetTitle"] = function(self,title)
		self.titletext:SetText(title)
	end,


	["LayoutFinished"] = function(self, width, height)
		if self.noAutoHeight then return end
		self:SetHeight((height or 0) + 40)
	end,

	["OnWidthSet"] = function(self, width)
		local content = self.content
		local contentwidth = width - 20
		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 - 20
		if contentheight < 0 then
			contentheight = 0
		end
		content:SetHeight(contentheight)
		content.height = contentheight
	end
}

--[[-----------------------------------------------------------------------------
Constructor
-------------------------------------------------------------------------------]]
local PaneBackdrop  = {
	bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
	edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
	tile = true, tileSize = 16, edgeSize = 16,
	insets = { left = 3, right = 3, top = 5, bottom = 3 }
}

local function Constructor()
	local frame = CreateFrame("Frame", nil, UIParent)
	frame:SetFrameStrata("FULLSCREEN_DIALOG")

	local titletext = frame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
	titletext:SetPoint("TOPLEFT", 14, 0)
	titletext:SetPoint("TOPRIGHT", -14, 0)
	titletext:SetJustifyH("LEFT")
	titletext:SetHeight(18)

	local border = CreateFrame("Frame", nil, frame, "BackdropTemplate")
	border:SetPoint("TOPLEFT", 0, -17)
	border:SetPoint("BOTTOMRIGHT", -1, 3)
	border:SetBackdrop(PaneBackdrop)
	border:SetBackdropColor(0.1, 0.1, 0.1, 0.5)
	border:SetBackdropBorderColor(0.4, 0.4, 0.4)

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

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

	return AceGUI:RegisterAsContainer(widget)
end

AceGUI:RegisterWidgetType(Type, Constructor, Version)
