annotate Libs/AceGUI-3.0/widgets/AceGUIContainer-SimpleGroup.lua @ 1:6f17035de058

MO will now request a server refresh when mail opening has finished, ignoring the timer. (Collected Module) Fixed the time spent to only be displayed if it is being tracked. The inventory full sound will properly be played again when your bags change.
author Zerotorescue
date Sun, 05 Sep 2010 17:02:19 +0200
parents 823e33465b6e
children
rev   line source
Zerotorescue@0 1 --[[-----------------------------------------------------------------------------
Zerotorescue@0 2 SimpleGroup Container
Zerotorescue@0 3 Simple container widget that just groups widgets.
Zerotorescue@0 4 -------------------------------------------------------------------------------]]
Zerotorescue@0 5 local Type, Version = "SimpleGroup", 20
Zerotorescue@0 6 local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
Zerotorescue@0 7 if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
Zerotorescue@0 8
Zerotorescue@0 9 -- Lua APIs
Zerotorescue@0 10 local pairs = pairs
Zerotorescue@0 11
Zerotorescue@0 12 -- WoW APIs
Zerotorescue@0 13 local CreateFrame, UIParent = CreateFrame, UIParent
Zerotorescue@0 14
Zerotorescue@0 15
Zerotorescue@0 16 --[[-----------------------------------------------------------------------------
Zerotorescue@0 17 Methods
Zerotorescue@0 18 -------------------------------------------------------------------------------]]
Zerotorescue@0 19 local methods = {
Zerotorescue@0 20 ["OnAcquire"] = function(self)
Zerotorescue@0 21 self:SetWidth(300)
Zerotorescue@0 22 self:SetHeight(100)
Zerotorescue@0 23 end,
Zerotorescue@0 24
Zerotorescue@0 25 -- ["OnRelease"] = nil,
Zerotorescue@0 26
Zerotorescue@0 27 ["LayoutFinished"] = function(self, width, height)
Zerotorescue@0 28 if self.noAutoHeight then return end
Zerotorescue@0 29 self:SetHeight(height or 0)
Zerotorescue@0 30 end,
Zerotorescue@0 31
Zerotorescue@0 32 ["OnWidthSet"] = function(self, width)
Zerotorescue@0 33 local content = self.content
Zerotorescue@0 34 content:SetWidth(width)
Zerotorescue@0 35 content.width = width
Zerotorescue@0 36 end,
Zerotorescue@0 37
Zerotorescue@0 38 ["OnHeightSet"] = function(self, height)
Zerotorescue@0 39 local content = self.content
Zerotorescue@0 40 content:SetHeight(height)
Zerotorescue@0 41 content.height = height
Zerotorescue@0 42 end
Zerotorescue@0 43 }
Zerotorescue@0 44
Zerotorescue@0 45 --[[-----------------------------------------------------------------------------
Zerotorescue@0 46 Constructor
Zerotorescue@0 47 -------------------------------------------------------------------------------]]
Zerotorescue@0 48 local function Constructor()
Zerotorescue@0 49 local frame = CreateFrame("Frame", nil, UIParent)
Zerotorescue@0 50 frame:SetFrameStrata("FULLSCREEN_DIALOG")
Zerotorescue@0 51
Zerotorescue@0 52 --Container Support
Zerotorescue@0 53 local content = CreateFrame("Frame", nil, frame)
Zerotorescue@0 54 content:SetPoint("TOPLEFT")
Zerotorescue@0 55 content:SetPoint("BOTTOMRIGHT")
Zerotorescue@0 56
Zerotorescue@0 57 local widget = {
Zerotorescue@0 58 frame = frame,
Zerotorescue@0 59 content = content,
Zerotorescue@0 60 type = Type
Zerotorescue@0 61 }
Zerotorescue@0 62 for method, func in pairs(methods) do
Zerotorescue@0 63 widget[method] = func
Zerotorescue@0 64 end
Zerotorescue@0 65
Zerotorescue@0 66 return AceGUI:RegisterAsContainer(widget)
Zerotorescue@0 67 end
Zerotorescue@0 68
Zerotorescue@0 69 AceGUI:RegisterWidgetType(Type, Constructor, Version)