API  0.9.6
 All Classes Files Functions Variables Macros Modules Pages
CPSegmentedControl Class Reference

#import <CPSegmentedControl.h>

+ Inheritance diagram for CPSegmentedControl:

Instance Methods

(CGRect) - bezelFrameForSegment:
 
(CGRect) - contentFrameForSegment:
 
(CPView- createEphemeralSubviewNamed:
 
(void) - drawSegment:highlight:
 
(void) - drawSegmentBezel:highlight:
 
(void) - encodeWithCoder:
 
(CGRect) - frameForSegment:
 
(CPImage- imageForSegment:
 
(id) - initWithCoder:
 
(id) - initWithFrame:
 
(BOOL) - isEnabledForSegment:
 
(BOOL) - isSelectedForSegment:
 
(BOOL) - isTracking
 
(CPString- labelForSegment:
 
(void) - layoutSubviews
 
(CPMenu- menuForSegment:
 
(void) - mouseDown:
 
(void) - mouseUp:
 
(CGRect) - rectForEphemeralSubviewNamed:
 
(unsigned) - segmentCount
 
(unsigned) - selectedSegment
 
(int) - selectedTag
 
(BOOL) - selectSegmentWithTag:
 
(void) - setEnabled:forSegment:
 
(void) - setFont:
 
(void) - setImage:forSegment:
 
(void) - setLabel:forSegment:
 
(void) - setMenu:forSegment:
 
(void) - setSegmentCount:
 
(void) - setSelected:forSegment:
 
(void) - setSelectedSegment:
 
(void) - setTag:forSegment:
 
(void) - setTrackingMode:
 
(void) - setWidth:forSegment:
 
(int) - tagForSegment:
 
(unsigned) - testSegment:
 
(void) - tileWithChangedSegment:
 
(CPSegmentSwitchTracking) - trackingMode
 
(void) - trackSegment:
 
(float) - widthForSegment:
 
- Instance Methods inherited from CPControl
(SEL) - action
 
(CPTextAlignment) - alignment
 
(BOOL) - continueTracking:at:
 
(double) - doubleValue
 
(float) - floatValue
 
(CPFont- font
 
(CPFormatter- formatter
 
(void) - highlight:
 
(CPCellImagePosition) - imagePosition
 
(CPImageScaling) - imageScaling
 
(int) - integerValue
 
(int) - intValue
 
(BOOL) - isContinuous
 
(BOOL) - isEnabled
 
(BOOL) - isHighlighted
 
(CPLineBreakMode) - lineBreakMode
 
(unsigned) - mouseDownFlags
 
(void) - mouseEntered:
 
(void) - mouseExited:
 
(int) - nextState
 
(id) - objectValue
 
(void) - performClick:
 
(BOOL) - sendAction:to:
 
(int) - sendActionOn:
 
(BOOL) - sendsActionOnEndEditing
 
(void) - setAction:
 
(void) - setAlignment:
 
(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:
 
(CPTextVerticalAlignment) - verticalAlignment
 
- Instance Methods inherited from CPView
(BOOL) - acceptsFirstMouse:
 
(void) - addSubview:
 
(void) - addSubview:positioned:relativeTo:
 
(CGRect) - adjustScroll:
 
(float) - alphaValue
 
(BOOL) - autoresizesSubviews
 
(unsigned) - autoresizingMask
 
(BOOL) - autoscroll:
 
(CPColor- backgroundColor
 
(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:
 
(id) - currentValueForThemeAttribute:
 
(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:
 
(CPMenuItem- enclosingMenuItem
 
(CPScrollView- enclosingScrollView
 
(BOOL) - enterFullScreenMode
 
(BOOL) - enterFullScreenMode:withOptions:
 
(CPView- ephemeralSubviewNamed:
 
(void) - exitFullScreenMode
 
(void) - exitFullScreenModeWithOptions:
 
(CGRect) - frame
 
(CGPoint) - frameOrigin
 
(CGSize) - frameSize
 
(BOOL) - hasThemeAttribute:
 
(BOOL) - hasThemeState:
 
(CPView- hitTest:
 
(BOOL) - hitTests
 
(id) - init
 
(BOOL) - inLiveResize
 
(BOOL) - isDescendantOf:
 
(BOOL) - isFlipped
 
(BOOL) - isHidden
 
(BOOL) - isHiddenOrHasHiddenAncestor
 
(BOOL) - isInFullScreenMode
 
(BOOL) - isOpaque
 
(CALayer- layer
 
(CPView- layoutEphemeralSubviewNamed:positioned:relativeToEphemeralSubviewNamed:
 
(void) - layoutIfNeeded
 
(void) - lockFocus
 
(CPMenu- menuForEvent:
 
(BOOL) - mouseDownCanMoveWindow
 
(BOOL) - needsDisplay
 
(BOOL) - needsPanelToBecomeKey
 
(CPView- nextKeyView
 
(CPView- nextValidKeyView
 
(BOOL) - performKeyEquivalent:
 
(BOOL) - postsBoundsChangedNotifications
 
(BOOL) - postsFrameChangedNotifications
 
(CPView- previousKeyView
 
(CPView- previousValidKeyView
 
(void) - reflectScrolledClipView:
 
(CPArray- registeredDraggedTypes
 
(void) - registerForDraggedTypes:
 
(void) - registerThemeValues:
 
(void) - registerThemeValues:inherit:
 
(void) - removeFromSuperview
 
(void) - replaceSubview:with:
 
(void) - resizeSubviewsWithOldSize:
 
(void) - resizeWithOldSuperviewSize:
 
(void) - rightMouseDown:
 
(void) - scrollClipView:toPoint:
 
(void) - scrollPoint:
 
(void) - scrollRect:by:
 
(BOOL) - scrollRectToVisible:
 
(void) - setAlphaValue:
 
(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) - setNextKeyView:
 
(void) - setPostsBoundsChangedNotifications:
 
(void) - setPostsFrameChangedNotifications:
 
(void) - setSubviews:
 
(void) - setTag:
 
(void) - setTheme:
 
(void) - setThemeClass:
 
(BOOL) - setThemeState:
 
(void) - setToolTip:
 
(void) - setValue:forThemeAttribute:
 
(void) - setValue:forThemeAttribute:inState:
 
(void) - setWantsLayer:
 
(CPArray- subviews
 
(CPView- superview
 
(CPInteger) - tag
 
(CPTheme- theme
 
(CPString- themeClass
 
(unsigned) - themeState
 
(CPString- toolTip
 
(void) - unlockFocus
 
(void) - unregisterDraggedTypes
 
(BOOL) - unsetThemeState:
 
(id) - valueForThemeAttribute:
 
(id) - valueForThemeAttribute:inState:
 
(void) - viewDidChangeTheme
 
(void) - viewDidEndLiveResize
 
(void) - viewDidHide
 
(void) - viewDidMoveToSuperview
 
(void) - viewDidMoveToWindow
 
(void) - viewDidUnhide
 
(void) - viewWillDraw
 
(void) - viewWillMoveToSuperview:
 
(void) - viewWillMoveToWindow:
 
(void) - viewWillStartLiveResize
 
(CPView- viewWithTag:
 
(CGRect) - visibleRect
 
(BOOL) - wantsLayer
 
(void) - willRemoveSubview:
 
(CPWindow- window
 
- Instance Methods inherited from CPResponder
(BOOL) - acceptsFirstResponder
 
(BOOL) - becomeFirstResponder
 
(void) - doCommandBySelector:
 
(void) - flagsChanged:
 
(void) - insertBackTab:
 
(void) - insertLineBreak:
 
(void) - insertNewline:
 
(void) - insertTab:
 
(void) - insertText:
 
(void) - interpretKeyEvents:
 
(void) - keyDown:
 
(void) - keyUp:
 
(CPMenu- menu
 
(void) - mouseDragged:
 
(void) - mouseMoved:
 
(CPResponder- nextResponder
 
(void) - noResponderFor:
 
(BOOL) - resignFirstResponder
 
(void) - rightMouseUp:
 
(void) - scrollWheel:
 
(void) - setMenu:
 
(void) - setNextResponder:
 
(BOOL) - tryToPerform:with:
 
(CPUndoManager- undoManager
 
- Instance Methods inherited from CPObject
(void) - addObserver:forKeyPath:options:context:
 
(void) - applyChange:toKeyPath:
 
(id) - autorelease
 
(id) - awakeAfterUsingCoder:
 
(void) - awakeFromCib
 
(void) - bind:toObject:withKeyPath:options:
 
(Class) - classForCoder
 
(Class) - classForKeyedArchiver
 
(CPString- className
 
(id) - copy
 
(void) - dealloc
 
(CPString- description
 
(CPDictionary- dictionaryWithValuesForKeys:
 
(void) - didChange:valuesAtIndexes:forKey:
 
(void) - didChangeValueForKey:
 
(void) - didChangeValueForKey:withSetMutation:usingObjects:
 
(void) - doesNotRecognizeSelector:
 
(CPArray- exposedBindings
 
(id) - forwardingTargetForSelector:
 
(void) - forwardInvocation:
 
(unsigned) - hash
 
(BOOL) - implementsSelector:
 
(CPDictionary- infoForBinding:
 
(BOOL) - isEqual:
 
(BOOL) - isKindOfClass:
 
(BOOL) - isMemberOfClass:
 
(BOOL) - isProxy
 
(IMP) - methodForSelector:
 
(CPMethodSignature) - methodSignatureForSelector:
 
(id) - mutableArrayValueForKey:
 
(id) - mutableArrayValueForKeyPath:
 
(id) - mutableCopy
 
(id) - mutableSetValueForKey:
 
(id) - mutableSetValueForKeyPath:
 
(id) - performSelector:
 
(id) - performSelector:withObject:
 
(id) - performSelector:withObject:withObject:
 
(id) - performSelector:withObjects:
 
(void) - release
 
(void) - removeObserver:forKeyPath:
 
(id) - replacementObjectForArchiver:
 
(id) - replacementObjectForCoder:
 
(id) - replacementObjectForKeyedArchiver:
 
(BOOL) - respondsToSelector:
 
(id) - retain
 
(id) - self
 
(void) - setValue:forKey:
 
(void) - setValue:forKeyPath:
 
(void) - setValue:forUndefinedKey:
 
(void) - setValuesForKeysWithDictionary:
 
(CPString- UID
 
(void) - unbind:
 
(Class) - valueClassForBinding:
 
(id) - valueForKey:
 
(id) - valueForKeyPath:
 
(id) - valueForUndefinedKey:
 
(void) - willChange:valuesAtIndexes:forKey:
 
(void) - willChangeValueForKey:
 
(void) - willChangeValueForKey:withSetMutation:usingObjects:
 

Class Methods

(CPString+ defaultThemeClass
 
(id) + themeAttributes
 
- Class Methods inherited from CPControl
(void) + initialize
 
- Class Methods inherited from CPView
(CPMenu+ defaultMenu
 
(CPSet+ keyPathsForValuesAffectingBounds
 
(CPSet+ keyPathsForValuesAffectingFrame
 
- Class Methods inherited from CPObject
(BOOL) + accessInstanceVariablesDirectly
 
(id) + alloc
 
(id) + allocWithCoder:
 
(BOOL) + automaticallyNotifiesObserversForKey:
 
(Class) + class
 
(void) + exposeBinding:
 
(IMP) + instanceMethodForSelector:
 
(BOOL) + instancesRespondToSelector:
 
(BOOL) + isSubclassOfClass:
 
(CPSet+ keyPathsForValuesAffectingValueForKey:
 
(void) + load
 
(id) + new
 
(void) + setVersion:
 
(Class) + superclass
 
(int) + version
 

Additional Inherited Members

- Instance Variables inherited from CPObject
Class isa
 

Detailed Description

This class is a horizontal button with multiple segments.

Definition at line 2 of file CPSegmentedControl.h.

Method Documentation

- (CGRect) bezelFrameForSegment: (unsigned)  aSegment
implementation

Definition at line 683 of file CPSegmentedControl.j.

- (CGRect) contentFrameForSegment: (unsigned)  aSegment
implementation

Definition at line 693 of file CPSegmentedControl.j.

- (CPView) createEphemeralSubviewNamed: (CPString aName
implementation

Reimplemented from CPView.

Definition at line 506 of file CPSegmentedControl.j.

+ (CPString) defaultThemeClass
implementation

Reimplemented from CPView.

Definition at line 49 of file CPSegmentedControl.j.

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

Draws the specified segment

Parameters
aSegmentthe segment to draw
shouldHighlightYES highlights the bezel

Definition at line 610 of file CPSegmentedControl.j.

- (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 420 of file CPSegmentedControl.j.

- (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 876 of file CPSegmentedControl.j.

- (CGRect) frameForSegment: (unsigned)  aSegment
implementation

Returns the bounding rectangle for the specified segment.

Parameters
aSegmentthe segment to get the rectangle for

Definition at line 678 of file CPSegmentedControl.j.

- (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 262 of file CPSegmentedControl.j.

- (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 829 of file CPSegmentedControl.j.

- (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 60 of file CPSegmentedControl.j.

- (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 390 of file CPSegmentedControl.j.

- (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 358 of file CPSegmentedControl.j.

- (BOOL) isTracking
implementation

Definition at line 177 of file CPSegmentedControl.j.

- (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 285 of file CPSegmentedControl.j.

- (void) layoutSubviews
implementation

Reimplemented from CPView.

Definition at line 514 of file CPSegmentedControl.j.

- (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 306 of file CPSegmentedControl.j.

- (void) mouseDown: (CPEvent anEvent
implementation

Notifies the receiver that the user has clicked the mouse down in its area.

Parameters
anEventcontains information about the click

Reimplemented from CPControl.

Definition at line 729 of file CPSegmentedControl.j.

- (void) mouseUp: (CPEvent anEvent
implementation

Notifies the receiver that the user has released the left mouse button.

Parameters
anEventcontains information about the release

Reimplemented from CPResponder.

Definition at line 738 of file CPSegmentedControl.j.

- (CGRect) rectForEphemeralSubviewNamed: (CPString aName
implementation

Reimplemented from CPView.

Definition at line 453 of file CPSegmentedControl.j.

- (unsigned) segmentCount
implementation

Returns the number of segments in the button.

Definition at line 132 of file CPSegmentedControl.j.

- (unsigned) selectedSegment
implementation

Returns the selected segment.

Definition at line 152 of file CPSegmentedControl.j.

- (int) selectedTag
implementation

Returns the tag of the selected segment.

Definition at line 80 of file CPSegmentedControl.j.

- (BOOL) selectSegmentWithTag: (int)  aTag
implementation

Selects the button segment with the specified tag.

Definition at line 160 of file CPSegmentedControl.j.

- (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 369 of file CPSegmentedControl.j.

- (void) setFont: (CPFont aFont
implementation

Sets the font of the control.

Reimplemented from CPControl.

Definition at line 813 of file CPSegmentedControl.j.

- (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 250 of file CPSegmentedControl.j.

- (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 273 of file CPSegmentedControl.j.

- (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 296 of file CPSegmentedControl.j.

- (void) setSegmentCount: (unsigned)  aCount
implementation

Sets the number of segments in the button.

Parameters
aCountthe number of segments on the button

Definition at line 90 of file CPSegmentedControl.j.

- (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 318 of file CPSegmentedControl.j.

- (void) setSelectedSegment: (unsigned)  aSegment
implementation

Selects a segment.

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

Definition at line 143 of file CPSegmentedControl.j.

- (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 400 of file CPSegmentedControl.j.

- (void) setTrackingMode: (CPSegmentSwitchTracking)  aTrackingMode
implementation

Definition at line 182 of file CPSegmentedControl.j.

- (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 227 of file CPSegmentedControl.j.

- (int) tagForSegment: (unsigned)  aSegment
implementation

Returns the tag for the specified segment.

Parameters
aSegmentthe segment to obtain the tag for

Definition at line 409 of file CPSegmentedControl.j.

- (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 708 of file CPSegmentedControl.j.

+ (id) themeAttributes
implementation

Reimplemented from CPControl.

Definition at line 54 of file CPSegmentedControl.j.

- (void) tileWithChangedSegment: (unsigned)  aSegment
implementation

Definition at line 614 of file CPSegmentedControl.j.

- (CPSegmentSwitchTracking) trackingMode
implementation

Returns the control's tracking mode.

Definition at line 215 of file CPSegmentedControl.j.

- (void) trackSegment: (CPEvent anEvent
implementation

Handles events for the segment

Parameters
anEventthe event to handle

Definition at line 746 of file CPSegmentedControl.j.

- (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 239 of file CPSegmentedControl.j.


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