• 0

    posted a message on AceConfigDialog and AceConfigRegistry
    You are persistent and stubborn developers :)

    I found another solution:
    [PHP]
    local optionTable = {
    dialogControl = "Anchor",
    values = setmetatable({},
    {
    __index = function(self,k)
    if(k == "__settings") then
    local settings = {
    -- Any aditional settings.
    -- Initalization on SetList call
    };
    return settings;
    else
    return true;
    end
    end
    } ),
    type="select",
    }

    function widget:SetList(values)
    local settings = values["__settings"];
    if(settings) then
    -- custom control initalization
    end
    end,
    [/PHP]

    for any key(values[key]) values will return true. If key is "__settings" values will return settings table.
    Posted in: Ace3
  • 0

    posted a message on AceConfigDialog and AceConfigRegistry
    Quote from Nevcairiel
    You can use a type = inpu custom widget, it allows any and all values without any validation (unless you request one).

    We will not add a custom widget type. The option table is not only for Dialog controls, but for slash commands as well (as well as any other consumer of the table).

    Note that we do not allow shipping of a modified library without you changing its name. So should you insist on creating a forked version, you need to change the name (not only the version number). I still discourage you from doing that in the first place, however.

    Solution will not work because of another validation rule:
    if type(text) ~= "string" then
    	text = ""
    end

    :( I understand that any changes in the native library require LibStab name changes.

    But i still not understand how custom widgets can hurt slash commands mechanism.
    GetValue and SetValue from custom widget works like the other command types. In general - all code from AceConfigRegistry is custom representation of the Lua table with strongly typed interfaces, so i do not see big difference between select/heading/etc and custom type.

    Please, explain me where do I wrong.

    Also your solution is hack(not standart usage) :( So for same reason it can hurt slash commands mechanism.

    PS: It is bad to give other users(developers) custom control(my) with not logical API(like SetText method for table assignment)
    Posted in: Ace3
  • 0

    posted a message on AceConfigDialog and AceConfigRegistry
    Here is working code:
    file: AceConfigDialog-3.0
    insert after line:1232

    elseif v.type == "custom" then
    	local controlType = v.dialogControl or v.control;
    	control = gui:Create(controlType);
    	local value = GetOptionsMemberValue("get",v, options, path, appName)
    	if(v.settings) then
            	control:InitializeSettings(v.settings);
            end
    	control:SetValue(value)
    	control:SetCallback("OnValueChanged", ActivateControl)


    file: AceConfigRegistry-3.0
    insert after line:96
    custom={
    	control=optstring,
    	dialogControl=optstring,
    	settings=opttable,
    },


    I just ask you to add this code into libraries release. I do not want desync libraries version with native.
    Posted in: Ace3
  • 0

    posted a message on AceConfigDialog and AceConfigRegistry
    Quote from Farmbuyer
    See this link. The functionality is already there, but somewhat limited (there is nothing like InitializeSettings, for example).


    I saw that solution, but it is not work for me because of values argument

    Library implements build in validation, this is unacceptable for me :(
    local value = GetOptionsMemberValue("get",v, options, path, appName)
    if not values[value] then
    value = nil
    end


    My control has no fixed values. SetValue/GetValue works with custom table(so i cannot set it into values before result).
    Posted in: Ace3
  • 0

    posted a message on AceConfigDialog and AceConfigRegistry
    Hello!

    Can you implement posibility to add custom controls with specific interface into OptionTable?

    For example:

    local ot =
    {
    type = "custom",
    control = "AceGUIWidget",
    settings = {--[[Custom table with key/value settings]]}
    }

    control must have standart interface:
    - GetValue():custom value
    - SetValue(custom value):nil
    - OnValueChanged -- Callback event
    - InitializeSettings(settings) -- Control initialization

    If you interested - i can send you code for libraries modifications
    Posted in: Ace3
  • To post a comment, please or register a new account.