Add a delegate to the segmented control

Allow the delegate to prevent segment selection and also inform
it when the segment changes.