/trunk/Bear in Mind/libs/AceConfig-3.0/AceConfigDialog-3.0
--- AceConfigDialog-3.0 generates AceGUI-3.0 based windows based on option tables. |
-- @class file |
-- @name AceConfigDialog-3.0 |
-- @release $Id: AceConfigDialog-3.0.lua 1139 2016-07-03 07:43:51Z nevcairiel $ |
-- @release $Id: AceConfigDialog-3.0.lua 1169 2018-02-27 16:18:28Z nevcairiel $ |
local LibStub = LibStub |
local MAJOR, MINOR = "AceConfigDialog-3.0", 61 |
local gui = LibStub("AceGUI-3.0") |
local reg = LibStub("AceConfigRegistry-3.0") |
local MAJOR, MINOR = "AceConfigDialog-3.0", 66 |
local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceConfigDialog then return end |
AceConfigDialog.frame.closing = AceConfigDialog.frame.closing or {} |
AceConfigDialog.frame.closeAllOverride = AceConfigDialog.frame.closeAllOverride or {} |
local gui = LibStub("AceGUI-3.0") |
local reg = LibStub("AceConfigRegistry-3.0") |
-- Lua APIs |
local tconcat, tinsert, tsort, tremove, tsort = table.concat, table.insert, table.sort, table.remove, table.sort |
local strmatch, format = string.match, string.format |
end |
end |
local function validationErrorPopup(message) |
if not StaticPopupDialogs["ACECONFIGDIALOG30_VALIDATION_ERROR_DIALOG"] then |
StaticPopupDialogs["ACECONFIGDIALOG30_VALIDATION_ERROR_DIALOG"] = {} |
end |
local t = StaticPopupDialogs["ACECONFIGDIALOG30_VALIDATION_ERROR_DIALOG"] |
t.text = message |
t.button1 = OKAY |
t.preferredIndex = STATICPOPUP_NUMDIALOGS |
local dialog, oldstrata |
t.OnAccept = function() |
if dialog and oldstrata then |
dialog:SetFrameStrata(oldstrata) |
end |
end |
t.timeout = 0 |
t.whileDead = 1 |
t.hideOnEscape = 1 |
dialog = StaticPopup_Show("ACECONFIGDIALOG30_VALIDATION_ERROR_DIALOG") |
if dialog then |
oldstrata = dialog:GetFrameStrata() |
dialog:SetFrameStrata("TOOLTIP") |
end |
end |
local function ActivateControl(widget, event, ...) |
--This function will call the set / execute handler for the widget |
--widget:GetUserDataTable() contains the needed info |
end |
local rootframe = user.rootframe |
if type(validated) == "string" then |
--validate function returned a message to display |
if rootframe.SetStatusText then |
rootframe:SetStatusText(validated) |
else |
-- TODO: do something else. |
end |
PlaySound("igPlayerInviteDecline") |
del(info) |
return true |
elseif not validated then |
--validate returned false |
if rootframe.SetStatusText then |
if not validated or type(validated) == "string" then |
if not validated then |
if usage then |
rootframe:SetStatusText(name..": "..usage) |
validated = name..": "..usage |
else |
if pattern then |
rootframe:SetStatusText(name..": Expected "..pattern) |
validated = name..": Expected "..pattern |
else |
rootframe:SetStatusText(name..": Invalid Value") |
validated = name..": Invalid Value" |
end |
end |
end |
-- show validate message |
if rootframe.SetStatusText then |
rootframe:SetStatusText(validated) |
else |
-- TODO: do something else |
validationErrorPopup(validated) |
end |
PlaySound("igPlayerInviteDecline") |
PlaySound(882) -- SOUNDKIT.IG_PLAYER_INVITE_DECLINE || _DECLINE is actually missing from the table |
del(info) |
return true |
else |
entry.value = k |
entry.text = GetOptionsMemberValue("name", v, options, path, appName) |
entry.icon = GetOptionsMemberValue("icon", v, options, path, appName) |
entry.iconCoords = GetOptionsMemberValue("iconCoords", v, options, path, appName) |
entry.disabled = CheckOptionDisabled(v, options, path, appName) |
tinsert(tree,entry) |
if recurse and (v.childGroups or "tree") == "tree" then |
radio:SetWidth(width_multiplier * 2) |
elseif width == "half" then |
radio:SetWidth(width_multiplier / 2) |
elseif (type(width) == "number") then |
radio:SetWidth(width_multiplier * width) |
elseif width == "full" then |
radio.width = "fill" |
else |
control:SetWidth(width_multiplier * 2) |
elseif width == "half" then |
control:SetWidth(width_multiplier / 2) |
elseif (type(width) == "number") then |
control:SetWidth(width_multiplier * width) |
elseif width == "full" then |
control.width = "fill" |
else |
check:SetWidth(width_multiplier * 2) |
elseif width == "half" then |
check:SetWidth(width_multiplier / 2) |
elseif (type(width) == "number") then |
control:SetWidth(width_multiplier * width) |
elseif width == "full" then |
check.width = "fill" |
else |
control:SetWidth(width_multiplier * 2) |
elseif width == "half" then |
control:SetWidth(width_multiplier / 2) |
elseif (type(width) == "number") then |
control:SetWidth(width_multiplier * width) |
elseif width == "full" then |
control.width = "fill" |
else |
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ |
..\FrameXML\UI.xsd"> |
<Script file="AceConfigDialog-3.0.lua"/> |
</Ui> |