First thanks for the addon. I'm wondering why you prevent a item from being selected twice? If you can comment this out, I use it to expand or collapse a tree menu I've built.
Code:
local function SetSelectedIndex(self, index, silent)
if index == self.selectedIndex then
--Commented this line so we can select the same item twice and trigger tree menu collapses and expansions
--return
end
Also in function Library.LibSimpleWidgets.Layout(configTable, parent) can you replace this line
local useOffsets = false
local XOffset = config.xoffset or 0
local YOffset = config.yoffset or 0
if config.xoffset ~= nil or config.yoffset ~= nil then
widget:SetPoint("TOPLEFT", parent, "TOPLEFT", XOffset, YOffset)
else
widget:SetPoint("TOPLEFT", parent, "TOPLEFT", nextX + spacing + leftCompensation, nextY + spacing + topCompensation)
end
It gives us full x,y control over widget placement to bypass the column stuff if needed.
"Items are not allowed to be reselected because that can cause event notification loops if the ItemSelect or SelectionChange event handlers call SetSelected* again."
Ya I've already done that but it's pretty obvious to the programmer when you do it. I don't think the lib should prevent it. We may need to do other things on the second select.
"Why are you using it if you want to manually position your widgets?"
To take advantage of the other layout features, tooltip, layer, label without having to create all the frames for those. I created a simple button but I don't want it in the column layout. It needs to be positioned somewhere else.
The major feature of the Layout function is that it calculates the positioning and sizing of the widgets automatically. Why are you using it if you want to manually position your widgets?
Items are not allowed to be reselected because that can cause event notification loops if the ItemSelect or SelectionChange event handlers call SetSelected* again. What I can do is add an ItemClick event which is fired when the user clicks on an item.