API  0.9.7
 All Classes Files Functions Variables Macros Groups Pages
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:
 
(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
(BOOL) - acceptsFirstMouse:
 
(SEL) - action
 
(CPTextAlignment) - alignment
 
(BOOL) - continueTracking:at:
 
(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) - 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
 

Class Methods

(CPString+ defaultThemeClass
 
(CPDictionary+ themeAttributes
 
- Class Methods inherited from CPControl
(void) + initialize
 

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

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

Definition at line 103 of file CPSegmentedControl.j.

- (CGRect) contentFrameForSegment: (unsigned)  aSegment
implementation

Definition at line 747 of file CPSegmentedControl.j.

- (CPView) createEphemeralSubviewNamed: (CPString aName
implementation

Definition at line 560 of file CPSegmentedControl.j.

+ (CPString) defaultThemeClass
implementation

Definition at line 50 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 664 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 474 of file CPSegmentedControl.j.

- (void) encodeWithCoder: (CPCoder aCoder
implementation

Reimplemented from CPControl.

Provided by category CPSegmentedControl(CPCoding).

Definition at line 931 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 732 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 316 of file CPSegmentedControl.j.

- (id) initWithCoder: (CPCoder aCoder
implementation

Reimplemented from CPControl.

Provided by category CPSegmentedControl(CPCoding).

Definition at line 884 of file CPSegmentedControl.j.

- (id) initWithFrame: (CGRect)  aRect
implementation

Reimplemented from CPControl.

Definition at line 86 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 444 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 412 of file CPSegmentedControl.j.

- (BOOL) isTracking
implementation

Definition at line 231 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 339 of file CPSegmentedControl.j.

- (void) layoutSubviews
implementation

Definition at line 568 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 360 of file CPSegmentedControl.j.

- (void) mouseDown: (CPEvent anEvent
implementation

Reimplemented from CPControl.

Definition at line 783 of file CPSegmentedControl.j.

- (void) mouseUp: (CPEvent anEvent
implementation

Definition at line 792 of file CPSegmentedControl.j.

- (CGRect) rectForEphemeralSubviewNamed: (CPString aName
implementation

Definition at line 507 of file CPSegmentedControl.j.

- (unsigned) segmentCount
implementation

Returns the number of segments in the button.

Definition at line 171 of file CPSegmentedControl.j.

- (unsigned) selectedSegment
implementation

Returns the selected segment.

Definition at line 191 of file CPSegmentedControl.j.

- (int) selectedTag
implementation

Returns the tag of the selected segment.

Definition at line 119 of file CPSegmentedControl.j.

- (BOOL) selectSegmentWithTag: (int)  aTag
implementation

Selects the button segment with the specified tag.

Definition at line 199 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 423 of file CPSegmentedControl.j.

- (void) setFont: (CPFont aFont
implementation

Sets the font of the control.

Reimplemented from CPControl.

Definition at line 868 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 304 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 327 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 350 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 129 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 372 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 182 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 454 of file CPSegmentedControl.j.

- (void) setTrackingMode: (CPSegmentSwitchTracking)  aTrackingMode
implementation

Definition at line 236 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 281 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 463 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 762 of file CPSegmentedControl.j.

+ (CPDictionary) themeAttributes
implementation

Reimplemented from CPControl.

Definition at line 55 of file CPSegmentedControl.j.

- (void) tileWithChangedSegment: (unsigned)  aSegment
implementation

Definition at line 668 of file CPSegmentedControl.j.

- (CPSegmentSwitchTracking) trackingMode
implementation

Returns the control's tracking mode.

Definition at line 269 of file CPSegmentedControl.j.

- (void) trackSegment: (CPEvent anEvent
implementation

Handles events for the segment

Parameters
anEventthe event to handle

Definition at line 800 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 293 of file CPSegmentedControl.j.


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