Added dialog windows and control settings.

Lots of comments and changes in UI code in general.
This commit is contained in:
2025-10-13 00:28:12 -04:00
parent 4ecaaf1b50
commit 777b70d1ab
20 changed files with 607 additions and 62 deletions

View File

@@ -10,6 +10,7 @@ local UIElement = require 'src.ui.element'
-- Class definitions
------------------------------------------------------------------------------
---@class Layout: UIElement
local Layout = make_class(UIElement)
@@ -18,7 +19,7 @@ local Layout = make_class(UIElement)
------------------------------------------------------------------------------
function Layout:_init(x, y, w, h, spacing, float)
UIElement._init(self, x, y, float)
UIElement._init(self, x, y, float, false)
self.x = x ~= nil and x or 0
self.y = y ~= nil and y or 0
self.w = w
@@ -68,6 +69,27 @@ function Layout:draw()
end
function Layout:keypressed(key, code, isrepeat)
for _, v in pairs(self.elements) do
v:keypressed(key, code, isrepeat)
end
end
function Layout:textinput(text)
for _, v in pairs(self.elements) do
v:textinput(text)
end
end
function Layout:keyreleased(key, code)
for _, v in pairs(self.elements) do
v:keyreleased(key, code)
end
end
function Layout:mousemoved(x, y, dx, dy)
for _, v in pairs(self.elements) do
v:mousemoved(x, y, dx, dy)