Added dialog windows and control settings.
Lots of comments and changes in UI code in general.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user