The content of the Edit may be hidden if its size is too small. The horizontal and vertical scrollbars are automatically managed so that Edit content can still be accessed.
Edit.height read/write property
Get or set the height of the Edit. The height starts from 0 (top side of the Edit) and increase to the bottom direction.
Example
local ui = require "ui"
-- create a simple Window
local win = ui.Window("Edit.height sample", 320, 300)
local edit = ui.Edit(win, "Text field", 10, 60, 300, 230)
local inc_btn = ui.Button(win, "Increase Edit.height !", 15, 10)
local dec_btn = ui.Button(win, "Decrease Edit.height", inc_btn.x+150, inc_btn.y)
edit.font = "Times New Roman"
edit.fontsize = 11
edit.fontstyle = { italic = true }
edit.text = [[Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.]]
edit.wordwrap = true
function inc_btn:onClick()
local delta
if self == inc_btn then
delta = 10
else
delta = -10
end
edit.height = edit.height + delta
end
dec_btn.onClick = inc_btn.onClick
-- shows the Window
win:show()
-- update user interface
repeat
ui.update()
until not win.visible