Docs Update

This commit is contained in:
Robert Jelic
2025-02-18 09:46:32 +01:00
parent d821bfd6a6
commit 8b6eaccd18
33 changed files with 1477 additions and 418 deletions

View File

@@ -132,8 +132,15 @@ local function handleEvent(node, element, scope)
end
end
--- The XML plugin provides XML parsing and UI creation from XML markup
---@class BaseElement
local BaseElement = {}
--- Creates an element from an XML node
--- @shortDescription Creates element from XML node
--- @param self BaseElement The element instance
--- @param node table The XML node to create from
--- @return BaseElement self The element instance
function BaseElement:fromXML(node)
for attr, value in pairs(node.attributes) do
local config = self:getPropertyConfig(attr)
@@ -145,8 +152,22 @@ function BaseElement:fromXML(node)
return self
end
---@class Container
local Container = {}
--- Loads and creates UI elements from XML content
--- @shortDescription Loads UI from XML string
--- @param self Container The container to load into
--- @param content string The XML content to parse
--- @param scope? table Optional scope for variable resolution
--- @return Container self The container instance
--- @usage
--- local xml = [[
--- <Frame>
--- <Button name="myButton" x="5" y="5"/>
--- </Frame>
--- ]]
--- container:loadXML(xml)
function Container:loadXML(content, scope)
local tree = parseXML(self, content)