CPObjectCPResponder
CPView
CPControl
CPSlider
@implementation CPSlider : CPControl
An CPSlider
displays, and allows control of, some value in the application. It represents a continuous stream of values of type float
, which can be retrieved by the method floatValue
and set by the method setFloatValue:
.
Method Summary | |
---|---|
-(id) | initWithFrame:(CGRect)aFrame Initializes the receiver for usage with the specified bounding rectangle. |
-(id) | NS_initWithCoder:(CPCoder)aCoder |
-(id) | NS_initWithCoder:(CPCoder)aCoder |
-(double) | altIncrementValue Returns the value by which the slider will be incremented if the user holds down the ALT s key. |
-(CPView) | bar Returns the slider's bar. |
-(CGPoint) | constrainKnobPosition:(CGPoint)aPoint |
-(BOOL) | isVertical Returns YES if the slider is vertical. |
-(CPView) | knob Returns the slider's knob. |
-(float) | knobThickness Returns the thickness of the slider's knob. |
-(double) | maxValue Returns the slider's maximum value. |
-(double) | minValue Returns the slider's minimum value. |
-(void) | mouseDown:(CPEvent)anEvent Notifies the receiver that the user has clicked the mouse down in its area. |
-(void) | mouseDragged:(CPEvent)anEvent Notifies the receiver that the user has initiated a drag over it. |
-(void) | mouseUp:(CPEvent)anEvent Notifies the receiver that the user has released the left mouse button. |
-(void) | setAltIncrementValue:(double)anIncrementValue Sets the value the slider will be incremented if the user holds the ALT key. |
-(void) | setFrameSize:(CGSize)aSize Sets the receiver's frame size. |
-(void) | setMaxValue:(double)aMaxValue Sets the slider's maximum value. |
-(void) | setMinValue:(double)aMinValue Sets the slider's minimum value. |
-(void) | setValue:(double)aValue Sets the slider's value. |
-(double) | value Returns the slider's value. |
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)aFrame
aFrame
-(id)NS_initWithCoder:(CPCoder)aCoder
aCoder
-(id)NS_initWithCoder:(CPCoder)aCoder
aCoder
-(double)altIncrementValue
ALT
s key.-(CPView)bar
-(CGPoint)constrainKnobPosition:(CGPoint)aPoint
aPoint
-(BOOL)isVertical
YES
if the slider is vertical.-(CPView)knob
-(float)knobThickness
-(double)maxValue
-(double)minValue
-(void)mouseDown:(CPEvent)anEvent
anEvent
- contains information about the click-(void)mouseDragged:(CPEvent)anEvent
anEvent
- contains information about the drag-(void)mouseUp:(CPEvent)anEvent
anEvent
- contains information about the release-(void)setAltIncrementValue:(double)anIncrementValue
ALT
key.anIncrementValue
-(void)setFrameSize:(CGSize)aSize
aSize
is the same as the frame's current dimensions, this
method simply returns. The method posts a CPViewFrameDidChangeNotification
to the
default notification center if the receiver is configured to do so.aSize
- the new size for the frame-(void)setMaxValue:(double)aMaxValue
aMaxValue
- the new maximum value-(void)setMinValue:(double)aMinValue
aMinValue
- the new minimum value-(void)setValue:(double)aValue
aValue
- the new slider value-(double)value
Created on Sat Sep 13 14:15:43 PDT 2008