View Single Post
06/02/18, 10:17 AM   #1
@tinydog
 
@tinydog's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2015
Posts: 9
Question ZO_ScrollableComboBox not modal for background controls

Greetings. I just converted some ZO_ComboBox controls in my add-on to ZO_ScrollableComboBox, and I'm experiencing a bug. The dropdown is not blocking access to the controls in the background. Buttons behind the dropped-down box are still firing rollover events (button glow and tooltip), and they are still clickable - even though they are rendered underneath the dropdown box.

I tried playing with SetDrawLayer(), SetDrawLevel(), and SetDrawTier() on the containing control, the m_combobox, the DropdownDropdown, and the DropdownDropdownBG. It has no effect on the interactability of the background controls. I even made sure that the LibAddonMenu-2.0 library embedded in my add-on is the latest version.

At least one other user experienced this same exact problem with ZO_ScrollableComboBox, back in March 2017. There were no replies on his thread.

Here is my add-on UI with the offending ZO_ScrollableComboBox:


Here is a similar ZO_ScrollableComboBox in Dolgubon's Lazy Set Crafter, that is working properly - the background controls are blocked by the dropdown:


Here is my XML code for the dropdown template control:
Code:
<Control name="tccDropdownTemplate" virtual="true" inherits="ZO_ScrollableComboBox">
	<OnInitialized>
		ZO_ScrollableComboBox:New(self)
	</OnInitialized>
</Control>
Here is the LUA code to populate create and populate the dropdown:
Code:
local itemSetDropdown = tcc_GetOrCreateControlFromVirtual(rowControl, "tccItemSetDropdown", "tccDropdownTemplate")
itemSetDropdown:SetDimensions(250, 25)
itemSetDropdown:ClearAnchors()
itemSetDropdown:SetAnchor(TOPRIGHT, rowControl, TOPRIGHT, -10, 0)
itemSetDropdown.m_comboBox:SetSortsItems(false)
itemSetDropdown.m_comboBox:SetFont("tcc_ZoFontTooltipSubtitleSmall")
local dropdown = ZO_ComboBox_ObjectFromContainer(itemSetDropdown)
local noSet
for i, itemSet in ipairs(tcc.ItemSets) do
	if itemSet.ShortName == "None" then noSet = itemSet end
	local itemEntry = dropdown:CreateItemEntry(itemSet.LongName, function() tcc_SelectItemSet(itemSet) end)
	itemEntry.ItemSet = itemSet
	dropdown:AddItem(itemEntry)
end
dropdown:SetSelectedItem("None")
Here is the utility function I use to "get or create" a template-based control:
Code:
function tcc_GetOrCreateControlFromVirtual(parent, controlName, virtualControlName)
	local child
	if parent == nil then return nil end
	if parent:GetNumChildren() > 0 then
		for i = 1, parent:GetNumChildren() do
			if parent:GetChild(i) ~= nil and parent:GetChild(i):GetName() == controlName then return parent:GetChild(i) end
		end
	end
	child = CreateControlFromVirtual(controlName, parent, virtualControlName)
	return child
end
Any insight that anyone could provide would be very much appreciated.
Attached Thumbnails
Click image for larger version

Name:	TCC Scrollable Dropdown Not Modal.jpg
Views:	825
Size:	170.0 KB
ID:	1012  Click image for larger version

Name:	Dolgubon Dropdown Working.jpg
Views:	821
Size:	130.1 KB
ID:	1013  

Last edited by @tinydog : 06/02/18 at 10:26 AM. Reason: Added code.
  Reply With Quote