Creates a new segmented button.
The frame for the button. This should have a height of 1.
The text for each button. This must have at least one button.
The action to call when a selection changes
Protected
_isWhether the object can become the first responder.
The function to call when the selection changes.
Whether the view is currently focused.
Whether the view is hidden.
Whether 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.
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 number of buttons in the segmented button.
The color of the button when in default state.
Whether the control is enabled.
The currently selected button.
The color of the text.
The color of the text when disabled.
The color of the text when selected.
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 segmented button displays multiple buttons in a single view, with only one selected at a time.