/trunk/libs
-------------------------- |
do |
local Type = "Button" |
local Version = 10 |
local Version = 11 |
local function OnAcquire(self) |
-- restore default values |
local right = _G[name .. "Right"] |
local middle = _G[name .. "Middle"] |
left:SetPoint("TOP", frame, "TOP", 0, -1) |
left:SetPoint("BOTTOM", frame, "BOTTOM", 0, 1) |
left:SetPoint("TOP", frame, "TOP", 0, 0) |
left:SetPoint("BOTTOM", frame, "BOTTOM", 0, 0) |
right:SetPoint("TOP", frame, "TOP", 0, -1) |
right:SetPoint("BOTTOM", frame, "BOTTOM", 0, 1) |
right:SetPoint("TOP", frame, "TOP", 0, 0) |
right:SetPoint("BOTTOM", frame, "BOTTOM", 0, 0) |
middle:SetPoint("TOP", frame, "TOP", 0, -1) |
middle:SetPoint("BOTTOM", frame, "BOTTOM", 0, 1) |
middle:SetPoint("TOP", frame, "TOP", 0, 0) |
middle:SetPoint("BOTTOM", frame, "BOTTOM", 0, 0) |
local text = frame:GetFontString() |
self.text = text |
end |
AceGUI:RegisterWidgetType(Type,Constructor,Version) |
end |
end |
--[[ $Id: AceGUIWidget-DropDown-Items.lua 656 2008-05-31 11:47:08Z nargiddley $ ]]-- |
--[[ $Id: AceGUIWidget-DropDown-Items.lua 808 2009-05-07 14:45:15Z ammo $ ]]-- |
local AceGUI = LibStub("AceGUI-3.0") |
-- Does not close the pullout on click |
do |
local widgetType = "Dropdown-Item-Menu" |
local widgetVersion = 1 |
local widgetVersion = 2 |
local function OnEnter(this) |
local self = this.obj |
end |
-- exported |
function SetMenu(self, menu) |
local function SetMenu(self, menu) |
assert(menu.type == "Dropdown-Pullout") |
self.submenu = menu |
end |
-- exported |
function CloseMenu(self) |
local function CloseMenu(self) |
self.submenu:Close() |
end |
-------------------------- |
do |
local Type = "ColorPicker" |
local Version = 10 |
local Version = 11 |
local function OnAcquire(self) |
self.HasAlpha = false |
local function SetDisabled(self, disabled) |
self.disabled = disabled |
if self.disabled then |
self.frame:Disable() |
self.text:SetTextColor(0.5,0.5,0.5) |
else |
self.frame:Enable() |
self.text:SetTextColor(1,1,1) |
end |
end |
-------------------------- |
do |
local Type = "InteractiveLabel" |
local Version = 3 |
local Version = 5 |
local function OnAcquire(self) |
self:SetHeight(18) |
end |
local function OnRelease(self) |
self:SetDisabled(false) |
self.frame:ClearAllPoints() |
self.frame:Hide() |
end |
end |
end |
local function SetDisabled(self,disabled) |
self.disabled = disabled |
if disabled then |
self.frame:EnableMouse(false) |
self.label:SetTextColor(0.5, 0.5, 0.5) |
else |
self.frame:EnableMouse(true) |
self.label:SetTextColor(1, 1, 1) |
end |
end |
local function OnEnter(this) |
this.obj.highlight:Show() |
this.obj:Fire("OnEnter") |
self.SetFontObject = SetFontObject |
self.SetHighlight = SetHighlight |
self.SetHighlightTexCoord = SetHighlightTexCoord |
self.SetDisabled = SetDisabled |
frame.obj = self |
frame:SetHeight(18) |
do |
local Type = "Keybinding" |
local Version = 12 |
local Version = 13 |
local ControlBackdrop = { |
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", |
self.frame:Hide() |
self.waitingForKey = nil |
self.msgframe:Hide() |
self:SetDisabled(false) |
end |
local function SetDisabled(self, disabled) |
do |
local Type = "TabGroup" |
local Version = 19 |
local Version = 20 |
local PaneBackdrop = { |
bgFile = "Interface\\ChatFrame\\ChatFrameBackground", |
self.localstatus[k] = nil |
end |
self.tablist = nil |
for _, tab in pairs(self.tabs) do |
tab:Hide() |
end |
end |
local function Tab_SetText(self, text) |
v:SetSelected(true) |
found = true |
else |
v:SetSelected(false) |
v:SetSelected(false) |
end |
end |
status.selected = value |
local widths = {} |
local rowwidths = {} |
local rowends = {} |
local rowends = {} |
local function BuildTabs(self) |
local status = self.status or self.localstatus |
local tablist = self.tablist |
local tabs = self.tabs |
for i, v in ipairs(tabs) do |
v:Hide() |
end |
if not tablist then return end |
local width = self.frame.width or self.frame:GetWidth() or 0 |
tab = self:CreateTab(i) |
tabs[i] = tab |
end |
tab:Show() |
tab:SetText(v.text) |
tab:SetDisabled(v.disabled) |
widths[i] = tab:GetWidth() - 6 --tabs are anchored 10 pixels from the right side of the previous one to reduce spacing, but add a fixed 4px padding for the text |
end |
for i = (#tablist)+1, #tabs, 1 do |
tabs[i]:Hide() |
end |
--First pass, find the minimum number of rows needed to hold all tabs and the initial tab layout |
local numtabs = #tablist |
local numrows = 1 |
titletext:SetJustifyH("LEFT") |
titletext:SetHeight(18) |
self.titletext = titletext |
self.titletext = titletext |
local border = CreateFrame("Frame",nil,frame) |
self.border = border |
]] |
do |
local Type = "CheckBox" |
local Version = 5 |
local Version = 7 |
local function OnAcquire(self) |
self:SetValue(false) |
local function CheckBox_OnEnter(this) |
local self = this.obj |
if not self.disabled then |
self.highlight:Show() |
end |
self.highlight:Show() |
self:Fire("OnEnter") |
end |
local function CheckBox_OnLeave(this) |
local self = this.obj |
if not self.down then |
self.highlight:Hide() |
end |
self.highlight:Hide() |
self:Fire("OnLeave") |
end |
local function SetDisabled(self,disabled) |
self.disabled = disabled |
if disabled then |
self.frame:Disable() |
self.text:SetTextColor(0.5,0.5,0.5) |
SetDesaturation(self.check, true) |
else |
self.frame:Enable() |
self.text:SetTextColor(1,1,1) |
if self.tristate and self.checked == nil then |
SetDesaturation(self.check, true) |
--Nil is the unknown tristate value |
if self.tristate and value == nil then |
SetDesaturation(self.check, true) |
check:SetWidth(20) |
check:SetHeight(20) |
check:SetWidth(24) |
check:SetHeight(24) |
self.check:Show() |
else |
SetDesaturation(self.check, false) |
-------------------------- |
do |
local Type = "Icon" |
local Version = 9 |
local Version = 10 |
local function OnAcquire(self) |
self:SetHeight(110) |
local function OnRelease(self) |
self.frame:ClearAllPoints() |
self.frame:Hide() |
self:SetDisabled(false) |
end |
local function SetLabel(self, text) |
end |
end |
local function SetDisabled(self, disabled) |
self.disabled = disabled |
if disabled then |
self.frame:Disable() |
self.label:SetTextColor(0.5,0.5,0.5) |
self.image:SetVertexColor(0.5, 0.5, 0.5, 0.5) |
else |
self.frame:Enable() |
self.label:SetTextColor(1,1,1) |
self.image:SetVertexColor(1, 1, 1) |
end |
end |
local function OnClick(this, button) |
this.obj:Fire("OnClick", button) |
AceGUI:ClearFocus() |
-- SetText should be deprecated along the way |
self.SetText = SetLabel |
self.SetDisabled = SetDisabled |
frame.obj = self |
]] |
do |
local Type = "Frame" |
local Version = 7 |
local Version = 8 |
local FrameBackdrop = { |
bgFile="Interface\\DialogFrame\\UI-DialogBox-Background", |
closebutton:SetPoint("BOTTOMRIGHT",frame,"BOTTOMRIGHT",-27,17) |
closebutton:SetHeight(20) |
closebutton:SetWidth(100) |
closebutton:SetText("Close") |
closebutton:SetText(CLOSE) |
self.closebutton = closebutton |
closebutton.obj = self |
--[[ $Id: AceGUIWidget-DropDown.lua 793 2009-04-07 09:26:44Z nevcairiel $ ]]-- |
--[[ $Id: AceGUIWidget-DropDown.lua 815 2009-07-08 20:58:17Z nevcairiel $ ]]-- |
local min, max, floor = math.min, math.max, math.floor |
local AceGUI = LibStub("AceGUI-3.0") |
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion) |
end |
do |
do |
local widgetType = "Dropdown" |
local widgetVersion = 19 |
local widgetVersion = 20 |
--[[ Static data ]]-- |
self.pullout:Close() |
end |
AceGUI:Release(self.pullout) |
self.pullout = nil |
self:SetText("") |
self:SetLabel("") |
self:SetMultiselect(false) |
self.value = nil |
self.list = nil |
self.list = nil |
self.open = nil |
self.hasClose = nil |
self.frame:ClearAllPoints() |
self.frame:Hide() |
self.frame:Hide() |
end |
-- exported |
local close = AceGUI:Create("Dropdown-Item-Execute") |
close:SetText(CLOSE) |
self.pullout:AddItem(close) |
self.hasClose = true |
self.hasClose = true |
end |
end |
-- f:AddChild(btn) |
-- @class file |
-- @name AceGUI-3.0 |
-- @release $Id: AceGUI-3.0.lua 803 2009-04-14 12:37:54Z nevcairiel $ |
local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 23 |
-- @release $Id: AceGUI-3.0.lua 815 2009-07-08 20:58:17Z nevcairiel $ |
local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 25 |
local AceGUI, oldminor = LibStub:NewLibrary(ACEGUI_MAJOR, ACEGUI_MINOR) |
if not AceGUI then return end -- No upgrade needed |
widget.noAutoHeight = nil |
widget.frame:ClearAllPoints() |
widget.frame:Hide() |
widget.frame:SetParent(nil) |
widget.frame:SetParent(UIParent) |
widget.frame.width = nil |
widget.frame.height = nil |
if widget.content then |
WidgetContainerBase.ReleaseChildren = function(self) |
local children = self.children |
for i in ipairs(children) do |
for i = 1,#children do |
AceGUI:Release(children[i]) |
children[i] = nil |
end |
frame:ClearAllPoints() |
if i == 1 then |
-- anchor the first control to the top left |
--frame:SetPoint("TOPLEFT",content,"TOPLEFT",0,0) |
frame:SetPoint("TOPLEFT",content,"TOPLEFT",0,0) |
rowheight = frameheight |
rowoffset = frameoffset |
rowstart = frame |
-- the profile related APIs are not available. Only `:RegisterDefaults` and `:ResetProfile` are available on child-databases. |
-- |
-- For more details on how to use AceDB-3.0, see the [[AceDB-3.0 Tutorial]]. |
-- |
-- You may also be interested in [[libdualspec-1-0|LibDualSpec-1.0]] to do profile switching automatically when switching specs. |
-- |
-- @usage |
-- MyAddon = LibStub("AceAddon-3.0"):NewAddon("DBExample") |
-- |
-- end |
-- @class file |
-- @name AceDB-3.0.lua |
-- @release $Id: AceDB-3.0.lua 799 2009-04-09 05:00:05Z kaelten $ |
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 13 |
-- @release $Id: AceDB-3.0.lua 813 2009-07-06 21:36:37Z kaelten $ |
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 15 |
local AceDB, oldminor = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR) |
if not AceDB then return end -- No upgrade needed |
local _G = getfenv(0) |
local type = type |
local pairs, next = pairs, next |
local rawget, rawset = rawget, rawset |
function AceDB:New(tbl, defaults, defaultProfile) |
if type(tbl) == "string" then |
local name = tbl |
tbl = getglobal(name) |
tbl = _G[name] |
if not tbl then |
tbl = {} |
setglobal(name, tbl) |