WoWInterface SVN Plink

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk/Plink!/Libs/AceGUI-3.0
    from Rev 2 to Rev 3
    Reverse comparison

Rev 2 → Rev 3

widgets/AceGUIWidget-DropDown.lua
1,4 → 1,4
--[[ $Id: AceGUIWidget-DropDown.lua 76326 2008-06-09 09:29:17Z nevcairiel $ ]]--
--[[ $Id: AceGUIWidget-DropDown.lua 679 2008-09-06 12:51:18Z nargiddley $ ]]--
local min, max, floor = math.min, math.max, math.floor
 
local AceGUI = LibStub("AceGUI-3.0")
344,7 → 344,7
 
do
local widgetType = "Dropdown"
local widgetVersion = 17
local widgetVersion = 18
 
--[[ Static data ]]--
 
359,7 → 359,10
end
 
local function Dropdown_OnHide(this)
this.obj.pullout:Close()
local self = this.obj
if self.open then
self.pullout:Close()
end
end
 
local function Dropdown_TogglePullout(this)
423,8 → 426,10
self:Fire("OnValueChanged", this.userdata.value)
else
this:SetValue(true)
end
self.pullout:Close()
end
if self.open then
self.pullout:Close()
end
end
end
 
443,7 → 448,9
 
-- exported, AceGUI callback
local function OnRelease(self)
self.pullout:Close()
if self.open then
self.pullout:Close()
end
AceGUI:Release(self.pullout)
 
self:SetText("")
476,7 → 483,9
 
-- exported
local function ClearFocus(self)
self.pullout:Close()
if self.open then
self.pullout:Close()
end
end
 
-- exported
553,6 → 562,7
self.list = list
self.pullout:Clear()
self.hasClose = nil
if not list then return end
 
for v in pairs(list) do
sortlist[#sortlist + 1] = v
widgets/AceGUIWidget-DropDown-Items.lua
1,4 → 1,4
--[[ $Id: AceGUIWidget-DropDown-Items.lua 76326 2008-06-09 09:29:17Z nevcairiel $ ]]--
--[[ $Id: AceGUIWidget-DropDown-Items.lua 656 2008-05-31 11:47:08Z nargiddley $ ]]--
 
local AceGUI = LibStub("AceGUI-3.0")
 
widgets/AceGUIWidget-TreeGroup.lua
27,7 → 27,7
 
do
local Type = "TreeGroup"
local Version = 13
local Version = 16
 
local DEFAULT_TREE_WIDTH = 175
local DEFAULT_TREE_SIZABLE = true
143,7 → 143,7
 
local buttoncount = 1
local function CreateButton(self)
local button = CreateFrame("Button",("AceGUI30TreeButton%d"):format(buttoncount),self.treeframe, "InterfaceOptionsButtonTemplate")
local button = CreateFrame("Button",("AceGUI30TreeButton%d"):format(buttoncount),self.treeframe, "OptionsListButtonTemplate")
buttoncount = buttoncount + 1
button.obj = self
 
183,11 → 183,11
local line = button.line
button.level = level
if ( level == 1 ) then
button:SetTextFontObject("GameFontNormal")
button:SetNormalFontObject("GameFontNormal")
button:SetHighlightFontObject("GameFontHighlight")
button.text:SetPoint("LEFT", 8, 2)
else
button:SetTextFontObject("GameFontHighlightSmall")
button:SetNormalFontObject("GameFontHighlightSmall")
button:SetHighlightFontObject("GameFontHighlightSmall")
button.text:SetPoint("LEFT", 8 * level, 2)
end
287,7 → 287,9
}
]]
local function SetTree(self, tree)
assert(type(tree) == "table")
if tree then
assert(type(tree) == "table")
end
self.tree = tree
self:RefreshTree()
end
335,31 → 337,30
end
 
local function RefreshTree(self)
if not self.tree then return end
--Build the list of visible entries from the tree and status tables
local status = self.status or self.localstatus
local groupstatus = status.groups
local tree = self.tree
local buttons = self.buttons
local lines = self.lines
local buttons = self.buttons
 
local treeframe = self.treeframe
 
 
for i, v in ipairs(buttons) do
v:Hide()
end
while lines[1] do
local t = tremove(lines)
for k in pairs(t) do
t[k] = nil
end
del(t)
end
end
 
if not self.tree then return end
--Build the list of visible entries from the tree and status tables
local status = self.status or self.localstatus
local groupstatus = status.groups
local tree = self.tree
 
local treeframe = self.treeframe
 
self:BuildLevel(tree, 1)
 
for i, v in ipairs(buttons) do
v:Hide()
end
 
local numlines = #lines
 
local maxlines = (math.floor(((self.treeframe:GetHeight()or 0) - 20 ) / 18))
471,11 → 472,10
end
 
local function OnWidthSet(self, width)
 
local content = self.content
local treeframe = self.treeframe
local status = self.status or self.localstatus
 
 
local contentwidth = width - status.treewidth - 20
if contentwidth < 0 then
contentwidth = 0
516,26 → 516,26
end
end
 
local function SetTreeWidth(self, treewidth, resizable)
if not resizable then
if type(treewidth) == 'number' then
resizable = false
elseif type(treewidth) == 'boolean' then
resizable = treewidth
treewidth = DEFAULT_TREE_WIDTH
else
resizable = false
treewidth = DEFAULT_TREE_WIDTH
end
end
self.treeframe:SetWidth(treewidth)
local function SetTreeWidth(self, treewidth, resizable)
if not resizable then
if type(treewidth) == 'number' then
resizable = false
elseif type(treewidth) == 'boolean' then
resizable = treewidth
treewidth = DEFAULT_TREE_WIDTH
else
resizable = false
treewidth = DEFAULT_TREE_WIDTH
end
end
self.treeframe:SetWidth(treewidth)
self.dragger:EnableMouse(resizable)
 
local status = self.status or self.localstatus
status.treewidth = treewidth
status.treesizable = resizable
end
 
status.treewidth = treewidth
status.treesizable = resizable
end
 
local function draggerLeave(this)
this:SetBackdropColor(1, 1, 1, 0)
end
560,10 → 560,10
treeframe:SetHeight(0)
treeframe:SetPoint("TOPLEFT",frame,"TOPLEFT",0,0)
treeframe:SetPoint("BOTTOMLEFT",frame,"BOTTOMLEFT",0,0)
treeframe.obj:Fire("OnTreeResize",treeframe:GetWidth())
 
local status = self.status or self.localstatus
status.treewidth = treeframe:GetWidth()
treeframe.obj:Fire("OnTreeResize",treeframe:GetWidth())
 
local status = self.status or self.localstatus
status.treewidth = treeframe:GetWidth()
end
 
local createdcount = 0
592,7 → 592,7
treeframe:SetBackdropColor(0.1,0.1,0.1,0.5)
treeframe:SetBackdropBorderColor(0.4,0.4,0.4)
 
treeframe:SetResizable(true)
treeframe:SetResizable(true)
treeframe:SetMinResize(100, 1)
treeframe:SetMaxResize(400,1600)
local dragger = CreateFrame("Frame", nil, treeframe)
606,13 → 606,13
dragger:SetScript("OnEnter", draggerEnter)
dragger:SetScript("OnLeave", draggerLeave)
 
self.dragger = dragger
self.dragger = dragger
self.treeframe = treeframe
self.OnRelease = OnRelease
self.OnAcquire = OnAcquire
 
self.SetTree = SetTree
self.SetTreeWidth = SetTreeWidth
self.SetTreeWidth = SetTreeWidth
self.RefreshTree = RefreshTree
self.SetStatusTable = SetStatusTable
self.BuildLevel = BuildLevel
widgets/AceGUIWidget-MultiLineEditBox.lua
29,7 → 29,7
 
local AceGUI = LibStub("AceGUI-3.0")
 
local Version = 6
local Version = 7
---------------------
-- Common Elements --
---------------------
120,11 → 120,15
self.disabled = disabled
if disabled then
self.editbox:EnableMouse(false)
self.scrollframe:EnableMouse(false)
self.editbox:ClearFocus()
self.editbox:SetTextColor(0.5, 0.5, 0.5)
self.label:SetTextColor(0.5,0.5,0.5)
else
self.editbox:EnableMouse(true)
self.scrollframe:EnableMouse(true)
self.editbox:SetTextColor(1, 1, 1)
self.label:SetTextColor(1,.82,0)
end
end
 
187,15 → 191,16
scrollframe:SetPoint("TOPLEFT", 5, -6)
scrollframe:SetPoint("BOTTOMRIGHT", -28, 6)
scrollframe.obj = self
self.scrollframe = scrollframe
 
local scrollchild = CreateFrame("Frame", nil, scrollframe)
scrollframe:SetScrollChild(scrollchild)
scrollchild:SetHeight(2)
scrollchild:SetWidth(2)
 
local label = frame:CreateFontString(nil,"OVERLAY","GameFontHighlight")
label:SetPoint("TOPLEFT",frame,"TOPLEFT",14,0)
label:SetPoint("TOPRIGHT",frame,"TOPRIGHT",-14,0)
local label = frame:CreateFontString(nil,"OVERLAY","GameFontNormalSmall")
label:SetPoint("TOPLEFT",frame,"TOPLEFT",0,-2)
label:SetPoint("TOPRIGHT",frame,"TOPRIGHT",0,-2)
label:SetJustifyH("LEFT")
label:SetHeight(18)
self.label = label
widgets/AceGUIWidget-Keybinding.lua
3,9 → 3,10
--------------------------
-- Keybinding --
--------------------------
 
do
local Type = "Keybinding"
local Version = 8
local Version = 11
 
local ControlBackdrop = {
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
73,14 → 74,15
end
end
 
this:EnableKeyboard(false)
self.msgframe:Hide()
this:UnlockHighlight()
self.waitingForKey = nil
 
if not self.disabled then
self:SetKey(keyPressed)
self:Fire("OnKeyChanged",keyPressed)
end
 
this:EnableKeyboard(false)
self.msgframe:Hide()
this:UnlockHighlight()
self.waitingForKey = nil
end
end
 
98,6 → 100,8
end
 
local function OnAcquire(self)
self:SetLabel("")
self:SetKey("")
end
 
local function OnRelease(self)
119,14 → 123,26
end
 
local function SetKey(self, key)
self.button:SetText(key or "")
if (key or "") == "" then
self.button:SetText(NOT_BOUND)
self.button:SetNormalFontObject("GameFontNormal")
else
self.button:SetText(key)
self.button:SetNormalFontObject("GameFontHighlight")
end
end
 
local function SetLabel(self, label)
self.label:SetText(label or "")
if (label or "") == "" then
self.alignoffset = nil
self:SetHeight(24)
else
self.alignoffset = 30
self:SetHeight(44)
end
end
 
 
local function Constructor()
local num = AceGUI:GetNextWidgetNum(Type)
local frame = CreateFrame("Frame",nil,UIParent)
widgets/AceGUIWidget-TabGroup.lua
30,7 → 30,7
 
do
local Type = "TabGroup"
local Version = 14
local Version = 15
 
local PaneBackdrop = {
bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
55,7 → 55,7
 
local function Tab_SetText(self, text)
self:_SetText(text)
PanelTemplates_TabResize(0, self)
PanelTemplates_TabResize(self, 0)
end
 
local function UpdateTabLook(self)
238,8 → 238,8
--equal padding for each tab to fill the available width
local padding = (width - rowwidths[row]) / (endtab - starttab+1)
for i = starttab, endtab do
PanelTemplates_TabResize(padding, tabs[i])
end
PanelTemplates_TabResize(tabs[i], padding)
end
starttab = endtab + 1
end
 
AceGUI-3.0.lua
1,10 → 1,10
--[[ $Id: AceGUI-3.0.lua 74633 2008-05-21 08:20:50Z nevcairiel $ ]]
local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 13
--[[ $Id: AceGUI-3.0.lua 681 2008-09-06 13:01:59Z nargiddley $ ]]
local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 16
local AceGUI, oldminor = LibStub:NewLibrary(ACEGUI_MAJOR, ACEGUI_MINOR)
 
if not AceGUI then return end -- No upgrade needed
 
local con = LibStub("AceConsole-3.0",true)
--local con = LibStub("AceConsole-3.0",true)
 
AceGUI.WidgetRegistry = AceGUI.WidgetRegistry or {}
AceGUI.LayoutRegistry = AceGUI.LayoutRegistry or {}
99,6 → 99,12
if not objPools[type] then
objPools[type] = {}
end
for i,v in ipairs(objPools[type]) do
if v == obj then
error("Attempt to Release Widget that is already released")
return
end
end
tinsert(objPools[type],obj)
end
end
115,14 → 121,19
if reg[type] then
local widget = new(type,reg[type])
 
if widget.Acquire then
if rawget(widget,'Acquire') then
widget.OnAcquire = widget.Acquire
widget.Acquire = nil
elseif widget.Aquire then
elseif rawget(widget,'Aquire') then
widget.OnAcquire = widget.Aquire
widget.Aquire = nil
end
 
if rawget(widget,'Release') then
widget.OnRelease = rawget(widget,'Release')
widget.Release = nil
end
 
if widget.OnAcquire then
widget:OnAcquire()
else
138,23 → 149,19
safecall( widget.PauseLayout, widget )
widget:Fire("OnRelease")
safecall( widget.ReleaseChildren, widget )
 
if widget.OnRelease then
widget:OnRelease()
else
error(("Widget type %s doesn't supply an OnRelease Function"):format(type))
end
for k in pairs(widget.userdata) do
widget.userdata[k] = nil
end
for k in pairs(widget.events) do
widget.events[k] = nil
end
widget.width = nil
if widget.Release then
widget.OnRelease = widget.Release
widget.Release = nil
end
if widget.OnRelease then
widget:OnRelease()
else
error(("Widget type %s doesn't supply an OnRelease Function"):format(type))
end
 
widget.width = nil
--widget.frame:SetParent(nil)
widget.frame:ClearAllPoints()
widget.frame:Hide()
285,6 → 292,62
return self.frame:IsShown()
end
 
WidgetBase.Release = function(self)
AceGUI:Release(self)
end
 
WidgetBase.SetPoint = function(self, ...)
return self.frame:SetPoint(...)
end
 
WidgetBase.ClearAllPoints = function(self)
return self.frame:ClearAllPoints()
end
 
WidgetBase.GetNumPoints = function(self)
return self.frame:GetNumPoints()
end
 
WidgetBase.GetPoint = function(self, ...)
return self.frame:GetPoint(...)
end
 
WidgetBase.GetUserDataTable = function(self)
return self.userdata
end
 
WidgetBase.SetUserData = function(self, key, value)
self.userdata[key] = value
end
 
WidgetBase.GetUserData = function(self, key)
return self.userdata[key]
end
 
WidgetBase.IsFullHeight = function(self)
return self.height == "fill"
end
 
WidgetBase.SetFullHeight = function(self, isFull)
if isFull then
self.height = "fill"
else
self.height = nil
end
end
 
WidgetBase.IsFullWidth = function(self)
return self.width == "fill"
end
 
WidgetBase.SetFullWidth = function(self, isFull)
if isFull then
self.width = "fill"
else
self.width = nil
end
end
 
-- local function LayoutOnUpdate(this)
-- this:SetScript("OnUpdate",nil)
-- this.obj:PerformLayout()