add check and radio controls

This commit is contained in:
airstruck
2015-11-29 23:24:12 -05:00
parent 2d64e6ca69
commit ed98c0beb2
31 changed files with 150 additions and 14 deletions

18
luigi/widget/check.lua Normal file
View File

@@ -0,0 +1,18 @@
--[[--
A check box.
@widget check
--]]--
return function (self)
self:onPress(function ()
self.value = not self.value
end)
self:onChange(function ()
local subtype = self.value and 'check.checked' or 'check.unchecked'
self.type = { 'check', subtype }
end)
self.value = not not self.value
end