Added basalt.getElementClass(name)

Added Graph
Added List:getSelectedItem()
Fixed Image:addFrame()
This commit is contained in:
Robert Jelic
2025-03-03 17:38:30 +01:00
parent 21f16996e7
commit 373bd7b485
4 changed files with 91 additions and 4 deletions

View File

@@ -99,6 +99,19 @@ function List:getSelectedItems()
return selected
end
--- Gets first selected item
--- @shortDescription Gets first selected item
--- @return table? selected The first item
function List:getSelectedItem()
local items = self.get("items")
for i, item in ipairs(items) do
if type(item) == "table" and item.selected then
return item
end
end
return nil
end
--- @shortDescription Handles mouse click events
--- @param button number The mouse button that was clicked
--- @param x number The x-coordinate of the click