WoWInterface SVN Plink

Compare Revisions

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

Rev 3 → Rev 7

BorderWidget.lua
8,11 → 8,11
local min, max, floor = math.min, math.max, math.floor
local fixlevels = AceGUISharedMediaWidgets.fixlevels
local OnItemValueChanged = AceGUISharedMediaWidgets.OnItemValueChanged
 
 
do
local widgetType = "LSM30_Border_Item_Select"
local widgetVersion = 1
 
 
local function Frame_OnEnter(this)
local self = this.obj
 
21,7 → 21,7
self.border:Show()
end
self:Fire("OnEnter")
 
 
if self.specialOnEnter then
self.specialOnEnter(self)
end
32,7 → 32,7
self.border:Hide()
self.highlight:Hide()
self:Fire("OnLeave")
 
 
if self.specialOnLeave then
self.specialOnLeave(self)
end
46,7 → 46,7
end
self.text:SetText(text or "")
end
 
 
local function Constructor()
local self = AceGUI:Create("Dropdown-Item-Toggle")
self.type = widgetType
68,23 → 68,23
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion)
end
 
do
do
local widgetType = "LSM30_Border"
local widgetVersion = 2
 
local widgetVersion = 3
 
local function Frame_OnEnter(this)
local self = this.obj
local text = self.text:GetText()
if text ~= nil and text ~= '' then
if text ~= nil and text ~= '' then
self.borderframe:Show()
end
end
 
 
local function Frame_OnLeave(this)
local self = this.obj
self.borderframe:Hide()
end
 
 
local function AddListItem(self, value, text)
local item = AceGUI:Create("LSM30_Border_Item_Select")
item:SetText(text)
93,11 → 93,17
item:SetCallback("OnValueChanged", OnItemValueChanged)
self.pullout:AddItem(item)
end
 
local sortlist = {}
 
local function SetList(self, list)
self.list = list or Media:HashTable("border")
self.pullout:Clear()
if self.multiselect then
AddCloseButton()
end
end
 
local sortlist = {}
local function ParseListItems(self)
for v in pairs(self.list) do
sortlist[#sortlist + 1] = v
end
106,11 → 112,8
AddListItem(self, value, value)
sortlist[i] = nil
end
if self.multiselect then
AddCloseButton()
end
end
 
 
local function SetText(self, text)
if text and text ~= '' then
local backdropTable = self.borderframe:GetBackdrop()
119,18 → 122,18
end
self.text:SetText(text or "")
end
 
 
local function Constructor()
local self = AceGUI:Create("Dropdown")
self.type = widgetType
self.SetList = SetList
self.SetText = SetText
self.SetValue = AceGUISharedMediaWidgets.SetValue
 
 
local left = _G[self.dropdown:GetName() .. "Left"]
local middle = _G[self.dropdown:GetName() .. "Middle"]
local right = _G[self.dropdown:GetName() .. "Right"]
 
 
local borderframe = CreateFrame('Frame')
borderframe:SetFrameStrata("TOOLTIP")
borderframe:SetWidth(64)
141,11 → 144,18
insets = { left = 4, right = 4, top = 4, bottom = 4 }})
self.borderframe = borderframe
borderframe:Hide()
 
 
self.dropdown:EnableMouse(true)
self.dropdown:SetScript("OnEnter", Frame_OnEnter)
self.dropdown:SetScript("OnLeave", Frame_OnLeave)
 
 
local clickscript = self.button:GetScript("OnClick")
self.button:SetScript("OnClick", function(...)
self.pullout:Clear()
ParseListItems(self)
clickscript(...)
end)
 
return self
end
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion)
BackgroundWidget.lua
8,11 → 8,11
local min, max, floor = math.min, math.max, math.floor
local fixlevels = AceGUISharedMediaWidgets.fixlevels
local OnItemValueChanged = AceGUISharedMediaWidgets.OnItemValueChanged
 
 
do
local widgetType = "LSM30_Background_Item_Select"
local widgetVersion = 1
 
 
local function Frame_OnEnter(this)
local self = this.obj
 
21,7 → 21,7
self.texture:Show()
end
self:Fire("OnEnter")
 
 
if self.specialOnEnter then
self.specialOnEnter(self)
end
32,7 → 32,7
self.texture:Hide()
self.highlight:Hide()
self:Fire("OnLeave")
 
 
if self.specialOnLeave then
self.specialOnLeave(self)
end
44,7 → 44,7
end
self.text:SetText(text or "")
end
 
 
local function Constructor()
local self = AceGUI:Create("Dropdown-Item-Toggle")
self.type = widgetType
67,30 → 67,30
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion)
end
 
do
do
local widgetType = "LSM30_Background"
local widgetVersion = 2
 
local widgetVersion = 3
 
local function Frame_OnEnter(this)
local self = this.obj
local text = self.text:GetText()
if text ~= nil and text ~= '' then
if text ~= nil and text ~= '' then
self.textureframe:Show()
end
end
 
 
local function Frame_OnLeave(this)
local self = this.obj
self.textureframe:Hide()
end
 
 
local function SetText(self, text)
if text and text ~= '' then
self.texture:SetTexture(Media:Fetch('background',text))
end
self.text:SetText(text or "")
end
 
 
local function AddListItem(self, value, text)
local item = AceGUI:Create("LSM30_Background_Item_Select")
item:SetText(text)
99,11 → 99,18
item:SetCallback("OnValueChanged", OnItemValueChanged)
self.pullout:AddItem(item)
end
 
local sortlist = {}
 
local function SetList(self, list)
self.list = list or Media:HashTable("background")
self.pullout:Clear()
 
if self.multiselect then
AddCloseButton()
end
end
 
local sortlist = {}
local function ParseListItems(self)
for v in pairs(self.list) do
sortlist[#sortlist + 1] = v
end
112,22 → 119,19
AddListItem(self, value, value)
sortlist[i] = nil
end
if self.multiselect then
AddCloseButton()
end
end
 
 
local function Constructor()
local self = AceGUI:Create("Dropdown")
self.type = widgetType
self.SetText = SetText
self.SetList = SetList
self.SetValue = AceGUISharedMediaWidgets.SetValue
 
 
local left = _G[self.dropdown:GetName() .. "Left"]
local middle = _G[self.dropdown:GetName() .. "Middle"]
local right = _G[self.dropdown:GetName() .. "Right"]
 
 
local textureframe = CreateFrame('Frame')
textureframe:SetFrameStrata("TOOLTIP")
textureframe:SetWidth(128)
139,11 → 143,18
texture:SetAllPoints(textureframe)
textureframe:Hide()
self.texture = texture
 
 
self.dropdown:EnableMouse(true)
self.dropdown:SetScript("OnEnter", Frame_OnEnter)
self.dropdown:SetScript("OnLeave", Frame_OnLeave)
 
 
local clickscript = self.button:GetScript("OnClick")
self.button:SetScript("OnClick", function(...)
self.pullout:Clear()
ParseListItems(self)
clickscript(...)
end)
 
return self
end
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion)
FontWidget.lua
8,7 → 8,7
local min, max, floor = math.min, math.max, math.floor
local fixlevels = AceGUISharedMediaWidgets.fixlevels
local OnItemValueChanged = AceGUISharedMediaWidgets.OnItemValueChanged
 
 
do
local widgetType = "LSM30_Font_Item_Select"
local widgetVersion = 1
20,29 → 20,29
end
self.text:SetText(text or "")
end
 
 
local function Constructor()
local self = AceGUI:Create("Dropdown-Item-Toggle")
self.type = widgetType
self.SetText = SetText
return self
end
 
 
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion)
end
 
do
local widgetType = "LSM30_Font"
local widgetVersion = 2
 
local function SetText(self, text)
local widgetVersion = 3
 
local function SetText(self, text)
if text and text ~= '' then
local _, size, outline= self.text:GetFont()
self.text:SetFont(Media:Fetch('font',text),size,outline)
end
self.text:SetText(text or "")
end
 
 
local function AddListItem(self, value, text)
local item = AceGUI:Create("LSM30_Font_Item_Select")
item:SetText(text)
51,11 → 51,17
item:SetCallback("OnValueChanged", OnItemValueChanged)
self.pullout:AddItem(item)
end
 
local sortlist = {}
 
local function SetList(self, list)
self.list = list or Media:HashTable("font")
self.pullout:Clear()
if self.multiselect then
AddCloseButton()
end
end
 
local sortlist = {}
local function ParseListItems(self)
for v in pairs(self.list) do
sortlist[#sortlist + 1] = v
end
64,20 → 70,25
AddListItem(self, value, value)
sortlist[i] = nil
end
if self.multiselect then
AddCloseButton()
end
end
 
 
local function Constructor()
local self = AceGUI:Create("Dropdown")
self.type = widgetType
self.SetText = SetText
self.SetValue = AceGUISharedMediaWidgets.SetValue
self.SetList = SetList
 
local clickscript = self.button:GetScript("OnClick")
self.button:SetScript("OnClick", function(...)
self.pullout:Clear()
ParseListItems(self)
clickscript(...)
end)
 
return self
end
 
 
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion)
end
end
SoundWidget.lua
8,11 → 8,11
local min, max, floor = math.min, math.max, math.floor
local fixlevels = AceGUISharedMediaWidgets.fixlevels
local OnItemValueChanged = AceGUISharedMediaWidgets.OnItemValueChanged
 
 
do
local widgetType = "LSM30_Sound_Item_Select"
local widgetVersion = 1
 
 
local function Frame_OnEnter(this)
local self = this.obj
 
20,7 → 20,7
self.highlight:Show()
end
self:Fire("OnEnter")
 
 
if self.specialOnEnter then
self.specialOnEnter(self)
end
28,10 → 28,10
 
local function Frame_OnLeave(this)
local self = this.obj
 
 
self.highlight:Hide()
self:Fire("OnLeave")
 
 
if self.specialOnLeave then
self.specialOnLeave(self)
end
51,7 → 51,7
 
local function SetPullout(self, pullout)
self.pullout = pullout
 
 
self.frame:SetParent(nil)
self.frame:SetParent(pullout.itemFrame)
self.parent = pullout.itemFrame
78,7 → 78,7
local function Hide(self)
self.frame:Hide()
end
 
 
local function SetDisabled(self, disabled)
self.disabled = disabled
if disabled then
89,7 → 89,7
self.text:SetTextColor(1, 1, 1)
end
end
 
 
local function SetOnLeave(self, func)
self.specialOnLeave = func
end
105,24 → 105,24
self.check:Hide()
end
end
 
 
local function Frame_OnClick(this, button)
local self = this.obj
self.value = not self.value
UpdateToggle(self)
self:Fire("OnValueChanged", self.value)
end
 
 
local function Speaker_OnClick(this, button)
local self = this.obj
PlaySoundFile(Media:Fetch('sound',self.sound))
end
 
 
local function SetValue(self, value)
self.value = value
UpdateToggle(self)
end
 
 
local function Constructor()
local count = AceGUI:GetNextWidgetNum(type)
local frame = CreateFrame("Frame", "LSM30_Sound_DropDownItem"..count)
130,35 → 130,35
self.frame = frame
frame.obj = self
self.type = type
 
 
self.useHighlight = true
 
 
frame:SetHeight(17)
frame:SetFrameStrata("FULLSCREEN_DIALOG")
 
 
local button = CreateFrame("Button", nil, frame)
button:SetPoint("BOTTOMRIGHT",frame,"BOTTOMRIGHT",-22,0)
button:SetPoint("TOPLEFT",frame,"TOPLEFT",0,0)
self.button = button
button.obj = self
 
 
local speakerbutton = CreateFrame("Button", nil, frame)
speakerbutton:SetWidth(16)
speakerbutton:SetHeight(16)
speakerbutton:SetPoint("RIGHT",frame,"RIGHT",-6,0)
self.speakerbutton = speakerbutton
speakerbutton.obj = self
 
 
local speaker = frame:CreateTexture(nil, "BACKGROUND")
speaker:SetTexture("Interface\\Common\\VoiceChat-Speaker")
speaker:SetAllPoints(speakerbutton)
self.speaker = speaker
 
 
local speakeron = speakerbutton:CreateTexture(nil, "HIGHLIGHT")
speakeron:SetTexture("Interface\\Common\\VoiceChat-On")
speakeron:SetAllPoints(speakerbutton)
self.speakeron = speakeron
 
 
local text = frame:CreateFontString(nil,"OVERLAY","GameFontNormalSmall")
text:SetTextColor(1,1,1)
text:SetJustifyH("LEFT")
175,8 → 175,8
highlight:SetPoint("LEFT",frame,"LEFT",5,0)
highlight:Hide()
self.highlight = highlight
 
local check = frame:CreateTexture("OVERLAY")
 
local check = frame:CreateTexture("OVERLAY")
check:SetWidth(16)
check:SetHeight(16)
check:SetPoint("LEFT",frame,"LEFT",3,-1)
190,41 → 190,41
sub:SetPoint("RIGHT",frame,"RIGHT",-3,-1)
sub:SetTexture("Interface\\ChatFrame\\ChatFrameExpandArrow")
sub:Hide()
self.sub = sub
 
self.sub = sub
 
button:SetScript("OnEnter", Frame_OnEnter)
button:SetScript("OnLeave", Frame_OnLeave)
 
 
self.OnAcquire = OnAcquire
self.OnRelease = OnRelease
 
 
self.SetPullout = SetPullout
self.GetText = GetText
self.SetText = SetText
self.SetDisabled = SetDisabled
 
 
self.SetPoint = SetPoint
self.Show = Show
self.Hide = Hide
 
 
self.SetOnLeave = SetOnLeave
self.SetOnEnter = SetOnEnter
 
 
self.button:SetScript("OnClick", Frame_OnClick)
self.speakerbutton:SetScript("OnClick", Speaker_OnClick)
 
 
self.SetValue = SetValue
 
 
AceGUI:RegisterAsWidget(self)
return self
end
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion)
end
 
do
do
local widgetType = "LSM30_Sound"
local widgetVersion = 2
 
local widgetVersion = 3
 
local function AddListItem(self, value, text)
local item = AceGUI:Create("LSM30_Sound_Item_Select")
item:SetText(text)
233,11 → 233,17
item:SetCallback("OnValueChanged", OnItemValueChanged)
self.pullout:AddItem(item)
end
 
local sortlist = {}
 
local function SetList(self, list)
self.list = list or Media:HashTable("sound")
self.pullout:Clear()
if self.multiselect then
AddCloseButton()
end
end
 
local sortlist = {}
local function ParseListItems(self)
for v in pairs(self.list) do
sortlist[#sortlist + 1] = v
end
246,16 → 252,21
AddListItem(self, value, value)
sortlist[i] = nil
end
if self.multiselect then
AddCloseButton()
end
end
 
 
local function Constructor()
local self = AceGUI:Create("Dropdown")
self.type = widgetType
self.SetList = SetList
self.SetValue = AceGUISharedMediaWidgets.SetValue
 
local clickscript = self.button:GetScript("OnClick")
self.button:SetScript("OnClick", function(...)
self.pullout:Clear()
ParseListItems(self)
clickscript(...)
end)
 
return self
end
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion)
StatusbarWidget.lua
8,7 → 8,7
local min, max, floor = math.min, math.max, math.floor
local fixlevels = AceGUISharedMediaWidgets.fixlevels
local OnItemValueChanged = AceGUISharedMediaWidgets.OnItemValueChanged
 
 
do
local widgetType = "LSM30_Statusbar_Item_Select"
local widgetVersion = 1
35,10 → 35,10
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion)
end
 
do
do
local widgetType = "LSM30_Statusbar"
local widgetVersion = 2
 
local widgetVersion = 3
 
local function SetText(self, text)
if text and text ~= '' then
self.texture:SetTexture(Media:Fetch('statusbar',text))
46,7 → 46,7
end
self.text:SetText(text or "")
end
 
 
local function AddListItem(self, value, text)
local item = AceGUI:Create("LSM30_Statusbar_Item_Select")
item:SetText(text)
55,11 → 55,17
item:SetCallback("OnValueChanged", OnItemValueChanged)
self.pullout:AddItem(item)
end
 
local sortlist = {}
 
local function SetList(self, list)
self.list = list or Media:HashTable("statusbar")
self.pullout:Clear()
if self.multiselect then
AddCloseButton()
end
end
 
local sortlist = {}
local function ParseListItems(self)
for v in pairs(self.list) do
sortlist[#sortlist + 1] = v
end
68,26 → 74,31
AddListItem(self, value, value)
sortlist[i] = nil
end
if self.multiselect then
AddCloseButton()
end
end
 
 
local function Constructor()
local self = AceGUI:Create("Dropdown")
self.type = widgetType
self.SetText = SetText
self.SetList = SetList
self.SetValue = AceGUISharedMediaWidgets.SetValue
 
 
local left = _G[self.dropdown:GetName() .. "Left"]
local middle = _G[self.dropdown:GetName() .. "Middle"]
local right = _G[self.dropdown:GetName() .. "Right"]
 
 
local texture = self.dropdown:CreateTexture(nil, "ARTWORK")
texture:SetPoint("BOTTOMRIGHT", right, "BOTTOMRIGHT" ,-39, 26)
texture:SetPoint("TOPLEFT", left, "TOPLEFT", 24, -24)
self.texture = texture
 
local clickscript = self.button:GetScript("OnClick")
self.button:SetScript("OnClick", function(...)
self.pullout:Clear()
ParseListItems(self)
clickscript(...)
end)
 
return self
end
AceGUI:RegisterWidgetType(widgetType, Constructor, widgetVersion)