Edit:redo() method


redoes the last edit operation on the Edit.

Return value

This function returns no value.

Example

local ui = require "ui" -- create a fixed Window to hold the buttons local win = ui.Window("Edit:redo() sample", "fixed", 290, 220) local label = ui.Label(win, "Enter text : ") local edit = ui.Edit(win, "", label.x + label.width + 8, label.y-4, 150) local undobtn = ui.Button(win, "Undo", edit.x + edit.width + 8, edit.y) local redobtn = ui.Button(win, "Redo", edit.x + edit.width + 8, undobtn.y+undobtn.height+4) function undobtn:onClick() edit:undo() end function redobtn:onClick() edit:redo() end win:show() -- update user interface repeat ui.update() -- update undo/redo button state undobtn.enabled = edit.canundo and true or false redobtn.enabled= edit.canredo and true or false until not win.visible