Externalize widget hit test to style definition.

This commit is contained in:
Matthias Richter 2012-03-14 16:19:46 +01:00
parent 2e5927e963
commit 6de65888dc
7 changed files with 18 additions and 17 deletions

View file

@ -1,9 +1,9 @@
local core = require((...):match("(.-)[^%.]+$") .. 'core')
return function(info, x,y, w,h, draw)
return function(info, x,y, w,h, widgetHit, draw)
local id = core.generateID()
core.mouse.updateState(id, x,y,w,h)
core.mouse.updateState(id, widgetHit or core.style.widgetHit, x,y,w,h)
core.makeCyclable(id)
core.registerDraw(id, draw or core.style.Checkbox, info.checked,x,y,w,h)