WoWInterface SVN Ranch

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk/libs
    from Rev 13 to Rev 19
    Reverse comparison

Rev 13 → Rev 19

tekkonfig/tekKonfigDropdown.lua
1,5 → 1,5
 
local lib, oldminor = LibStub:NewLibrary("tekKonfig-Dropdown", 2)
local lib, oldminor = LibStub:NewLibrary("tekKonfig-Dropdown", 3)
if not lib then return end
oldminor = oldminor or 0
 
7,11 → 7,12
local GameTooltip = GameTooltip
local function HideTooltip() GameTooltip:Hide() end
local function ShowTooltip(self)
if self.tiptext then
if self.frame.tiptext then
GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT")
GameTooltip:SetText(self.tiptext, nil, nil, nil, nil, true)
GameTooltip:SetText(self.frame.tiptext, nil, nil, nil, nil, true)
end
end
local function ShowTooltip2(self) ShowTooltip(self.container) end
 
 
local function OnClick(self)
25,8 → 26,10
-- Create a dropdown.
-- All args optional, parent recommended
function lib.new(parent, label, ...)
local container = CreateFrame("Frame", nil, parent)
local container = CreateFrame("Button", nil, parent)
container:SetWidth(149+13) container:SetHeight(32+24)
container:SetScript("OnEnter", ShowTooltip)
container:SetScript("OnLeave", HideTooltip)
if select("#", ...) > 0 then container:SetPoint(...) end
 
local name = "tekKonfigDropdown"..GetTime() -- Sadly, some of these frames must be named
35,8 → 38,7
f:SetPoint("TOPLEFT", container, -13, -24)
f:EnableMouse(true)
f:SetScript("OnHide", OnHide)
f:SetScript("OnEnter", ShowTooltip)
f:SetScript("OnLeave", HideTooltip)
container.frame = f
 
local ltex = f:CreateTexture(name.."Left", "ARTWORK")
ltex:SetWidth(25) ltex:SetHeight(64)
44,18 → 46,19
ltex:SetTexture("Interface\\Glues\\CharacterCreate\\CharacterCreate-LabelFrame")
ltex:SetTexCoord(0, 0.1953125, 0, 1)
 
local rtex = f:CreateTexture(nil, "ARTWORK")
rtex:SetWidth(25) rtex:SetHeight(64)
rtex:SetPoint("RIGHT")
rtex:SetTexture("Interface\\Glues\\CharacterCreate\\CharacterCreate-LabelFrame")
rtex:SetTexCoord(0.8046875, 1, 0, 1)
 
local mtex = f:CreateTexture(nil, "ARTWORK")
mtex:SetWidth(115) mtex:SetHeight(64)
mtex:SetPoint("LEFT", ltex, "RIGHT")
mtex:SetPoint("RIGHT", rtex, "LEFT")
mtex:SetTexture("Interface\\Glues\\CharacterCreate\\CharacterCreate-LabelFrame")
mtex:SetTexCoord(0.1953125, 0.8046875, 0, 1)
 
local rtex = f:CreateTexture(nil, "ARTWORK")
rtex:SetWidth(25) rtex:SetHeight(64)
rtex:SetPoint("LEFT", mtex, "RIGHT")
rtex:SetTexture("Interface\\Glues\\CharacterCreate\\CharacterCreate-LabelFrame")
rtex:SetTexCoord(0.8046875, 1, 0, 1)
 
local text = f:CreateFontString(name.."Text", "ARTWORK", "GameFontHighlightSmall")
text:SetWidth(0) text:SetHeight(10)
text:SetPoint("RIGHT", rtex, -43, 2)
65,6 → 68,8
button:SetWidth(24) button:SetHeight(24)
button:SetPoint("TOPRIGHT", rtex, -16, -18)
button:SetScript("OnClick", OnClick)
button:SetScript("OnEnter", ShowTooltip2)
button.container = container
 
button:SetNormalTexture("Interface\\ChatFrame\\UI-ChatIcon-ScrollDown-Up")
button:SetPushedTexture("Interface\\ChatFrame\\UI-ChatIcon-ScrollDown-Down")
73,9 → 78,9
button:GetHighlightTexture():SetBlendMode("ADD")
 
local labeltext = f:CreateFontString(nil, "BACKGROUND", "GameFontNormal")--GameFontHighlight
labeltext:SetPoint("BOTTOMLEFT", f, "TOPLEFT", 16, 3)
labeltext:SetPoint("BOTTOMLEFT", container, "TOPLEFT", 16-13, 3-24)
labeltext:SetText(label)
 
return f, text, container
return f, text, container, labeltext
end