Lib Updates

This commit is contained in:
Tercio Jose
2020-09-11 21:12:06 -03:00
parent eabba12e08
commit 39e4abb2c1
15 changed files with 78 additions and 49 deletions
+25 -2
View File
@@ -24,8 +24,8 @@
-- f:AddChild(btn)
-- @class file
-- @name AceGUI-3.0
-- @release $Id: AceGUI-3.0.lua 1221 2019-07-20 18:23:00Z nevcairiel $
local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 39
-- @release $Id: AceGUI-3.0.lua 1231 2020-04-14 22:20:36Z nevcairiel $
local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 41
local AceGUI, oldminor = LibStub:NewLibrary(ACEGUI_MAJOR, ACEGUI_MINOR)
if not AceGUI then return end -- No upgrade needed
@@ -176,6 +176,8 @@ end
-- If this widget is a Container-Widget, all of its Child-Widgets will be releases as well.
-- @param widget The widget to release
function AceGUI:Release(widget)
if widget.isQueuedForRelease then return end
widget.isQueuedForRelease = true
safecall(widget.PauseLayout, widget)
widget.frame:Hide()
widget:Fire("OnRelease")
@@ -206,9 +208,26 @@ function AceGUI:Release(widget)
widget.content.width = nil
widget.content.height = nil
end
widget.isQueuedForRelease = nil
delWidget(widget, widget.type)
end
--- Check if a widget is currently in the process of being released
-- This function check if this widget, or any of its parents (in which case it'll be released shortly as well)
-- are currently being released. This allows addon to handle any callbacks accordingly.
-- @param widget The widget to check
function AceGUI:IsReleasing(widget)
if widget.isQueuedForRelease then
return true
end
if widget.parent and widget.parent.AceGUIWidgetVersion then
return AceGUI:IsReleasing(widget.parent)
end
return false
end
-----------
-- Focus --
-----------
@@ -335,6 +354,10 @@ do
AceGUI:Release(self)
end
WidgetBase.IsReleasing = function(self)
return AceGUI:IsReleasing(self)
end
WidgetBase.SetPoint = function(self, ...)
return self.frame:SetPoint(...)
end