• 0

    posted a message on Widget positioning with AceGUI
    Registering a new layout to use in a container worked like a charm, thanks! I didn't make it fully functional, so adding too many widgets to a container with that layout will have odd behavior, but it works fine for my purposes.
    Posted in: Ace3
  • 0

    posted a message on Widget positioning with AceGUI
    Sorry for all the various questions, but I really am making progress I swear! :)

    Question: How do I make the widgets go where I want them to? I'd like two buttons (in the code below, "save" and "cancel") to be in the bottom right of my dialog box. I've tried making dummy groups to try and trick the "Flow" layout into putting them there, but it isn't working for me. I've tried button:ClearAllPoints() and then button:SetPoint(...) but this sometimes fails (when giving it 5 arguments, like I've done elsewhere) or does nothing at all (when I give it 3 arguments).

    Here's the relevant section of my code:
    function Timer:changeTimer()
        -- Create a container frame
        self.configFrame = AceGUI:Create("Frame")
        local f = self.configFrame
        f:SetWidth(400)
        f:SetHeight(320)
        f:Show()
        f:SetTitle("Timer Configuration")
        f:SetLayout("Flow")
        f.statusbg:Hide()                                               -- We will need to undo this when we return the widget to the pool!
        f.closebutton:Hide()                                            -- We will need to undo this when we return the widget to the pool!
        f:SetCallback("OnClose",function(widget) AceGUI:Release(widget) end)
        local ddg = AceGUI:Create("DropdownGroup")
        ddg:SetTitle("Timer Type")
        ddg:SetFullWidth(true)
        ddg:SetLayout("List")
        local timerTypes = {
            [L["Cooldown"]] = L["Cooldown"],
            [L["Buff"]] = L["Buff/Debuff"],
            [L["Empty"]] = L["Empty"],
        }
        ddg:SetDropdownWidth(120)
        ddg:SetGroupList(timerTypes)
        local selfref = self
        ddg:SetCallback("OnGroupSelected",function (self,event,selection)
            selfref:changeTimerDependant(ddg,selection)
        end)
        ddg:SetGroup("Buff")
        
        --[[
        local spacer = AceGUI:Create("SimpleGroup")
        spacer:SetFullWidth(true)
        spacer:SetLayout("Flow")
        local space = AceGUI:Create("SimpleGroup")
        space:SetRelativeWidth(0.6)
        ]]
        local save = AceGUI:Create("Button")
        save:SetText("Save")
        save:SetWidth(60)
        save:SetHeight(20)
        
        local cancel = AceGUI:Create("Button")
        cancel:SetText("Cancel")
        cancel:SetWidth(80)
        cancel:SetHeight(20)
        
        --spacer:AddChildren(space,save,cancel)
        
        f:AddChildren(ddg,save,cancel)
        cancel:ClearAllPoints()
        cancel:SetPoint("BOTTOMRIGHT",0,0)
    end
    
    function Timer:changeTimerDependant(ddg,type)
        if not self.configFrame then Clash:Print("in Timer:changeTimerDependant: no configFrame"); return end
        ddg:ReleaseChildren()
        local label = AceGUI:Create("Label")
        label:SetFontObject("GameFontNormalSmall")
        label:SetColor(0.9,0.9,0.9)
        label:SetFullWidth(true)
        local typeGroup = AceGUI:Create("SimpleGroup")
        typeGroup:SetFullWidth(true)
        if type == "Cooldown" then
            label:SetText("\nThis timer type keeps track of the cooldown on one of you or your pet's spells or an item.\n")
            
            local box = AceGUI:Create("EditBox")
            box:SetLabel("Spell or Item Name:")
            
            local targLabel = AceGUI:Create("Label")
            targLabel:SetFontObject("GameFontNormalSmall")
            targLabel:SetColor(1,0.82,0)
            targLabel:SetText("\nAbility of:")
                    
            local targGroup = AceGUI:Create("SimpleGroup")
            targGroup:SetFullWidth(true)
            targGroup:SetLayout("Flow")
            local rSelf = AceGUI:Create("CheckBox")
            rSelf:SetType("radio")
            rSelf:SetValue(true)
            rSelf:SetLabel("Self")
            rSelf:SetRelativeWidth(0.15)
            rSelf:SetHeight(16)
            local rPet = AceGUI:Create("CheckBox")
            rPet:SetType("radio")
            rPet:SetValue(false)
            rPet:SetLabel("Pet")
            rPet:SetRelativeWidth(0.15)
            rPet:SetHeight(16)
            local globalCheck = AceGUI:Create("CheckBox")
            globalCheck:SetValue(false)
            globalCheck:SetLabel("Account for global cooldown")
            globalCheck:SetWidth(220)
            
            globalCheck:SetCallback("OnEnter",function(widget)
                GameTooltip:SetOwner(widget.frame, "ANCHOR_TOPRIGHT")
                local desc = L["globalCheck mouseover"]
                GameTooltip:SetText(desc, 1, 1, 1, 1)
            end)
            globalCheck:SetCallback("OnLeave",function() GameTooltip:Hide() end)
            
            targGroup:AddChildren(rSelf,rPet,globalCheck)        
            typeGroup:AddChildren(box,targLabel,targGroup)
        elseif type == "Buff" then
            label:SetText("\nThis timer type keeps track of a buff or debuff on a particular target.\n")
            
            local box = AceGUI:Create("EditBox")
            box:SetLabel("Effect Name:")
            
            local targLabel = AceGUI:Create("Label")
            targLabel:SetFontObject("GameFontNormalSmall")
            targLabel:SetColor(1,0.8,0)
            targLabel:SetText("\nEffect on:")
            
            local targGroup = AceGUI:Create("SimpleGroup")
            targGroup:SetFullWidth(true)
            targGroup:SetLayout("Flow")
            local rTarget = AceGUI:Create("CheckBox")
            rTarget:SetType("radio")
            rTarget:SetValue(true)
            rTarget:SetLabel("Target")
            rTarget:SetRelativeWidth(0.2)
            rTarget:SetHeight(15)
            local rFocus = AceGUI:Create("CheckBox")
            rFocus:SetType("radio")
            rFocus:SetValue(false)
            rFocus:SetLabel("Focus")
            rFocus:SetRelativeWidth(0.2)
            rFocus:SetHeight(15)
            local rSelf = AceGUI:Create("CheckBox")
            rSelf:SetType("radio")
            rSelf:SetValue(false)
            rSelf:SetLabel("Self")
            rSelf:SetRelativeWidth(0.15)
            rSelf:SetHeight(15)
            local rPet = AceGUI:Create("CheckBox")
            rPet:SetType("radio")
            rPet:SetValue(false)
            rPet:SetLabel("Pet")
            rPet:SetRelativeWidth(0.15)
            rPet:SetHeight(15)
            local rCustGroup = AceGUI:Create("SimpleGroup")
            rCustGroup:SetLayout("Flow")
            local rCustom = AceGUI:Create("CheckBox")
            rCustom:SetType("radio")
            rCustom:SetValue(false)
            rCustom:SetLabel("Custom:")
            rCustom:SetRelativeWidth(0.25)
            rCustom:SetHeight(15)
            local custBox = AceGUI:Create("EditBox")
            custBox:SetPoint("LEFT",0,0)
            custBox:SetDisabled(not rCustom:GetValue())
            custBox:SetWidth(150)
            rCustGroup:AddChildren(rCustom,custBox)
            targGroup:AddChildren(rTarget,rFocus,rSelf,rPet,rCustGroup)        
            typeGroup:AddChildren(box,targLabel,targGroup)
        elseif type == "Empty" then
            label:SetText("\nAn Empty timer can act as a spacer between other timers.\n")
        end
        
        ddg:AddChildren(label,typeGroup)
    end


    If you want to slog through the whole thing, it's here: http://pastey.net/129697

    Background: I've been using AceGUI to create an object config menu to call from a prototype, that is separate from the base addon's config menu. I decided to use AceGUI directly instead of AceConfigDialog because I wanted the added flexibility and I couldn't quite figure out how to call a ConfigDialog window up and still have it function properly when a derived object opens it.
    Posted in: Ace3
  • 0

    posted a message on AceGUI CheckBox widget has poor radio button values
    Ah, no, I have the beta version. I'll check it out, thanks.
    Posted in: Ace3
  • 0

    posted a message on AceGUI CheckBox widget has poor radio button values
    The WoW radio button as seen in its native habitat (see the Create Auction window at the Auction House) is smaller than its check box cousins. The CheckBox widget for AceGUI does not account for this. It also has an incorrect TexCoord value for the "check" texture--the active radio button should have a small yellow circle, not a large blue one.

    I may be an Ace noob, but I'm an OCD Ace noob ;) Is this something an Ace guru should fix, or should I submit code changes? And if the latter, to where/whom and how does it get peer-reviewed?

    Thanks!
    Posted in: Ace3
  • 0

    posted a message on Noobish AceDB question
    Got it working. I eventually figured out that the problem was, I was creating a new table if the table in the DB object didn't exist, but that new table wasn't getting saved back to the DB because an error in the code was preventing it from reaching that step. Thanks for the help! I have more questions, but I'll write a new post as they're unrelated to this one.
    Posted in: Ace3
  • 0

    posted a message on Noobish AceDB question
    Well, for one thing, I have a table that starts with a dummy value and fills with a list of objects from there. It certainly changes, and yet the file has nothing. The only thing that seems to change is the order of entries in the profileKeys table. I am looking in the right place, correct? WTF/Account/<accountname>/SavedVariables/myaddon.lua ?

    Edit: I also tried removing that table from the defaults entirely, and adding it on first function call. Therefore in that case I'm adding "another key that isn't in the defaults" and it should save something.
    Posted in: Ace3
  • 0

    posted a message on Noobish AceDB question
    Basically... how does it work? I've read and followed the WelcomeHome tutorial (and much much more), I've read the available documentation, and I don't get it. My understanding is that you do the LibStub("AceDB-3.0"):New("database name", defaulttablename) call in the OnInitialize function, then you have this table around. And this table will be saved between sessions, with whatever you put on it.

    But that's not what's happening--when I go and look at the .lua file in my WTF folder after using my addon, it has a "profileKeys" table... and that's it. No "profiles" table, like I think it ought to have, and nothing saved between sessions. Clearly I'm missing something very important here. Or am I misinterpreting what AceDB is supposed to do for me?
    Posted in: Ace3
  • To post a comment, please or register a new account.