/trunk/ReadySpells/libs/AceGUI-3.0
-- f:AddChild(btn) |
-- @class file |
-- @name AceGUI-3.0 |
-- @release $Id: AceGUI-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $ |
local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 36 |
-- @release $Id: AceGUI-3.0.lua 1221 2019-07-20 18:23:00Z nevcairiel $ |
local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 39 |
local AceGUI, oldminor = LibStub:NewLibrary(ACEGUI_MAJOR, ACEGUI_MINOR) |
if not AceGUI then return end -- No upgrade needed |
AceGUI.WidgetBase = AceGUI.WidgetBase or {} |
AceGUI.WidgetContainerBase = AceGUI.WidgetContainerBase or {} |
AceGUI.WidgetVersions = AceGUI.WidgetVersions or {} |
AceGUI.tooltip = AceGUI.tooltip or CreateFrame("GameTooltip", "AceGUITooltip", UIParent, "GameTooltipTemplate") |
-- local upvalues |
local WidgetRegistry = AceGUI.WidgetRegistry |
-- @param widget The widget to release |
function AceGUI:Release(widget) |
safecall(widget.PauseLayout, widget) |
widget.frame:Hide() |
widget:Fire("OnRelease") |
safecall(widget.ReleaseChildren, widget) |
if children[1] then |
children[1]:SetWidth(content:GetWidth() or 0) |
children[1]:SetHeight(content:GetHeight() or 0) |
children[1].frame:ClearAllPoints() |
children[1].frame:SetAllPoints(content) |
children[1].frame:Show() |
safecall(content.obj.LayoutFinished, content.obj, nil, children[1].frame:GetHeight()) |
TreeGroup Container |
Container that uses a tree control to switch between groups. |
-------------------------------------------------------------------------------]] |
local Type, Version = "TreeGroup", 42 |
local Type, Version = "TreeGroup", 44 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded |
-- List them here for Mikk's FindGlobals script |
-- GLOBALS: GameTooltip, FONT_COLOR_CODE_CLOSE |
-- GLOBALS: FONT_COLOR_CODE_CLOSE |
-- Recycling functions |
local new, del |
self:Fire("OnButtonEnter", frame.uniquevalue, frame) |
if self.enabletooltips then |
GameTooltip:SetOwner(frame, "ANCHOR_NONE") |
GameTooltip:ClearAllPoints() |
GameTooltip:SetPoint("LEFT",frame,"RIGHT") |
GameTooltip:SetText(frame.text:GetText() or "", 1, .82, 0, true) |
local tooltip = AceGUI.tooltip |
tooltip:SetOwner(frame, "ANCHOR_NONE") |
tooltip:ClearAllPoints() |
tooltip:SetPoint("LEFT",frame,"RIGHT") |
tooltip:SetText(frame.text:GetText() or "", 1, .82, 0, true) |
GameTooltip:Show() |
tooltip:Show() |
end |
end |
self:Fire("OnButtonLeave", frame.uniquevalue, frame) |
if self.enabletooltips then |
GameTooltip:Hide() |
AceGUI.tooltip:Hide() |
end |
end |
local function Dragger_OnMouseUp(frame) |
local treeframe = frame:GetParent() |
local self = treeframe.obj |
local frame = treeframe:GetParent() |
local treeframeParent = treeframe:GetParent() |
treeframe:StopMovingOrSizing() |
--treeframe:SetScript("OnUpdate", nil) |
treeframe:SetUserPlaced(false) |
--Without this :GetHeight will get stuck on the current height, causing the tree contents to not resize |
treeframe:SetHeight(0) |
treeframe:SetPoint("TOPLEFT", frame, "TOPLEFT",0,0) |
treeframe:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT",0,0) |
treeframe:ClearAllPoints() |
treeframe:SetPoint("TOPLEFT", treeframeParent, "TOPLEFT",0,0) |
treeframe:SetPoint("BOTTOMLEFT", treeframeParent, "BOTTOMLEFT",0,0) |
local status = self.status or self.localstatus |
status.treewidth = treeframe:GetWidth() |