/trunk/RDX/Raid/RaidStatus
local inst = RDXDB.GetObjectInstance(path); |
local dlg = VFLUI.Window:new(parent or VFLDIALOG); |
local dlg = VFLUI.Window:new(parent); |
VFLUI.Window.SetDefaultFraming(dlg, 22); |
dlg:SetTitleColor(0,0,.6); |
dlg:SetBackdrop(VFLUI.BlackDialogBackdrop); |
dlg:SetWidth(316); dlg:SetHeight(357); |
dlg:SetText("Edit Statistic: " .. path); |
dlg:Show(); |
VFLUI.Window.StdMove(dlg, dlg:GetTitleBar()); |
local sf = VFLUI.VScrollFrame:new(dlg); |
sf:SetWidth(290); sf:SetHeight(300); |
------------------- DESTRUCTORS |
local esch = function() dlg:Destroy(); end |
VFL.AddEscapeHandler(esch); |
local btnClose = VFLUI.CloseButton:new(dlg); |
dlg:AddButton(btnClose); |
btnClose:SetScript("OnClick", function() VFL.EscapeTo(esch); end); |
local btnOK = VFLUI.OKButton:new(dlg); |
btnOK:SetText("OK"); btnOK:SetHeight(25); btnOK:SetWidth(75); |
btnOK:SetPoint("BOTTOMRIGHT", dlg:GetClientArea(), "BOTTOMRIGHT"); |
btnOK:Show(); |
btnOK:SetScript("OnClick", function() |
local function Save() |
desc.name = ed_name.editBox:GetText(); |
desc.color = swatch_c:GetColor(); |
desc.fadeColor = swatch_fc:GetColor(); |
inst:LoadDescriptor(desc); inst:Compute(); |
end |
VFL.EscapeTo(esch); |
end); |
end |
local savebtn = VFLUI.SaveButton:new() |
savebtn:SetScript("OnClick", Save); |
dlg:AddButton(savebtn); |
local closebtn = VFLUI.CloseButton:new(dlg); |
closebtn:SetScript("OnClick", function() VFL.EscapeTo(esch); end); |
dlg:AddButton(closebtn); |
dlg.Destroy = VFL.hook(function(s) |
sf:SetScrollChild(nil); |
ui:Destroy(); ui = nil; |
sf:Destroy(); sf = nil; |
btnOK:Destroy(); btnOK = nil; |
end, dlg.Destroy); |
end |
text = "Edit...", |
OnClick = function() |
VFL.poptree:Release(); |
RDXRS.StatisticEditor(parent, path, md) |
RDXRS.StatisticEditor(dlg, path, md) |
end |
}); |
end; |