WoWInterface SVN PhanxConfigWidgets

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk/PhanxConfig-Panel
    from Rev 59 to Rev 129
    Reverse comparison

Rev 59 → Rev 129

PhanxConfig-Panel.lua
1,36 → 1,34
--[[--------------------------------------------------------------------
PhanxConfig-Panel
Simple background panel widget generator. Requires LibStub.
 
This library is not intended for use by other authors. Absolutely no
support of any kind will be provided for other authors using it, and
its internals may change at any time without notice.
----------------------------------------------------------------------]]
 
local MINOR_VERSION = tonumber(("$Revision$"):match("%d+"))
 
local lib, oldminor = LibStub:NewLibrary("PhanxConfig-Panel", MINOR_VERSION)
if not lib then return end
 
local panelBackdrop = {
bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16,
edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], edgeSize = 16,
insets = { left = 5, right = 5, top = 5, bottom = 5 }
}
 
function lib.CreatePanel(parent, width, height)
assert( type(parent) == "table" and parent.CreateFontString, "PhanxConfig-Panel: Parent is not a valid frame!" )
 
local frame = CreateFrame("Frame", nil, parent)
frame:SetFrameStrata(parent:GetFrameStrata())
frame:SetFrameLevel(parent:GetFrameLevel() + 1)
 
frame:SetBackdrop(panelBackdrop)
frame:SetBackdropColor(0.06, 0.06, 0.06, 0.4)
frame:SetBackdropBorderColor(0.6, 0.6, 0.6, 1)
 
frame:SetWidth(width or 1)
frame:SetHeight(height or 1)
 
return frame
end
\ No newline at end of file +--[[-------------------------------------------------------------------- + PhanxConfig-Panel + Simple background panel widget generator. Requires LibStub. + + This library is not intended for use by other authors. Absolutely no + support of any kind will be provided for other authors using it, and + its internals may change at any time without notice. +----------------------------------------------------------------------]] + +local MINOR_VERSION = tonumber(strmatch("$Revision$", "%d+")) + +local lib, oldminor = LibStub:NewLibrary("PhanxConfig-Panel", MINOR_VERSION) +if not lib then return end + +local panelBackdrop = { + bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tile = true, tileSize = 16, + edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]], edgeSize = 16, + insets = { left = 5, right = 5, top = 5, bottom = 5 } +} + +function lib:New(parent, width, height) + assert(type(parent) == "table" and type(rawget(parent, 0)) == "userdata", "PhanxConfig-Panel: Parent is not a valid frame!") + + local frame = CreateFrame("Frame", nil, parent) + frame:SetBackdrop(panelBackdrop) + frame:SetBackdropColor(0.06, 0.06, 0.06, 0.4) + frame:SetBackdropBorderColor(0.6, 0.6, 0.6, 1) + + frame:SetSize(width or 1, height or 1) + + return frame +end + +function lib.CreatePanel(...) return lib:New(...) end \ No newline at end of file Property changes : Added: svn:eol-style + native