Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local self = getfenv()
- internal = {}
- function self.new(name,x,y,width)
- local txt = {}
- txt.name = name
- txt.x = x
- txt.y = y
- txt.width = width
- txt.value = ""
- txt.scrolled = 0
- txt.cursorAt = 1
- txt.active = false
- txt.scrollWhenInactive = false
- txt.scrolling = false
- setmetatable(txt,{__index=internal})
- end
- function internal:setText()
- end
- function internal:updateScroll()
- end
- function internal:initScroll()
- self.scrolling = true
- end
- function internal:stopScroll()
- self.scrolling = false
- end
- function internal:drawText()
- end
- function internal:setCursor()
- end
- function internal:update(dt)
- if self.scrolling then
- self:updateScroll(dt)
- end
- end
- function internal:draw()
- end
- function internal:checkClicked()
- end
- function internal:activate()
- gui.activateControl(self)
- end
- function internal:deactivate()
- gui.deactivateControl()
- end
- function internal:onDeactivate()
- term.setCursorBlink(false)
- if txt.scrollWhenInactive then
- self:initScroll()
- end
- end
- function internal:onActivate()
- term.setCursorBlink(true)
- if self.scrolling then
- self:stopScroll()
- end
- self:draw()
- self:setCursor()
- end
Advertisement
Add Comment
Please, Sign In to add comment