friendlier networking + adding tabs

This commit is contained in:
kepler155c@gmail.com
2017-10-09 13:08:38 -04:00
parent f5b99d91e5
commit 05c99b583a
7 changed files with 124 additions and 40 deletions

View File

@@ -2045,7 +2045,7 @@ function UI.MenuBar:init(args)
end
self:addButtons(self.buttons)
if self.showBackButton then
if self.showBackButton then -- need to remove
table.insert(self.children, UI.MenuItem({
x = UI.term.width - 2,
width = 3,
@@ -2086,7 +2086,9 @@ function UI.MenuBar:addButtons(buttons)
end
end
end
self:initChildren()
if self.parent then
self:initChildren()
end
end
function UI.MenuBar:getActive(menuItem)
@@ -2129,6 +2131,13 @@ function UI.DropMenuItem:init(args)
UI.Button.init(self, UI:getDefaults(UI.DropMenuItem, args))
end
function UI.DropMenuItem:eventHandler(event)
if event.type == 'button_activate' then
self.parent:hide()
end
return UI.Button.eventHandler(self, event)
end
--[[-- DropMenu --]]--
UI.DropMenu = class(UI.MenuBar)
UI.DropMenu.defaults = {
@@ -3028,6 +3037,10 @@ function UI.TextArea:setText(text)
self:draw()
end
function UI.TextArea:focus()
-- allow keyboard scrolling
end
function UI.TextArea:draw()
self:clear()
self:setCursorPos(1, 1)