• 0

    posted a message on How to mix AceGUI widgets with Xml frames?
    I read in another thread that you could SetPoint a widget to another frame rather then adding the widget to a container frame created by AceGUI.

    My reason for wanting to use AceGUI is mainly for the way dropdowns work. I like how the dropdown list has a fixed width that equals the actual button width rather then the width of the contents.

    I've come across two choke points.

    widget:ClearAllPoints()
    widget:SetPoint("CENTER","CUSTOMFRAME",0,0)
    


    This attaches the widget to my frame created via XML but appears to be behind the frame, rendering it unclickable.

    Also, there doesn't appear to be a way to grab the actual contents of a dropdown key using AceGUI.

    Here's how I code a normal dropdown
    ActionBarAuras.ActiveScripts = {
    	onclick = function(self)
    		if (self) then
    			for k, v in pairs(ActionBarAuras.ClassTables) do
    				if (ActionBarAuras.ModSettings.Class == ActionBarAuras.ClassNames[k]) then
    					for i = 1, #v do
    						if (v[i].title == self.value) then
    							local spellname = GetSpellInfo(v[i].skill)
    							for ACTION_BAR_SLOT = 1, 120 do
    								local _, actionspellID = GetActionInfo(ACTION_BAR_SLOT)
    								local actionspellname = (actionspellID ~= nil and GetSpellInfo(actionspellID) or "")
    								if (actionspellname == spellname) then
    									local actionOK = pcall(ActionBarAuras.Bartender4_Action_Bars, ACTION_BAR_SLOT, false)
    									if (actionOK) then
    										ActionBarAuras:Bartender4_Action_Bars(ACTION_BAR_SLOT, false)
    									end
    								end
    							end
    							v[i].toggle = false
    							break
    						end
    					end
    				end
    			end
    		end
    	end,
    
    	initialize = function(self, level)
    		local info = UIDropDownMenu_CreateInfo()
    		local scripts = {}
    
    		for k, v in pairs(ActionBarAuras.ClassTables) do
    			if (ActionBarAuras.ModSettings.Class == ActionBarAuras.ClassNames[k]) then
    				for i = 1, #v do
    					if (v[i].toggle) then
    						scripts[i] = v[i].title
    					end
    				end
    			end
    		end
    		
    		for k, v in pairs(scripts) do
    			info = UIDropDownMenu_CreateInfo()
    			info.text = v
    			info.value = v
    			info.func = ActionBarAuras.ActiveScripts.onclick
    			info.notCheckable = 1
    			UIDropDownMenu_AddButton(info, level)
    		end
    	end,
    }
    


    As you can see there when using onclick, self.value returns the contents rather then the key. I use this to compare the contents in ActionBarAuras.ClassTables.

    The OnValueChanged Callback for dropdown lists in AceGUI return the key only when using key or key.value.

    So finally my three question after this monster post,

    1.) How do I properly go about adding an AceGUI widget to my custom frame?
    2.) How do I go about getting the contents of an AceGUI dropdown list when the value is changed.
    3.) If I cannot use AceGUI the way I'm describing, how do I go about fixing the normal dropdown template to have its list width equal to the button width?
    Posted in: Ace3
  • To post a comment, please or register a new account.