Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local buffer = require("doubleBuffering")
- local GUI = require("GUI")
- local event = require("event")
- event.shouldInterrupt = function() return false end
- event.shouldSoftInterrupt = event.shouldInterrupt
- --------------------------------------------------------------
- local mainContainer = GUI.fullScreenContainer()
- mainContainer:addChild(GUI.panel(1, 1, mainContainer.width, mainContainer.height, 0x002440))
- local layout = mainContainer:addChild(GUI.layout(1, 1, mainContainer.width, mainContainer.height, 1, 1))
- local label = layout:addChild(GUI.label(1, 1, 40, 1, 0xE1E1E1, ""):setAlignment(GUI.alignment.horizontal.center, GUI.alignment.vertical.top))
- local input = layout:addChild(GUI.input(1, 1, 40, 5, 0xE1E1E1, 0x444444, 0x888888, 0xE1E1E1, 0x262626, nil, "Напишите ваш отзыв здесь"))
- layout:addChild(GUI.button(1, 1, 40, 3, 0x336DBF, 0xE1E1E1, 0xE1E1E1, 0x336DBF, "Отправить отзыв")).onTouch = function(mainContainer, object, eventData)
- if input.text:len() > 0 then
- local file = io.open("/Otzivi.txt", "a")
- file:write("Отзыв от пользователя " .. eventData[6] .. ": " .. input.text .. "\n")
- file:close()
- input.text, label.text = "", "Ваш отзыв отправлен"
- mainContainer:draw()
- buffer.draw()
- event.timer(2, function()
- label.text = ""
- mainContainer:draw()
- buffer.draw()
- end, 1)
- end
- end
- --------------------------------------------------------------
- mainContainer:draw()
- buffer.draw(true)
- mainContainer:startEventHandling()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement