From debd7a9a9faccf00e05dc5b8a52ad74185f39425 Mon Sep 17 00:00:00 2001 From: IgorTimofeev Date: Sat, 19 May 2018 02:58:33 +0300 Subject: [PATCH] Updated deprecated API methods --- Applications/EFI Flasher/Main.lua | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/Applications/EFI Flasher/Main.lua b/Applications/EFI Flasher/Main.lua index 23fab8f..b6b9dbc 100644 --- a/Applications/EFI Flasher/Main.lua +++ b/Applications/EFI Flasher/Main.lua @@ -10,32 +10,31 @@ local dumpFileName = "Dump" .. math.random(1, 1000) .. ".efi" --------------------------------------------- fs.makeDirectory(defaultPath) -------------mainWindow-------------------- -local mainContainer, window = MineOSInterface.addWindow(MineOSInterface.filledWindow(1, 1, 88, 26, 0xF0F0F0)) +local mainContainer, window = MineOSInterface.addWindow(GUI.filledWindow(1, 1, 88, 26, 0xF0F0F0)) local container = window:addChild(GUI.container(1, 1, window.width, window.height)) -layout = container:addChild(GUI.layout(1, 1, window.width, window.height, 1, 1)) -layout:setGridSize(3,1) +layout = container:addChild(GUI.layout(1, 1, window.width, window.height, 3, 1)) ----------------------------------------------drawingInterface----------------- local filesystemChooser = layout:addChild(GUI.filesystemChooser(2, 2, 25, 3, 0xE1E1E1, 0x888888, 0x3C3C3C, 0x888888, nil, "Open", "Cancel", "Choose", "/")) filesystemChooser.onSubmit = function(path) local file = io.open(path, "r") flashFile = file:read("*a") end -local button1 = layout:setCellPosition(2, 1, layout:addChild(GUI.button(2, 2, 25, 3, 0xFFFFFF, 0x555555, 0x880000, 0xFFFFFF, "Dump"))) +local button1 = layout:setPosition(2, 1, layout:addChild(GUI.button(2, 2, 25, 3, 0xFFFFFF, 0x555555, 0x880000, 0xFFFFFF, "Dump"))) button1.onTouch = function() local dumpFile = io.open(defaultPath .. dumpFileName, "w") dumpFile:write(component.eeprom.get()) dumpFile:close() dumpFileName = "Dump" .. math.random(1, 1000) .. ".efi" - GUI.error("Dumped File, filename is: " .. dumpFileName) + GUI.alert("Dumped File, filename is: " .. dumpFileName) end -local button2 = layout:setCellPosition(3, 1, layout:addChild(GUI.button(2, 2, 25, 3, 0xFFFFFF, 0x555555, 0x880000, 0xFFFFFF, "Flash"))) +local button2 = layout:setPosition(3, 1, layout:addChild(GUI.button(2, 2, 25, 3, 0xFFFFFF, 0x555555, 0x880000, 0xFFFFFF, "Flash"))) button2.onTouch = function() component.eeprom.set(flashFile) - GUI.error("Flashed EEPROM") + GUI.alert("Flashed EEPROM") end -layout:setCellFitting(3, 1, true, false, 1) -layout:setCellFitting(2, 1, true, false, 1) -layout:setCellFitting(1, 1, true, false, 1) +layout:setFitting(3, 1, true, false, 1) +layout:setFitting(2, 1, true, false, 1) +layout:setFitting(1, 1, true, false, 1) --------------------------- window.onResize = function(width, height) window.backgroundPanel.width = width @@ -45,7 +44,6 @@ window.onResize = function(width, height) layout.width = width layout.height = height - 3 end -mainContainer:draw() -container:draw() -buffer.draw(true) -mainContainer:startEventHandling() \ No newline at end of file + +mainContainer:drawOnScreen() +mainContainer:startEventHandling()