Thread Tools Display Modes
Prev Previous Post   Next Post Next
05/01/14, 11:54 AM   #1
Grischu
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5
fail to change width of a dropdown Control

I create a dropdown controll and try to create it with this code


validChoices= BB.CharacterListe()
local dropdown = WINDOW_MANAGER:CreateControlFromVirtual(controlName.."ToonName", LeftFrame, "ZO_Options_Dropdown")
BB.dropdown=dropdown
dropdown:ClearAnchors()
dropdown:SetAnchor(TOP, toonlabel, BOTTOM, 0, 1)
dropdown:SetHidden(false)
dropdown.text = "Toon"
dropdown.valid = validChoices


local dropmenu = ZO_ComboBox_ObjectFromContainer(GetControl(dropdown, "Dropdown"))
ZO_PreHookHandler(dropmenu.m_selectedItemText, "OnTextChanged", function(self)
if dropmenu.m_selectedItemData then
selectedName = dropmenu.m_selectedItemData.name
dropmenu.m_selectedItemText.SetText(self, selectedName)
BB.SetToon(selectedName)
end
end)
dropdown:SetHandler("OnShow", function()
dropmenu:SetSelectedItem(validChoices)
end)

local function OnItemSelect(_, name, choice)
BB.SetToon(name)
end

for i=1,#validChoices do
local entry = dropmenu:CreateItemEntry(validChoices[i], OnItemSelect)
dropmenu:AddItem(entry)
end
i tried it with

dropdown.SetWidth(100)
or

local childs = dropdown.GetChildren()
for x, obj in pairs(childs) do
obj.SetWidth(100)
end
the last one raises a error, the other one has no effect.

Can anyone help me out, please.

Last edited by Grischu : 05/01/14 at 11:59 AM.
  Reply With Quote
 

ESOUI » Developer Discussions » Lua/XML Help » fail to change width of a dropdown Control


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off