API  0.9.10
CPSegmentedControl Class Reference

#import <CPSegmentedControl.h>

+ Inheritance diagram for CPSegmentedControl:

Instance Methods

(CGRect) - bezelFrameForSegment:
 
(void) - bind:toObject:withKeyPath:options:
 
(CGRect) - contentFrameForSegment:
 
(CPView- createEphemeralSubviewNamed:
 
(void) - drawSegment:highlight:
 
(void) - drawSegmentBezel:highlight:
 
(void) - encodeWithCoder:
 
(CGRect) - frameForSegment:
 
(CPImage- imageForSegment:
 
(id) - initWithCoder:
 
(id) - initWithFrame:
 
(void) - insertSegments:atIndexes:
 
(BOOL) - isEnabledForSegment:
 
(BOOL) - isSelectedForSegment:
 
(BOOL) - isTracking
 
(CPString- labelForSegment:
 
(void) - layoutSubviews
 
(CPMenu- menuForSegment:
 
(void) - mouseDown:
 
(void) - mouseUp:
 
(CGRect) - rectForEphemeralSubviewNamed:
 
(void) - removeSegmentsAtIndexes:
 
(unsigned) - segmentCount
 
(CPArray) - segments
 
(unsigned) - selectedSegment
 
(int) - selectedTag
 
(BOOL) - selectSegmentWithTag:
 
(void) - setControlSize:
 
(void) - setEnabled:forSegment:
 
(void) - setFont:
 
(void) - setImage:forSegment:
 
(void) - setLabel:forSegment:
 
(void) - setMenu:forSegment:
 
(void) - setSegmentCount:
 
(void) - setSegments:
 
(void) - setSelected:forSegment:
 
(void) - setSelectedSegment:
 
(void) - setTag:forSegment:
 
(void) - setTrackingMode:
 
(void) - setWidth:forSegment:
 
(int) - tagForSegment:
 
(unsigned) - testSegment:
 
(void) - tile
 
(void) - tileWithChangedSegment:
 
(CPSegmentSwitchTracking) - trackingMode
 
(void) - trackSegment:
 
(float) - widthForSegment:
 
- Instance Methods inherited from CPControl
(BOOL) - acceptsFirstMouse:
 
(SEL) - action
 
(CPTextAlignment) - alignment
 
(CPWritingDirection) - baseWritingDirection
 
(BOOL) - continueTracking:at:
 
(CPControlSize) - controlSize
 
(double) - doubleValue
 
(float) - floatValue
 
(CPFont- font
 
(CPFormatter- formatter
 
(void) - highlight:
 
(CPCellImagePosition) - imagePosition
 
(CPUInteger) - imageScaling
 
(int) - integerValue
 
(int) - intValue
 
(BOOL) - isContinuous
 
(BOOL) - isEnabled
 
(BOOL) - isHighlighted
 
(CPLineBreakMode) - lineBreakMode
 
(unsigned) - mouseDownFlags
 
(void) - mouseEntered:
 
(void) - mouseExited:
 
(CPInteger) - nextState
 
(id) - objectValue
 
(void) - performClick:
 
(BOOL) - sendAction:to:
 
(int) - sendActionOn:
 
(BOOL) - sendsActionOnEndEditing
 
(void) - setAction:
 
(void) - setAlignment:
 
(void) - setBaseWritingDirection:
 
(void) - setContinuous:
 
(void) - setDoubleValue:
 
(void) - setEnabled:
 
(void) - setFloatValue:
 
(void) - setFormatter:
 
(void) - setHighlighted:
 
(void) - setImagePosition:
 
(void) - setImageScaling:
 
(void) - setIntegerValue:
 
(void) - setIntValue:
 
(void) - setLineBreakMode:
 
(void) - setObjectValue:
 
(void) - setSendsActionOnEndEditing:
 
(void) - setState:
 
(void) - setStringValue:
 
(void) - setTarget:
 
(void) - setTextColor:
 
(void) - setTextShadowColor:
 
(void) - setTextShadowOffset:
 
(void) - setVerticalAlignment:
 
(BOOL) - startTrackingAt:
 
(void) - stopTracking:at:mouseIsUp:
 
(CPString- stringValue
 
(void) - takeDoubleValueFrom:
 
(void) - takeFloatValueFrom:
 
(void) - takeIntegerValueFrom:
 
(void) - takeIntValueFrom:
 
(void) - takeObjectValueFrom:
 
(void) - takeStringValueFrom:
 
(id) - target
 
(CPColor- textColor
 
(void) - textDidBeginEditing:
 
(void) - textDidChange:
 
(void) - textDidEndEditing:
 
(CPColor- textShadowColor
 
(CGSize) - textShadowOffset
 
(void) - trackMouse:
 
(BOOL) - tracksMouseOutsideOfFrame
 
(void) - unhighlightButtonTimerDidFinish:
 
(void) - updateTrackingAreas
 
(CPTextVerticalAlignment) - verticalAlignment
 
- Instance Methods inherited from CPView
(void) - addSubview:
 
(void) - addSubview:positioned:relativeTo:
 
(void) - addTrackingArea:
 
(CGRect) - adjustScroll:
 
(float) - alphaValue
 
(CAAnimation- animationForKey:
 
(CPDictionary- animations
 
(id) - animator
 
(BOOL) - autoresizesSubviews
 
(unsigned) - autoresizingMask
 
(BOOL) - autoscroll:
 
(CPColor- backgroundColor
 
(BOOL) - becomeFirstResponder
 
(CGRect) - bounds
 
(CGPoint) - boundsOrigin
 
(CGSize) - boundsSize
 
(BOOL) - canBecomeKeyView
 
(CGPoint) - center
 
(BOOL) - clipsToBounds
 
(CGPoint) - convertPoint:fromView:
 
(CGPoint) - convertPoint:toView:
 
(CGPoint) - convertPointFromBase:
 
(CGPoint) - convertPointToBase:
 
(CGRect) - convertRect:fromView:
 
(CGRect) - convertRect:toView:
 
(CGRect) - convertRectFromBase:
 
(CGRect) - convertRectToBase:
 
(CGSize) - convertSize:fromView:
 
(CGSize) - convertSize:toView:
 
(CPString- debug_description
 
(void) - didAddSubview:
 
(void) - display
 
(void) - displayIfNeeded
 
(void) - displayIfNeededInRect:
 
(void) - displayRect:
 
(void) - displayRectIgnoringOpacity:inContext:
 
(void) - dragImage:at:offset:event:pasteboard:source:slideBack:
 
(void) - dragView:at:offset:event:pasteboard:source:slideBack:
 
(void) - drawRect:
 
(CPAppearance- effectiveAppearance
 
(CPMenuItem- enclosingMenuItem
 
(CPScrollView- enclosingScrollView
 
(BOOL) - enterFullScreenMode
 
(BOOL) - enterFullScreenMode:withOptions:
 
(CPView- ephemeralSubviewNamed:
 
(void) - exitFullScreenMode
 
(void) - exitFullScreenModeWithOptions:
 
(CGRect) - frame
 
(CGPoint) - frameOrigin
 
(CGRect) - frameRectOfView:inSuperviewSize:
 
(CGSize) - frameSize
 
(CGRect) - frameWithNewSuperviewSize:
 
(BOOL) - hasCustomDrawRect
 
(BOOL) - hasCustomLayoutSubviews
 
(CPView- hitTest:
 
(BOOL) - hitTests
 
(id) - init
 
(BOOL) - inLiveResize
 
(BOOL) - isDescendantOf:
 
(BOOL) - isFlipped
 
(BOOL) - isHidden
 
(BOOL) - isHiddenOrHasHiddenAncestor
 
(BOOL) - isInFullScreenMode
 
(BOOL) - isOpaque
 
(CALayer- layer
 
(void) - layout
 
(CPView- layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:
 
(void) - layoutIfNeeded
 
(void) - lockFocus
 
(CPMenu- menuForEvent:
 
(BOOL) - mouseDownCanMoveWindow
 
(BOOL) - needsDisplay
 
(BOOL) - needsLayout
 
(BOOL) - needsPanelToBecomeKey
 
(CPView- nextKeyView
 
(CPView- nextValidKeyView
 
(void) - objectDidChangeTheme
 
(BOOL) - performKeyEquivalent:
 
(BOOL) - postsBoundsChangedNotifications
 
(BOOL) - postsFrameChangedNotifications
 
(CPView- previousKeyView
 
(CPView- previousValidKeyView
 
(void) - reflectScrolledClipView:
 
(CPArray) - registeredDraggedTypes
 
(void) - registerForDraggedTypes:
 
(void) - removeAllTrackingAreas
 
(void) - removeFromSuperview
 
(void) - removeTrackingArea:
 
(void) - replaceSubview:with:
 
(BOOL) - resignFirstResponder
 
(void) - resizeSubviewsWithOldSize:
 
(void) - resizeWithOldSuperviewSize:
 
(void) - rightMouseDown:
 
(CGSize) - scaleSize
 
(void) - scaleUnitSquareToSize:
 
(void) - scrollClipView:toPoint:
 
(void) - scrollPoint:
 
(void) - scrollRect:by:
 
(BOOL) - scrollRectToVisible:
 
(void) - setAlphaValue:
 
(void) - setAnimations:
 
(void) - setAppearance:
 
(void) - setAutoresizesSubviews:
 
(void) - setAutoresizingMask:
 
(void) - setBackgroundColor:
 
(void) - setBounds:
 
(void) - setBoundsOrigin:
 
(void) - setBoundsSize:
 
(void) - setCenter:
 
(void) - setClipsToBounds:
 
(void) - setFrame:
 
(void) - setFrameOrigin:
 
(void) - setFrameSize:
 
(void) - setHidden:
 
(void) - setHitTests:
 
(void) - setLayer:
 
(void) - setNeedsDisplay:
 
(void) - setNeedsDisplayInRect:
 
(void) - setNeedsLayout
 
(void) - setNeedsLayout:
 
(void) - setNextKeyView:
 
(void) - setPostsBoundsChangedNotifications:
 
(void) - setPostsFrameChangedNotifications:
 
(void) - setScaleSize:
 
(void) - setSubviews:
 
(void) - setTag:
 
(void) - setThemeClass:
 
(BOOL) - setThemeState:
 
(void) - setToolTip:
 
(void) - setValue:forThemeAttribute:
 
(void) - setValue:forThemeAttribute:inState:
 
(void) - setWantsLayer:
 
(CPArray) - subviews
 
(CPView- superview
 
(CPInteger) - tag
 
(void) - unlockFocus
 
(void) - unregisterDraggedTypes
 
(BOOL) - unsetThemeState:
 
(void) - viewDidEndLiveResize
 
(void) - viewDidHide
 
(void) - viewDidLayout
 
(void) - viewDidMoveToSuperview
 
(void) - viewDidMoveToWindow
 
(void) - viewDidUnhide
 
(void) - viewWillDraw
 
(void) - viewWillLayout
 
(void) - viewWillMoveToSuperview:
 
(void) - viewWillMoveToWindow:
 
(void) - viewWillStartLiveResize
 
(CPView- viewWithTag:
 
(CGRect) - visibleRect
 
(BOOL) - wantsLayer
 
(void) - willRemoveSubview:
 
(CPWindow- window
 

Class Methods

(CPString+ defaultThemeClass
 
(BOOL) + isBindingExclusive:
 
(CPDictionary+ themeAttributes
 
- Class Methods inherited from CPControl
(void) + initialize
 
- Class Methods inherited from CPView
(Class) + animatorClass
 
(CAAnimation+ defaultAnimationForKey:
 
(CPMenu+ defaultMenu
 
(BOOL) + isHighDPIDrawingEnabled
 
(CPSet) + keyPathsForValuesAffectingBounds
 
(CPSet) + keyPathsForValuesAffectingFrame
 
(void) + setHighDPIDrawingEnabled:
 

Detailed Description

This class is a horizontal button with multiple segments.

Definition at line 2 of file CPSegmentedControl.h.

Method Documentation

◆ bezelFrameForSegment:()

- (CGRect) bezelFrameForSegment: (unsigned)  aSegment
implementation

Definition at line 782 of file CPSegmentedControl.j.

◆ bind:toObject:withKeyPath:options:()

- (void) bind: (CPString aBinding
toObject: (id)  anObject
withKeyPath: (CPString aKeyPath
options: (CPDictionary options 
implementation

Provided by category CPSegmentedControl(BindingSupport).

Definition at line 1048 of file CPSegmentedControl.j.

◆ contentFrameForSegment:()

- (CGRect) contentFrameForSegment: (unsigned)  aSegment
implementation

Definition at line 805 of file CPSegmentedControl.j.

◆ createEphemeralSubviewNamed:()

- (CPView) createEphemeralSubviewNamed: (CPString aName
implementation

Reimplemented from CPView.

Definition at line 598 of file CPSegmentedControl.j.

◆ defaultThemeClass()

+ (CPString) defaultThemeClass
implementation

Definition at line 50 of file CPSegmentedControl.j.

◆ drawSegment:highlight:()

- (void) drawSegment: (int)  aSegment
highlight: (BOOL)  shouldHighlight 
implementation

Draws the specified segment

Parameters
aSegmentthe segment to draw
shouldHighlightYES highlights the bezel

Definition at line 728 of file CPSegmentedControl.j.

◆ drawSegmentBezel:highlight:()

- (void) drawSegmentBezel: (int)  aSegment
highlight: (BOOL)  shouldHighlight 
implementation

Draws the specified segment bezel

Parameters
aSegmentthe segment to draw the bezel for
shouldHighlightYES highlights the bezel

Definition at line 511 of file CPSegmentedControl.j.

◆ encodeWithCoder:()

- (void) encodeWithCoder: (CPCoder aCoder
implementation

Archives the view to a coder.

Parameters
aCoderthe object into which the view's data will be archived.

Reimplemented from CPControl.

Provided by category CPSegmentedControl(CPCoding).

Definition at line 1016 of file CPSegmentedControl.j.

◆ frameForSegment:()

- (CGRect) frameForSegment: (unsigned)  aSegment
implementation

Returns the bounding rectangle for the specified segment.

Parameters
aSegmentthe segment to get the rectangle for

Definition at line 768 of file CPSegmentedControl.j.

◆ imageForSegment:()

- (CPImage) imageForSegment: (unsigned)  aSegment
implementation

Returns the image for the specified segment

Parameters
aSegmentthe segment to obtain the image for
Exceptions
CPRangeExceptionif aSegment is out of bounds

Definition at line 351 of file CPSegmentedControl.j.

◆ initWithCoder:()

- (id) initWithCoder: (CPCoder aCoder
implementation

Initializes the view from an archive.

Parameters
aCoderthe coder from which to initialize
Returns
the initialized view

Reimplemented from CPControl.

Provided by category CPSegmentedControl(CPCoding).

Definition at line 948 of file CPSegmentedControl.j.

◆ initWithFrame:()

- (id) initWithFrame: (CGRect)  aFrame
implementation

Initializes the receiver for usage with the specified bounding rectangle

Returns
the initialized view

Reimplemented from CPControl.

Definition at line 72 of file CPSegmentedControl.j.

◆ insertSegments:atIndexes:()

- (void) insertSegments: (CPArray)  segments
atIndexes: (CPIndexSet indices 
implementation

Definition at line 118 of file CPSegmentedControl.j.

◆ isBindingExclusive:()

+ (BOOL) isBindingExclusive: (CPString aBinding
implementation

Provided by category CPSegmentedControl(BindingSupport).

Definition at line 1043 of file CPSegmentedControl.j.

◆ isEnabledForSegment:()

- (BOOL) isEnabledForSegment: (unsigned)  aSegment
implementation

Returns YES if the specified segment is enabled.

Parameters
aSegmentthe segment to check
Exceptions
CPRangeExceptionif aSegment is out of bounds

Definition at line 481 of file CPSegmentedControl.j.

◆ isSelectedForSegment:()

- (BOOL) isSelectedForSegment: (unsigned)  aSegment
implementation

Returns YES if the specified segment is selected.

Parameters
aSegmentthe segment to check for selection
Exceptions
CPRangeExceptionif aSegment is out of bounds

Definition at line 447 of file CPSegmentedControl.j.

◆ isTracking()

- (BOOL) isTracking
implementation

Definition at line 267 of file CPSegmentedControl.j.

◆ labelForSegment:()

- (CPString) labelForSegment: (unsigned)  aSegment
implementation

Returns the label for the specified segment

Parameters
thesegment to obtain the label for
Exceptions
CPRangeExceptionif aSegment is out of bounds

Definition at line 374 of file CPSegmentedControl.j.

◆ layoutSubviews()

- (void) layoutSubviews
implementation

Reimplemented from CPView.

Definition at line 611 of file CPSegmentedControl.j.

◆ menuForSegment:()

- (CPMenu) menuForSegment: (unsigned)  aSegment
implementation

Returns the menu for the specified segment.

Parameters
aSegmentthe segment to obtain the menu for
Exceptions
CPRangeExceptionif aSegment is out of bounds

Definition at line 395 of file CPSegmentedControl.j.

◆ mouseDown:()

- (void) mouseDown: (CPEvent anEvent
implementation

Reimplemented from CPControl.

Definition at line 847 of file CPSegmentedControl.j.

◆ mouseUp:()

- (void) mouseUp: (CPEvent anEvent
implementation

Definition at line 856 of file CPSegmentedControl.j.

◆ rectForEphemeralSubviewNamed:()

- (CGRect) rectForEphemeralSubviewNamed: (CPString aName
implementation

Reimplemented from CPView.

Definition at line 545 of file CPSegmentedControl.j.

◆ removeSegmentsAtIndexes:()

- (void) removeSegmentsAtIndexes: (CPIndexSet indices
implementation

Definition at line 137 of file CPSegmentedControl.j.

◆ segmentCount()

- (unsigned) segmentCount
implementation

Returns the number of segments in the button.

Definition at line 194 of file CPSegmentedControl.j.

◆ segments()

- (CPArray) segments
implementation

Synthesized accessor method.

Provided by category CPSegmentedControl(CPSynthesizedAccessors).

Definition at line 1194 of file CPSegmentedControl.j.

◆ selectedSegment()

- (unsigned) selectedSegment
implementation

Returns the selected segment.

Definition at line 227 of file CPSegmentedControl.j.

◆ selectedTag()

- (int) selectedTag
implementation

Returns the tag of the selected segment.

Definition at line 104 of file CPSegmentedControl.j.

◆ selectSegmentWithTag:()

- (BOOL) selectSegmentWithTag: (int)  aTag
implementation

Selects the button segment with the specified tag.

Definition at line 235 of file CPSegmentedControl.j.

◆ setControlSize:()

- (void) setControlSize: (CPControlSize)  aControlSize
implementation

Sets the control's size.

Parameters
aControlSizethe control's size

Reimplemented from CPControl.

Definition at line 95 of file CPSegmentedControl.j.

◆ setEnabled:forSegment:()

- (void) setEnabled: (BOOL)  shouldBeEnabled
forSegment: (unsigned)  aSegment 
implementation

Enables/disables the specified segment.

Parameters
isEnabledYES enables the segment
aSegmentthe segment to enable/disable
Exceptions
CPRangeExceptionif aSegment is out of bounds

Definition at line 458 of file CPSegmentedControl.j.

◆ setFont:()

- (void) setFont: (CPFont aFont
implementation

Sets the font of the control.

Reimplemented from CPControl.

Definition at line 932 of file CPSegmentedControl.j.

◆ setImage:forSegment:()

- (void) setImage: (CPImage anImage
forSegment: (unsigned)  aSegment 
implementation

Sets the image for the specified segment.

Parameters
anImagethe image for the segment
aSegmentthe segment to set the image on
Exceptions
CPRangeExceptionif aSegment is out of bounds

Definition at line 339 of file CPSegmentedControl.j.

◆ setLabel:forSegment:()

- (void) setLabel: (CPString aLabel
forSegment: (unsigned)  aSegment 
implementation

Sets the label for the specified segment

Parameters
aLabelthe label for the segment
aSegmentthe segment to label
Exceptions
CPRangeExceptionif aSegment is out of bounds

Definition at line 362 of file CPSegmentedControl.j.

◆ setMenu:forSegment:()

- (void) setMenu: (CPMenu aMenu
forSegment: (unsigned)  aSegment 
implementation

Sets the menu for the specified segment

Parameters
aMenuthe menu to set
aSegmentthe segment to set the menu on
Exceptions
CPRangeExceptionif aSegment is out of bounds

Definition at line 385 of file CPSegmentedControl.j.

◆ setSegmentCount:()

- (void) setSegmentCount: (unsigned)  aCount
implementation

Sets the number of segments in the button.

Parameters
aCountthe number of segments on the button

Definition at line 161 of file CPSegmentedControl.j.

◆ setSegments:()

- (void) setSegments: (CPArray)  segments
implementation

Definition at line 110 of file CPSegmentedControl.j.

◆ setSelected:forSegment:()

- (void) setSelected: (BOOL)  isSelected
forSegment: (unsigned)  aSegment 
implementation

Sets the selection for the specified segment. If only one segment can be selected at a time, any other segment will be deselected.

Parameters
isSelectedYES selects the segment. NO deselects it.
aSegmentthe segment to set the selection for
Exceptions
CPRangeExceptionif aSegment is out of bounds

Definition at line 407 of file CPSegmentedControl.j.

◆ setSelectedSegment:()

- (void) setSelectedSegment: (unsigned)  aSegment
implementation

Selects a segment.

Parameters
aSegmentthe segment to select
Exceptions
CPRangeExceptionif aSegment is out of bounds

Definition at line 205 of file CPSegmentedControl.j.

◆ setTag:forSegment:()

- (void) setTag: (int)  aTag
forSegment: (unsigned)  aSegment 
implementation

Sets a tag for the specified segment.

Parameters
aTagthe tag to set
aSegmentthe segment to set the tag on

Definition at line 491 of file CPSegmentedControl.j.

◆ setTrackingMode:()

- (void) setTrackingMode: (CPSegmentSwitchTracking)  aTrackingMode
implementation

Definition at line 272 of file CPSegmentedControl.j.

◆ setWidth:forSegment:()

- (void) setWidth: (float)  aWidth
forSegment: (unsigned)  aSegment 
implementation

Sets the width of the specified segment.

Parameters
aWidththe new width for the segment
aSegmentthe segment to set the width for
Exceptions
CPRangeExceptionif aSegment is out of bounds

Definition at line 317 of file CPSegmentedControl.j.

◆ tagForSegment:()

- (int) tagForSegment: (unsigned)  aSegment
implementation

Returns the tag for the specified segment.

Parameters
aSegmentthe segment to obtain the tag for

Definition at line 500 of file CPSegmentedControl.j.

◆ testSegment:()

- (unsigned) testSegment: (CGPoint)  aPoint
implementation

Returns the segment that is hit by the specified point.

Parameters
aPointthe point to test for a segment hit
Returns
the intersecting segment

Definition at line 826 of file CPSegmentedControl.j.

◆ themeAttributes()

+ (CPDictionary) themeAttributes
implementation

Reimplemented from CPControl.

Definition at line 55 of file CPSegmentedControl.j.

◆ tile()

- (void) tile
implementation

Definition at line 733 of file CPSegmentedControl.j.

◆ tileWithChangedSegment:()

- (void) tileWithChangedSegment: (CPInteger)  aSegment
implementation

Definition at line 739 of file CPSegmentedControl.j.

◆ trackingMode()

- (CPSegmentSwitchTracking) trackingMode
implementation

Returns the control's tracking mode.

Definition at line 305 of file CPSegmentedControl.j.

◆ trackSegment:()

- (void) trackSegment: (CPEvent anEvent
implementation

Handles events for the segment

Parameters
anEventthe event to handle

Definition at line 864 of file CPSegmentedControl.j.

◆ widthForSegment:()

- (float) widthForSegment: (unsigned)  aSegment
implementation

Returns the width for the specified segment.

Parameters
aSegmentthe segment to get the width for
Exceptions
CPRangeExceptionif aSegment is out of bounds

Definition at line 328 of file CPSegmentedControl.j.


The documentation for this class was generated from the following files: