CPObjectCPResponder
CPView
CPControl
CPSegmentedControl
@implementation CPSegmentedControl : CPControl
This class is a horizontal button with multiple segments.
Method Summary | |
---|---|
-(id) | initWithFrame:(CGRect)aRect Initializes the receiver for usage with the specified bounding rectangle. |
-(void) | drawSegmentBezel:(int)aSegment highlgiht:(BOOL)shouldHighlight Draws the specified segment bezel. |
-(void) | drawSegment:(int)aSegment highlight:(BOOL)shouldHighlight Draws the specified segment. |
-(CGRect) | frameForSegment:(unsigned)aSegment Returns the bounding rectangle for the specified segment. |
-(CPImage) | imageForSegment:(unsigned)aSegment Returns the image for the specified segment. |
-(BOOL) | isEnabledForSegment:(unsigned)aSegment Returns YES if the specified segment is enabled. |
-(BOOL) | isSelectedForSegment:(unsigned)aSegment Returns YES if the specified segment is selected. |
-(BOOL) | isTracking |
-(CPString) | labelForSegment:(unsigned)aSegment Returns the label for the specified segment. |
-(CPMenu) | menuForSegment:(unsigned)aSegment Returns the menu for the specified segment. |
-(void) | mouseDown:(CPEvent)anEvent Notifies the receiver that the user has clicked the mouse down in its area. |
-(void) | mouseUp:(CPEvent)anEvent Notifies the receiver that the user has released the left mouse button. |
-(unsigned) | segmentCount Returns the number of segments in the button. |
-(BOOL) | selectSegmentWithTag:(int)aTag Selects the button segment with the specified tag. |
-(unsigned) | selectedSegment Returns the selected segment. |
-(int) | selectedTag Returns the tag of the selected segment. |
-(void) | setEnabled:(BOOL)isEnabled forSegment:(unsigned)aSegment Enables/diables the specified segment. |
-(void) | setFont:(CPFont)aFont Sets the receiver's font. |
-(void) | setImage:(CPImage)anImage forSegment:(unsigned)aSegment Sets the image for the specified segment. |
-(void) | setLabel:(CPString)aLabel forSegment:(unsigned)aSegment Sets the label for the specified segment. |
-(void) | setMenu:(CPMenu)aMenu forSegment:(unsigned)aSegment Sets the menu for the specified segment. |
-(void) | setSegmentCount:(unsigned)aCount Sets the number of segments in the button. |
-(void) | setSelectedSegment:(unsigned)aSegment Selects a segment. |
-(void) | setSelected:(BOOL)isSelected forSegment:(unsigned)aSegment Sets the selection for the specified segment. |
-(void) | setTag:(int)aTag forSegment:(unsigned)aSegment Sets a tag for the specified segment. |
-(void) | setTrackingMode:(CPSegmentSwitchTracking)aTrackingMode |
-(void) | setWidth:(float)aWidth forSegment:(unsigned)aSegment Sets the width of the specified segment. |
-(int) | tagForSegment:(unsigned)aSegment Returns the tag for the specified segment. |
-(unsigned) | testSegment:(CGPoint)aPoint Returns the segment that is hit by the specified point. |
-(void) | tileWithChangedSegment:(unsigned)aSegment |
-(void) | trackSegment:(CPEvent)anEvent Handles events for the segment. |
-(CPSegmentSwitchTracking) | trackingMode Returns the control's tracking mode. |
-(float) | widthForSegment:(unsigned)aSegment Returns the width for the specified segment. |
Methods inherited from class CPControl |
---|
initWithFrame, action, alignment, backgroundColorForName, floatValue, font, isEnabled, mouseUp, sendAction, setAction, setAlignment, setBackgroundColor, setBackgroundColorWithName, setBackgroundColor, setEnabled, setFloatValue, setFont, setTarget, setTextColor, setTextShadow, target, textColor, textShadow |
Method Detail |
---|
-(id)initWithFrame:(CGRect)aRect
aRect
-(void)drawSegmentBezel:(int)aSegment highlgiht:(BOOL)shouldHighlight
aSegment
- the segment to draw the bezel forshouldHighlight
- YES
highlights the bezel-(void)drawSegment:(int)aSegment highlight:(BOOL)shouldHighlight
aSegment
- the segment to drawshouldHighlight
- YES
highlights the bezel-(CGRect)frameForSegment:(unsigned)aSegment
aSegment
- the segment to get the rectangle for-(CPImage)imageForSegment:(unsigned)aSegment
aSegment
- the segment to obtain the image forCPRangeException
- if aSegment
is out of bounds-(BOOL)isEnabledForSegment:(unsigned)aSegment
YES
if the specified segment is enabled.aSegment
- the segment to checkCPRangeException
- if aSegment
is out of bounds-(BOOL)isSelectedForSegment:(unsigned)aSegment
YES
if the specified segment is selected.aSegment
- the segment to check for selectionCPRangeException
- if aSegment
is out of bounds-(BOOL)isTracking
-(CPString)labelForSegment:(unsigned)aSegment
aSegment
CPRangeException
- if aSegment
is out of bounds-(CPMenu)menuForSegment:(unsigned)aSegment
aSegment
- the segment to obtain the menu forCPRangeException
- if aSegment
is out of bounds-(void)mouseDown:(CPEvent)anEvent
anEvent
- contains information about the click-(void)mouseUp:(CPEvent)anEvent
anEvent
- contains information about the release-(unsigned)segmentCount
-(BOOL)selectSegmentWithTag:(int)aTag
aTag
-(unsigned)selectedSegment
-(int)selectedTag
-(void)setEnabled:(BOOL)isEnabled forSegment:(unsigned)aSegment
isEnabled
- YES
enables the segmentaSegment
- the segment to enable/disbleCPRangeException
- if aSegment
is out of bounds-(void)setFont:(CPFont)aFont
aFont
- the font for the receiver-(void)setImage:(CPImage)anImage forSegment:(unsigned)aSegment
anImage
- the image for the segmentaSegment
- the segment to set the image onCPRangeException
- if aSegment
is out of bounds-(void)setLabel:(CPString)aLabel forSegment:(unsigned)aSegment
aLabel
- the label for the segmentaSegment
- the segment to labelCPRangeException
- if aSegment
is out of bounds-(void)setMenu:(CPMenu)aMenu forSegment:(unsigned)aSegment
aMenu
- the menu to setaSegment
- the segment to set the menu onCPRangeException
- if aSegment
is out of bounds-(void)setSegmentCount:(unsigned)aCount
aCount
- the number of segments on
the button-(void)setSelectedSegment:(unsigned)aSegment
aSegment
- the segment to selectCPRangeException
- if aSegment
is out of bounds-(void)setSelected:(BOOL)isSelected forSegment:(unsigned)aSegment
isSelected
- YES
selects the segment. NO
deselects it.aSegment
- the segment to set the selection forCPRangeException
- if aSegment
is out of bounds-(void)setTag:(int)aTag forSegment:(unsigned)aSegment
aTag
- the tag to setaSegment
- the segment to set the tag on-(void)setTrackingMode:(CPSegmentSwitchTracking)aTrackingMode
aTrackingMode
-(void)setWidth:(float)aWidth forSegment:(unsigned)aSegment
aWidth
- the new width for the segmentaSegment
- the segment to set the width forCPRangeException
- if aSegment
is out of bounds-(int)tagForSegment:(unsigned)aSegment
aSegment
- the segment to obtain the tag for-(unsigned)testSegment:(CGPoint)aPoint
aPoint
- the point to test for a segment hit-(void)tileWithChangedSegment:(unsigned)aSegment
aSegment
-(void)trackSegment:(CPEvent)anEvent
anEvent
- the event to handle-(CPSegmentSwitchTracking)trackingMode
-(float)widthForSegment:(unsigned)aSegment
aSegment
- the segment to get the width forCPRangeException
- if aSegment
is out of boundsCreated on Sat Sep 13 14:15:43 PDT 2008