Commit dd71140f authored by nevcairiel's avatar nevcairiel

AceGUI-3.0: Add a getter to allow callers to check if a widget is currently...

AceGUI-3.0: Add a getter to allow callers to check if a widget is currently being released, which can be used as part of some callbacks to alter behavior

git-svn-id: https://repos.wowace.com/wow/ace3/trunk@1231 5debad98-a965-4143-8383-f471b3509dcf
parent 2e06be1f
......@@ -25,7 +25,7 @@
-- @class file
-- @name AceGUI-3.0
-- @release $Id$
local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 40
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
......@@ -212,6 +212,22 @@ function AceGUI:Release(widget)
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 --
-----------
......@@ -338,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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment