lua.wetgenes.gamecake.widgets.checkbox
local master=oven.rebake("wetgenes.gamecake.widgets").setup()
local widget=master:add{class="checkbox",...}
A button that can be used to display and toggle a single bit of data.
lua.wetgenes.gamecake.widgets.checkbox.class_hooks
We catch and react to the click hook as we can toggle the data_mask bit in the data.
lua.wetgenes.gamecake.widgets.checkbox.setup
see lua.wetgenes.gamecake.widgets.meta.setup for generic options
As a button we always need to be solid so this is forced to true.
cursor will be set to "hand" if it is not already set so you can tell it is a button when you hover over it.
data_mask defaults to 1 and represents the bit (or bits) that should be tested and toggled in the data. The default of 1 and assuming your data starts at 0 means that the data will toggle between 0 and 1 using this checkbox.
text_false defaults to " " and is the text that will be displayed when a data_mask test is false.
text_true defaults to "X" and is the text that will be displayed when a data_mask test is true.
lua.wetgenes.gamecake.widgets.checkbox.update
this function will also call lua.wetgenes.gamecake.widgets.meta.update
If we have a data assigned to this checkbox then make sure that the displayed text is up to date. We should really hook into the data so any change there is copied here instead?
We use data_mask to check a single bit and then set the text to either text_false or text_true depending on the result.