Okay, so... ZO_Options_Dropdown is the template used for the settings menus. This includes a base frame, the options text on the left and a dropdown on the right. The actual dropdown object does inherit from ZO_ComboBox.
SO. I went through the API and all the stuff I have *ahem* and wrote this up from scratch, based on the dropdown to select your guild in the guild window. I booted up the launcher to log in to check it, but I see there's a patch. And it's downloading at about 60 kb/s at the moment. So... untested.
It's my bedtime.
Lua Code:
local wm = WINDOW_MANAGER
local choices = {"apple", "banana", "cherry"}
local myFrame = wm:CreateTopLevelWindow("myFrameForXrystal")
myFrame:SetAnchor(CENTER)
myFrame:SetDimensions(200, 50)
local dropdownContainer = wm:CreateControl("myFrameForXrystalDropdown", myFrame, CT_CONTROL)
dropdownContainer:SetHandler("OnMouseUp", ZO_ComboBox_DropdownClicked)
dropdownContainer:SetAnchor(CENTER)
local selected = wm:CreateControl("myFrameForXrystalDropdownSelected", dropdownContainer, CT_LABEL)
selected:SetAnchor(TOPLEFT)
selected:SetColor(GetInterfaceColor(INTERFACE_COLOR_TYPE_TEXT_COLORS, INTERFACE_TEXT_COLOR_SELECTED)
local open = wm:CreateControlFromVirtual("myFrameForXrystalDropdownOpen", dropdownContainer, "ZO_DropdownButton")
open:SetDimensions(16,16)
open:SetAnchor(LEFT, selected, RIGHT, 3, 0)
local dropdown = ZO_ComboBox:New(dropdownContainer)
local function OnItemSelect(entryText, entry)
d(entryText, entry)
end
for i=1,#choices do
local entry = dropdown:CreateItemEntry(choices[i], OnItemSelect) --this really just creates a table with {name = choices[i], callback = OnItemSelect} - you may be able to skip this step...
dropdown:AddItem(entry) --again, entry is just a table with the above args stored in it
end
Patch is at 10%. Guess I'll leave that running overnight... Hope this works!