/trunk/VFL/UI/FrameClasses
if not btype then btype = "Button"; end |
local obj = VFLUI.AcquireFrame(btype, id); |
if not obj then return nil; end |
obj:SetParent(parent); |
if parent then |
obj:SetParent(parent); |
--obj:SetAllPoints(parent); |
obj:SetFrameStrata(parent:GetFrameStrata()); |
obj:SetFrameLevel(parent:GetFrameLevel() + 1); |
end |
obj:Show(); |
local framesup = VFLUI.AcquireFrame("Frame"); |
framesup:SetParent(obj); |
return obj; |
end |
VFLUI.BckButton = {}; |
function VFLUI.BckButton:new(parent, btype, id) |
if not btype then btype = "Button"; end |
local obj = VFLUI.AcquireFrame(btype, id); |
if not obj then return nil; end |
if parent then |
obj:SetParent(parent); |
obj:SetFrameStrata(parent:GetFrameStrata()); |
obj:SetFrameLevel(parent:GetFrameLevel() + 1); |
end |
obj:Show(); |
--local frbkd = VFLUI.AcquireFrame("Frame"); |
--frbkd:SetParent(obj); |
--frbkd:SetAllPoints(obj); |
--frbkd:Show(); |
--obj.frbkd = frbkd; |
-- set button skin function |
obj.SetButtonBkd = function(self, bkd) |
VFLUI.SetBackdrop(self, bkd); |
end; |
obj.bsHide = function(self) |
--self.frbkd:Hide(); |
end |
obj.bsShow = function(self) |
--self.frbkd:Show(); |
end |
obj.Destroy = VFL.hook(function(s) |
s.SetButtonBck = nil; s.bsHide = nil; s.bsShow = nil; |
--s.frbkd:Destroy(); s.frbkd = nil; |
end, obj.Destroy); |
return obj; |
end |
----------------------------------------------------- |
-- DEFAULT FRAMING |
----------------------------------------------------- |
function VFLUI.Framing.Default(self, titleHeight) |
function VFLUI.Framing.Default(self, titleHeight, bkd) |
-------------------------- WINDOW DECOR |
self:SetBackdrop(VFLUI.BlizzardDialogBackdrop); |
self:SetBackdrop(bkd or VFLUI.BlackDialogBackdrop); |
local titleBar = self:GetTitleBar(); |
titleBar:SetPoint("TOPLEFT", self, "TOPLEFT", 5, -5); |
local ca = self:GetClientArea(); |
ca:SetWidth(tw - 10); ca:SetHeight(self:GetHeight() - titleHeight - 7); |
end |
self:SetBackdrop(bkd or VFLUI.BlackDialogBackdrop); |
end |
function self:_FrameDestroy() |
end |
--- COMPAT: A lot of code uses this. |
function VFLUI.Window.SetDefaultFraming(self, titleHeight) |
self:SetFraming(VFLUI.Framing.Default, titleHeight); |
function VFLUI.Window.SetDefaultFraming(self, titleHeight, bkd) |
self:SetFraming(VFLUI.Framing.Default, titleHeight, bkd); |
end |
----------------------------------------------------- |
local ca = self:GetClientArea(); |
ca:SetWidth(tw - 2); ca:SetHeight(self:GetHeight() - 15); |
end |
--self:SetBackdrop(plainBackdrop); |
end |
function self:_FrameDestroy() |
local ca = self:GetClientArea(); |
ca:SetWidth(tw); ca:SetHeight(self:GetHeight() - 22); |
end |
--decor:SetBackdrop(VFLUI.DefaultDialogBackdrop); |
end |
function self:_FrameDestroy() |
local clientArea = self:GetClientArea(); |
clientArea:ClearAllPoints(); |
clientArea:SetPoint("TOPLEFT", decor, "TOPLEFT", 10, -10); |
clientArea:SetPoint("BOTTOMRIGHT", decor, "BOTTOMRIGHT", -10, 10); |
clientArea:SetPoint("BOTTOMRIGHT", decor, "BOTTOMRIGHT", -10, 10); |
function self:Accomodate(dx, dy) |
self:SetWidth(dx+60); self:SetHeight(dy + 60); |
end |
local ca = self:GetClientArea(); |
ca:SetWidth(tw-30); ca:SetHeight(self:GetHeight() - 30); |
end |
--decor:SetBackdrop(VFLUI.DefaultDialogBackdrop); |
end |
function self:_FrameDestroy() |