/trunk/VFL/UI
frame._VFL = true; |
frame._sourcePool = pool; |
frame.Destroy = GenericDestroy; |
if not frame._hookedHideShow then |
frame._hookedHideShow = true; |
hooksecurefunc(frame, "Hide", TimerHide); |
hooksecurefunc(frame, "Show", TimerShow); |
end |
--if not frame._hookedHideShow then |
-- frame._hookedHideShow = true; |
-- hooksecurefunc(frame, "Hide", TimerHide); |
-- hooksecurefunc(frame, "Show", TimerShow); |
--end |
--frame.AnimationGroup = frame:CreateAnimationGroup(); |
return frame; |
end |
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() |
-- Create window |
local dlg = VFLUI.Window:new(parent or VFLFULLSCREEN_DIALOG); |
VFLUI.Window.SetDefaultFraming(dlg, 22); |
dlg:SetBackdrop(VFLUI.BlackDialogBackdrop); |
dlg:SetTitleColor(0,0,.6); |
dlg:SetPoint("CENTER", VFLParent, "CENTER", 0, 50); |
dlg:SetText(title); |
btn2:SetScript("OnClick", OK); |
end |
dlg:SetHeight(40 + th + eh + bh); dlg:Show(); |
dlg:SetHeight(40 + th + eh + bh); dlg:SetBackdrop(VFLUI.BlackDialogBackdrop); dlg:Show(); |
dlg.Destroy = VFL.hook(function(s) |
GetEditText = nil; |
_backdrop = "none"; |
}; |
VFLUI.nilBackdrop = { |
_border = "none"; |
bgFile = nil; |
_backdrop = "none"; |
edgeFile = nil; |
}; |
local curBackdrop, clipboard = {}, nil; |
local onOK, onCancel, bdp_owner = VFL.Noop, VFL.Noop, nil; |
local UpdateBackdropPicker; |