move apis into rom/modules/main for shell compatibility

This commit is contained in:
kepler155c@gmail.com
2019-06-28 13:50:02 -04:00
parent c3d52c1aab
commit 343ce7fdc2
135 changed files with 297 additions and 289 deletions

View File

@@ -0,0 +1,36 @@
local class = require('opus.class')
local UI = require('opus.ui')
--[[-- TextArea --]]--
UI.TextArea = class(UI.Viewport)
UI.TextArea.defaults = {
UIElement = 'TextArea',
marginRight = 2,
value = '',
}
function UI.TextArea:postInit()
self.scrollBar = UI.ScrollBar()
end
function UI.TextArea:setText(text)
self:reset()
self.value = text
self:draw()
end
function UI.TextArea:focus()
-- allow keyboard scrolling
end
function UI.TextArea:draw()
self:clear()
-- self:setCursorPos(1, 1)
self.cursorX, self.cursorY = 1, 1
self:print(self.value)
for _,child in pairs(self.children) do
if child.enabled then
child:draw()
end
end
end