da942631f0
Bring every embedded Ace3 / CallbackHandler / LibStub copy in line with the canonical Exiles/coa-ace3 bundle so LibStub resolution is predictable across all Exiles forks regardless of which addons are enabled. Libraries updated in this fork: AceConfig-3.0 3 (2 → 3) AceConfigCmd-3.0 14 (12 → 14) AceConfigDialog-3.0 92 (48 → 92) AceConfigRegistry-3.0 22 (12 → 22) AceDB-3.0 33 (21 → 33) AceDBOptions-3.0 15 (12 → 15) AceGUI-3.0 41 (33 → 41) CallbackHandler-1.0 8 (5 → 8) LibStub 2
70 lines
1.8 KiB
Lua
70 lines
1.8 KiB
Lua
--[[-----------------------------------------------------------------------------
|
|
SimpleGroup Container
|
|
Simple container widget that just groups widgets.
|
|
-------------------------------------------------------------------------------]]
|
|
local Type, Version = "SimpleGroup", 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:SetWidth(300)
|
|
self:SetHeight(100)
|
|
end,
|
|
|
|
-- ["OnRelease"] = nil,
|
|
|
|
["LayoutFinished"] = function(self, width, height)
|
|
if self.noAutoHeight then return end
|
|
self:SetHeight(height or 0)
|
|
end,
|
|
|
|
["OnWidthSet"] = function(self, width)
|
|
local content = self.content
|
|
content:SetWidth(width)
|
|
content.width = width
|
|
end,
|
|
|
|
["OnHeightSet"] = function(self, height)
|
|
local content = self.content
|
|
content:SetHeight(height)
|
|
content.height = height
|
|
end
|
|
}
|
|
|
|
--[[-----------------------------------------------------------------------------
|
|
Constructor
|
|
-------------------------------------------------------------------------------]]
|
|
local function Constructor()
|
|
local frame = CreateFrame("Frame", nil, UIParent)
|
|
frame:SetFrameStrata("FULLSCREEN_DIALOG")
|
|
|
|
--Container Support
|
|
local content = CreateFrame("Frame", nil, frame)
|
|
content:SetPoint("TOPLEFT")
|
|
content:SetPoint("BOTTOMRIGHT")
|
|
|
|
local widget = {
|
|
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)
|