annotate Libs/AceGUI-3.0/widgets/AceGUIContainer-SimpleGroup.lua @ 25:ac501d71c890 tip

Added tag v8.2.0.024 for changeset 389dcaeebc47
author Tercioo
date Fri, 28 Jun 2019 20:07:27 -0300
parents fc346da3afd9
children
rev   line source
tercio@0 1 --[[-----------------------------------------------------------------------------
tercio@0 2 SimpleGroup Container
tercio@0 3 Simple container widget that just groups widgets.
tercio@0 4 -------------------------------------------------------------------------------]]
tercio@0 5 local Type, Version = "SimpleGroup", 20
tercio@0 6 local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
tercio@0 7 if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
tercio@0 8
tercio@0 9 -- Lua APIs
tercio@0 10 local pairs = pairs
tercio@0 11
tercio@0 12 -- WoW APIs
tercio@0 13 local CreateFrame, UIParent = CreateFrame, UIParent
tercio@0 14
tercio@0 15
tercio@0 16 --[[-----------------------------------------------------------------------------
tercio@0 17 Methods
tercio@0 18 -------------------------------------------------------------------------------]]
tercio@0 19 local methods = {
tercio@0 20 ["OnAcquire"] = function(self)
tercio@0 21 self:SetWidth(300)
tercio@0 22 self:SetHeight(100)
tercio@0 23 end,
tercio@0 24
tercio@0 25 -- ["OnRelease"] = nil,
tercio@0 26
tercio@0 27 ["LayoutFinished"] = function(self, width, height)
tercio@0 28 if self.noAutoHeight then return end
tercio@0 29 self:SetHeight(height or 0)
tercio@0 30 end,
tercio@0 31
tercio@0 32 ["OnWidthSet"] = function(self, width)
tercio@0 33 local content = self.content
tercio@0 34 content:SetWidth(width)
tercio@0 35 content.width = width
tercio@0 36 end,
tercio@0 37
tercio@0 38 ["OnHeightSet"] = function(self, height)
tercio@0 39 local content = self.content
tercio@0 40 content:SetHeight(height)
tercio@0 41 content.height = height
tercio@0 42 end
tercio@0 43 }
tercio@0 44
tercio@0 45 --[[-----------------------------------------------------------------------------
tercio@0 46 Constructor
tercio@0 47 -------------------------------------------------------------------------------]]
tercio@0 48 local function Constructor()
tercio@0 49 local frame = CreateFrame("Frame", nil, UIParent)
tercio@0 50 frame:SetFrameStrata("FULLSCREEN_DIALOG")
tercio@0 51
tercio@0 52 --Container Support
tercio@0 53 local content = CreateFrame("Frame", nil, frame)
tercio@0 54 content:SetPoint("TOPLEFT")
tercio@0 55 content:SetPoint("BOTTOMRIGHT")
tercio@0 56
tercio@0 57 local widget = {
tercio@0 58 frame = frame,
tercio@0 59 content = content,
tercio@0 60 type = Type
tercio@0 61 }
tercio@0 62 for method, func in pairs(methods) do
tercio@0 63 widget[method] = func
tercio@0 64 end
tercio@0 65
tercio@0 66 return AceGUI:RegisterAsContainer(widget)
tercio@0 67 end
tercio@0 68
tercio@0 69 AceGUI:RegisterWidgetType(Type, Constructor, Version)