Create a new checkbox.
The position of the checkbox
The text for the button
Protected
_isProtected
_isWhether the object can become the first responder.
The function to call when the control is pressed.
Whether the view is currently focused.
Whether the view is hidden.
Protected
isWhether the view needs to be redrawn.
Whether the view needs to be laid out.
Whether constraints need to be updated.
Optional
nextThe next responder in the responder chain.
Optional
onThe function called when the state changes.
The list of subviews inside this view.
Optional
superviewThe view that contains this view, if it exists.
Whether user interaction is enabled for this view.
Optional
windowThe window this view is located inside.
The background color of the view.
The color of the button when clicked.
The color of the button.
The color of the button when in default state.
Whether the checkbox is currently checked.
Whether the control is in default state.
Whether the control is enabled.
The text for the button.
The color of the text.
The color of the text when disabled.
Adds a constraint to the view. The first item of the constraint MUST be this view.
The constraint to add
Adds a list of constraints to the view. The first item of the constraints MUST be this view.
The constraints to add
Removes a constraint from the view. The first item of the constraint MUST be this view.
The constraint to add
Tells the receiver that the frame or constraints of the sender changed. This triggers the receiver to update its constraints if any are related to the sender, and cascades the message up and down throughout the hierarchy. It will also trigger a cascade on itself if it needs to update constraints.
Attempts to call the specified method on the object, passing the call on to the next responder if this object doesn't implement it.
The name of the method to call
Any parameters to pass to the method
Whether a responder was able to respond to the method
Checks whether the passed object can become the first responder from the specified event.
The object to check
The event that was sent
Whether the object is allowed to be the first responder
Static
addAdds a number of constraints to views using code. This can simplify settings constraints by using familiar code syntax instead of lengthy constraint constructions and activations.
The syntax is fairly simple:
<ViewName>.<Attribute> = [<Multiplier> *] <ViewName>.<Attribute> [+|- <Constant>]
<ViewName>.<Attribute> = <Constant>
The code is processed using Lua as the parser, so it's not strictly required to be in exactly this format; but mind that operators other than add/sub/mul/div/unm aren't supported (and division is only valid if the divisor is a number), and no libraries are available in the environment.
The constraint code to apply
A key-value map of names of views in the code, to the views they represent
A checkbox is a type of button that is either on or off.