2012-01-05 02:28:29 +01:00
|
|
|
UICheckBox = extends(UIWidget)
|
|
|
|
|
|
|
|
function UICheckBox.create()
|
|
|
|
local checkbox = UICheckBox.internalCreate()
|
|
|
|
checkbox:setFocusable(false)
|
2012-01-10 23:13:40 +01:00
|
|
|
checkbox:setTextAlign(AlignLeft)
|
2012-01-05 02:28:29 +01:00
|
|
|
return checkbox
|
|
|
|
end
|
2012-01-10 23:13:40 +01:00
|
|
|
|
|
|
|
function UICheckBox:onMouseRelease(mousePos, mouseButton)
|
|
|
|
if self:isPressed() and self:containsPoint(mousePos) then
|
|
|
|
self:setChecked(not self:isChecked())
|
|
|
|
end
|
|
|
|
end
|