View Single Post
04/28/14, 09:37 PM   #1
Wykkyd
Are you Wykkyd Gaming?
 
Wykkyd's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 107
Any luck with scrolling DDLs?

I'm trying to get this code (via Xrystal and Seerah in another thread) to scroll an emote list. Basically replacing the home-grown DDL I generated for this a few versions back. The problem is the popup, or drop down, uses ZO_ComboBox and that doesn't provide scrolling support, height or width settings.

Code:
UIDDL = function( name, parent, data, selected, callBack )
    local combo = WINDOW_MANAGER:CreateControlFromVirtual( parent:GetName()..name, parent , "ZO_StatsDropdownRow" )
    combo:SetAnchor(CENTER)
    combo:GetNamedChild("Dropdown"):SetWidth(100)
 
    combo.selected = combo.name
    combo.selected:SetFont("ZoFontGame")
 
    combo.dropdown = combo.dropdown
    combo.dropdown:SetFont("ZoFontGame")
    if selected then combo.dropdown:SetSelectedItem(selected) end
 
    combo.dropdown.OnSelect = function(self,value)
	callBack( value )
    end
 
    for i = 1,#data do
        local entry = combo.dropdown:CreateItemEntry(data[i],combo.dropdown.OnSelect)
        combo.dropdown:AddItem(entry)
    end
    return combo
end
So either one of you fine people have a workaround for this or I'm going to have to jimmy the click event to display my own popup instead, which I really don't want to do. Thanks in advance folks
  Reply With Quote