/trunk/TipTop/libs/AceGUI-3.0-SharedMediaWidgets
do |
local widgetType = "LSM30_Font" |
local widgetVersion = 9 |
local widgetVersion = 11 |
local contentFrameCache = {} |
local function ReturnSelf(self) |
check:Hide() |
frame.check = check |
local text = frame:CreateFontString(nil,"OVERLAY","GameFontWhite") |
text:SetPoint("LEFT", check, "RIGHT", 1, 0) |
text:SetPoint("RIGHT", frame, "RIGHT", -2, 0) |
text:SetPoint("TOPLEFT", check, "TOPRIGHT", 1, 0) |
text:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -2, 0) |
text:SetJustifyH("LEFT") |
text:SetText("Test Test Test Test Test Test Test") |
frame.text = text |
else |
AceGUI:SetFocus(self) |
self.dropdown = AGSMW:GetDropDownFrame() |
local width = self.frame:GetWidth() |
self.dropdown:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT") |
self.dropdown:SetPoint("TOPRIGHT", self.frame, "BOTTOMRIGHT", width < 160 and (160 - width) or 0, 0) |
for k, v in pairs(self.list) do |
sortedlist[#sortedlist+1] = k |
end |
do |
local widgetType = "LSM30_Sound" |
local widgetVersion = 9 |
local widgetVersion = 11 |
local contentFrameCache = {} |
local function ReturnSelf(self) |
local function ContentSpeakerOnClick(this, button) |
local self = this.frame.obj |
local sound = this.frame.text:GetText() |
PlaySoundFile(self.list[sound] ~= sound and self.list[sound] or Media:Fetch('sound',sound)) |
PlaySoundFile(self.list[sound] ~= sound and self.list[sound] or Media:Fetch('sound',sound), "Master") |
end |
local function GetContentLine() |
frame.speakeron = speakeron |
local text = frame:CreateFontString(nil,"OVERLAY","GameFontWhite") |
text:SetPoint("LEFT", check, "RIGHT", 1, 0) |
text:SetPoint("RIGHT", soundbutton, "LEFT", -2, 0) |
text:SetPoint("TOPLEFT", check, "TOPRIGHT", 1, 0) |
text:SetPoint("BOTTOMRIGHT", soundbutton, "BOTTOMLEFT", -2, 0) |
text:SetJustifyH("LEFT") |
text:SetText("Test Test Test Test Test Test Test") |
frame.text = text |
else |
AceGUI:SetFocus(self) |
self.dropdown = AGSMW:GetDropDownFrame() |
local width = self.frame:GetWidth() |
self.dropdown:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT") |
self.dropdown:SetPoint("TOPRIGHT", self.frame, "BOTTOMRIGHT", width < 160 and (160 - width) or 0, 0) |
for k, v in pairs(self.list) do |
sortedlist[#sortedlist+1] = k |
end |
local function WidgetPlaySound(this) |
local self = this.obj |
local sound = self.frame.text:GetText() |
PlaySoundFile(self.list[sound] ~= sound and self.list[sound] or Media:Fetch('sound',sound)) |
PlaySoundFile(self.list[sound] ~= sound and self.list[sound] or Media:Fetch('sound',sound), "Master") |
end |
local function Constructor() |
do |
local widgetType = "LSM30_Statusbar" |
local widgetVersion = 9 |
local widgetVersion = 11 |
local contentFrameCache = {} |
local function ReturnSelf(self) |
local font, size = text:GetFont() |
text:SetFont(font,size,"OUTLINE") |
text:SetPoint("LEFT", check, "RIGHT", 3, 0) |
text:SetPoint("RIGHT", frame, "RIGHT", -2, 0) |
text:SetPoint("TOPLEFT", check, "TOPRIGHT", 3, 0) |
text:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -2, 0) |
text:SetJustifyH("LEFT") |
text:SetText("Test Test Test Test Test Test Test") |
frame.text = text |
else |
AceGUI:SetFocus(self) |
self.dropdown = AGSMW:GetDropDownFrame() |
local width = self.frame:GetWidth() |
self.dropdown:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT") |
self.dropdown:SetPoint("TOPRIGHT", self.frame, "BOTTOMRIGHT", width < 160 and (160 - width) or 0, 0) |
for k, v in pairs(self.list) do |
sortedlist[#sortedlist+1] = k |
end |
frame.dropButton:SetScript("OnClick",ToggleDrop) |
frame:SetScript("OnHide", OnHide) |
local bar = frame:CreateTexture(nil, "ARTWORK") |
local bar = frame:CreateTexture(nil, "OVERLAY") |
bar:SetPoint("TOPLEFT", frame,"TOPLEFT",6,-25) |
bar:SetPoint("BOTTOMRIGHT", frame,"BOTTOMRIGHT", -21, 5) |
bar:SetAlpha(0.5) |
self.bar = bar |
self.alignoffset = 31 |
self.OnRelease = OnRelease |
self.OnAcquire = OnAcquire |
self.ClearFocus = ClearFocus |
do |
local widgetType = "LSM30_Border" |
local widgetVersion = 9 |
local widgetVersion = 11 |
local contentFrameCache = {} |
local function ReturnSelf(self) |
check:Hide() |
frame.check = check |
local text = frame:CreateFontString(nil,"OVERLAY","GameFontWhite") |
text:SetPoint("LEFT", check, "RIGHT", 1, 0) |
text:SetPoint("RIGHT", frame, "RIGHT", -2, 0) |
text:SetPoint("TOPLEFT", check, "TOPRIGHT", 1, 0) |
text:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -2, 0) |
text:SetJustifyH("LEFT") |
text:SetText("Test Test Test Test Test Test Test") |
frame.text = text |
else |
AceGUI:SetFocus(self) |
self.dropdown = AGSMW:GetDropDownFrame() |
local width = self.frame:GetWidth() |
self.dropdown:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT") |
self.dropdown:SetPoint("TOPRIGHT", self.frame, "BOTTOMRIGHT", width < 160 and (160 - width) or 0, 0) |
for k, v in pairs(self.list) do |
sortedlist[#sortedlist+1] = k |
end |
do |
local widgetType = "LSM30_Background" |
local widgetVersion = 9 |
local widgetVersion = 11 |
local contentFrameCache = {} |
local function ReturnSelf(self) |
frame:SetHighlightTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]], "ADD") |
frame:SetScript("OnClick", ContentOnClick) |
frame:SetScript("OnEnter", ContentOnEnter) |
local check = frame:CreateTexture("OVERLAY") |
check:SetWidth(16) |
check:SetHeight(16) |
check:SetTexture("Interface\\Buttons\\UI-CheckBox-Check") |
check:Hide() |
frame.check = check |
local text = frame:CreateFontString(nil,"OVERLAY","GameFontWhite") |
local font, size = text:GetFont() |
text:SetFont(font,size,"OUTLINE") |
text:SetPoint("LEFT", check, "RIGHT", 1, 0) |
text:SetPoint("RIGHT", frame, "RIGHT", -2, 0) |
text:SetPoint("TOPLEFT", check, "TOPRIGHT", 1, 0) |
text:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -2, 0) |
text:SetJustifyH("LEFT") |
text:SetText("Test Test Test Test Test Test Test") |
frame.text = text |
frame.ReturnSelf = ReturnSelf |
end |
frame:Show() |
else |
AceGUI:SetFocus(self) |
self.dropdown = AGSMW:GetDropDownFrame() |
local width = self.frame:GetWidth() |
self.dropdown:SetPoint("TOPLEFT", self.frame, "BOTTOMLEFT") |
self.dropdown:SetPoint("TOPRIGHT", self.frame, "BOTTOMRIGHT", width < 160 and (160 - width) or 0, 0) |
for k, v in pairs(self.list) do |
sortedlist[#sortedlist+1] = k |
end |
local DataVersion = 9001 -- dev version always overwrites everything else :) |
--@end-debug@]===] |
--@non-debug@ |
local DataVersion = 42 |
local DataVersion = 54 |
--@end-non-debug@ |
local AGSMW = LibStub:NewLibrary("AceGUISharedMediaWidgets-1.0", DataVersion) |
local frame = CreateFrame("Frame", nil, UIParent) |
frame:SetHeight(44) |
frame:SetWidth(200) |
frame:SetPoint("CENTER", UIParent, "CENTER") |
local label = frame:CreateFontString(nil,"OVERLAY","GameFontNormalSmall") |
label:SetPoint("TOPLEFT",frame,"TOPLEFT",0,0) |
DLeft:SetTexture([[Interface\Glues\CharacterCreate\CharacterCreate-LabelFrame]]) |
DLeft:SetTexCoord(0, 0.1953125, 0, 1) |
frame.DLeft = DLeft |
local DRight = frame:CreateTexture(nil, "ARTWORK") |
DRight:SetWidth(25) |
DRight:SetHeight(64) |
DRight:SetTexture([[Interface\Glues\CharacterCreate\CharacterCreate-LabelFrame]]) |
DRight:SetTexCoord(0.8046875, 1, 0, 1) |
frame.DRight = DRight |
local DMiddle = frame:CreateTexture(nil, "ARTWORK") |
DMiddle:SetHeight(64) |
DMiddle:SetPoint("TOP", DLeft, "TOP") |
local function AddFrame(self, frame) |
frame:SetParent(self.contentframe) |
local strata = self:GetFrameStrata() |
frame:SetFrameStrata(strata) |
local level = self:GetFrameLevel() + 100 |
frame:SetFrameLevel(level) |
frame:SetFrameStrata(self:GetFrameStrata()) |
frame:SetFrameLevel(self:GetFrameLevel() + 100) |
if next(self.contentRepo) then |
frame:SetPoint("TOPLEFT", self.contentRepo[#self.contentRepo], "BOTTOMLEFT", 0, 0) |
frame:SetPoint("RIGHT", self.contentframe, "RIGHT", 0, 0) |
frame:SetPoint("RIGHT", self.contentframe, "RIGHT", 0, 0) |
self.contentRepo[1] = frame |
end |
if self.contentframe:GetHeight() > UIParent:GetHeight()*2/5 - 20 then |
self.scrollframe:SetWidth(146) |
self.scrollframe:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -28, 12) |
self:SetHeight(UIParent:GetHeight()*2/5) |
self.slider:Show() |
self:SetScript("OnMouseWheel", OnMouseWheel) |
self.scrollframe:UpdateScrollChildRect() |
self.slider:SetMinMaxValues(0, self.contentframe:GetHeight()-self.scrollframe:GetHeight()) |
else |
self.scrollframe:SetWidth(160) |
self.scrollframe:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", -14, 12) |
self:SetHeight(self.contentframe:GetHeight()+25) |
self.slider:Hide() |
self:SetScript("OnMouseWheel", nil) |
contentframe:SetWidth(160) |
contentframe:SetHeight(0) |
frame.contentframe = contentframe |
local scrollframe = CreateFrame("ScrollFrame", nil, frame) |
scrollframe:SetWidth(160) |
scrollframe:SetPoint("TOPLEFT", frame, "TOPLEFT", 14, -13) |
scrollframe:SetPoint("BOTTOM", frame, "BOTTOM", 0, 12) |
scrollframe:SetWidth(160) |
scrollframe:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -14, 12) |
scrollframe:SetScrollChild(contentframe) |
frame.scrollframe = scrollframe |
contentframe:SetPoint("TOPLEFT", scrollframe) |
contentframe:SetPoint("TOPRIGHT", scrollframe) |
local bgTex = frame:CreateTexture(nil, "ARTWORK") |
bgTex:SetAllPoints(scrollframe) |
frame.bgTex = bgTex |
frame.AddFrame = AddFrame |
frame.ClearFrames = ClearFrames |
frame.contentRepo = {} -- store all our frames in here so we can get rid of them later |
local slider = CreateFrame("Slider", nil, scrollframe) |
slider:SetOrientation("VERTICAL") |
slider:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -14, -10) |