API 0.9.5
CPSegmentedControl Class Reference

#import <CPSegmentedControl.h>

Inheritance diagram for CPSegmentedControl:

List of all members.

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:

Class Methods

(CPString+ defaultThemeClass
(id) + themeAttributes

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

Definition at line 678 of file CPSegmentedControl.j.

- (CGRect) contentFrameForSegment: (unsigned)  aSegment

Definition at line 688 of file CPSegmentedControl.j.

- (CPView) createEphemeralSubviewNamed: (CPString aName

Reimplemented from CPView.

Definition at line 501 of file CPSegmentedControl.j.

+ (CPString) defaultThemeClass

Reimplemented from CPView.

Definition at line 49 of file CPSegmentedControl.j.

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

Draws the specified segment

Parameters:
aSegmentthe segment to draw
shouldHighlightYES highlights the bezel

Definition at line 605 of file CPSegmentedControl.j.

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

Draws the specified segment bezel

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

Definition at line 415 of file CPSegmentedControl.j.

- (void) encodeWithCoder: (CPCoder aCoder

Archives the view to a coder.

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

Reimplemented from CPControl.

Definition at line 871 of file CPSegmentedControl.j.

- (CGRect) frameForSegment: (unsigned)  aSegment

Returns the bounding rectangle for the specified segment.

Parameters:
aSegmentthe segment to get the rectangle for

Definition at line 673 of file CPSegmentedControl.j.

- (CPImage) imageForSegment: (unsigned)  aSegment

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

- (id) initWithCoder: (CPCoder aCoder

Initializes the view from an archive.

Parameters:
aCoderthe coder from which to initialize
Returns:
the initialized view

Reimplemented from CPControl.

Definition at line 824 of file CPSegmentedControl.j.

- (id) initWithFrame: (CGRect)  aFrame

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

Returns YES if the specified segment is enabled.

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

Definition at line 385 of file CPSegmentedControl.j.

- (BOOL) isSelectedForSegment: (unsigned)  aSegment

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

- (BOOL) isTracking

Definition at line 175 of file CPSegmentedControl.j.

- (CPString) labelForSegment: (unsigned)  aSegment

Returns the label for the specified segment

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

Definition at line 283 of file CPSegmentedControl.j.

- (void) layoutSubviews

Reimplemented from CPView.

Definition at line 509 of file CPSegmentedControl.j.

- (CPMenu) menuForSegment: (unsigned)  aSegment

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

- (void) mouseDown: (CPEvent anEvent

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

- (void) mouseUp: (CPEvent anEvent

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

Parameters:
anEventcontains information about the release

Reimplemented from CPResponder.

Definition at line 733 of file CPSegmentedControl.j.

- (CGRect) rectForEphemeralSubviewNamed: (CPString aName

Reimplemented from CPView.

Definition at line 448 of file CPSegmentedControl.j.

- (unsigned) segmentCount

Returns the number of segments in the button.

Definition at line 130 of file CPSegmentedControl.j.

- (unsigned) selectedSegment

Returns the selected segment.

Definition at line 150 of file CPSegmentedControl.j.

- (int) selectedTag

Returns the tag of the selected segment.

Definition at line 80 of file CPSegmentedControl.j.

- (BOOL) selectSegmentWithTag: (int)  aTag

Selects the button segment with the specified tag.

Definition at line 158 of file CPSegmentedControl.j.

- (void) setEnabled: (BOOL)  isEnabled
forSegment: (unsigned)  aSegment 

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

- (void) setFont: (CPFont aFont

Sets the font of the control.

Reimplemented from CPControl.

Definition at line 808 of file CPSegmentedControl.j.

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

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

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

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

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

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

- (void) setSegmentCount: (unsigned)  aCount

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 

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

- (void) setSelectedSegment: (unsigned)  aSegment

Selects a segment.

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

Definition at line 141 of file CPSegmentedControl.j.

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

Sets a tag for the specified segment.

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

Definition at line 395 of file CPSegmentedControl.j.

- (void) setTrackingMode: (CPSegmentSwitchTracking)  aTrackingMode

Definition at line 180 of file CPSegmentedControl.j.

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

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

- (int) tagForSegment: (unsigned)  aSegment

Returns the tag for the specified segment.

Parameters:
aSegmentthe segment to obtain the tag for

Definition at line 404 of file CPSegmentedControl.j.

- (unsigned) testSegment: (CGPoint)  aPoint

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

+ (id) themeAttributes

Reimplemented from CPControl.

Definition at line 54 of file CPSegmentedControl.j.

- (void) tileWithChangedSegment: (unsigned)  aSegment

Definition at line 609 of file CPSegmentedControl.j.

- (CPSegmentSwitchTracking) trackingMode

Returns the control's tracking mode.

Definition at line 213 of file CPSegmentedControl.j.

- (void) trackSegment: (CPEvent anEvent

Handles events for the segment

Parameters:
anEventthe event to handle

Definition at line 741 of file CPSegmentedControl.j.

- (float) widthForSegment: (unsigned)  aSegment

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


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Defines