Class CPSlider

CPObject
    extended byCPResponder
        extended byCPView
            extended byCPControl
                extended byCPSlider
Direct Known Subclasses:
NSSlider

@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 ALTs 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 CPObject
initialize, alloc, class, instanceMethodForSelector, instancesRespondToSelector, isSubclassOfClass, load, new, setVersion, superclass, version, init, autorelease, awakeAfterUsingCoder, class, classForCoder, classForKeyedArchiver, className, copy, dealloc, description, doesNotRecognizeSelector, forwardInvocation, hash, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableCopy, performSelector, performSelector, performSelector, release, replacementObjectForArchiver, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, retain, self, superclass

Methods inherited from class CPResponder
acceptsFirstResponder, becomeFirstResponder, deleteBackward, doCommandBySelector, insertLineBreak, insertText, interpretKeyEvents, keyDown, keyUp, menu, mouseDown, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseUp, nextResponder, noResponderFor, performKeyEquivalent, resignFirstResponder, scrollWheel, setMenu, setNextResponder, tryToPerform, undoManager

Methods inherited from class CPView
initWithFrame, acceptsFirstMouse, addSubview, addSubview, adjustScroll, alphaValue, autoresizesSubviews, autoresizingMask, autoscroll, backgroundColor, bounds, convertPoint, convertPoint, convertRect, convertRect, convertSize, convertSize, didAddSubview, display, displayIfNeeded, displayIfNeededInRect, displayRect, displayRectIgnoringOpacity, dragImage, dragView, drawRect, enclosingMenuItem, enclosingScrollView, enterFullScreenMode, exitFullScreenModeWithOptions, frame, hitTest, hitTests, isDescendantOf, isFlipped, isHidden, isHiddenOrHasHiddenAncestor, isInFullScreenMode, isOpaque, lockFocus, mouseDown, mouseDownCanMoveWindow, needsDisplay, postsBoundsChangedNotifications, postsFrameChangedNotifications, reflectScrolledClipView, registerForDraggedTypes, registeredDraggedTypes, removeFromSuperview, replaceSubview, resizeSubviewsWithOldSize, resizeWithOldSuperviewSize, scrollClipView, scrollPoint, scrollRectToVisible, scrollRect, setAlphaValue, setAutoresizesSubviews, setAutoresizingMask, setBackgroundColor, setBounds, setBoundsOrigin, setBoundsSize, setFrame, setFrameOrigin, setFrameSize, setHidden, setHitTests, setNeedsDisplay, setNeedsDisplayInRect, setPostsBoundsChangedNotifications, setPostsFrameChangedNotifications, subviews, superview, unlockFocus, unregisterDraggedTypes, viewDidMoveToSuperview, viewDidMoveToWindow, viewWillMoveToSuperview, viewWillMoveToWindow, visibleRect, willRemoveSubview, window

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

initWithFrame

-(id)initWithFrame:(CGRect)aFrame
Initializes the receiver for usage with the specified bounding rectangle
Parameters:
aFrame
Returns:
the initialized view

NS_initWithCoder

-(id)NS_initWithCoder:(CPCoder)aCoder
Parameters:
aCoder

NS_initWithCoder

-(id)NS_initWithCoder:(CPCoder)aCoder
Parameters:
aCoder

altIncrementValue

-(double)altIncrementValue
Returns the value by which the slider will be incremented if the user holds down the ALTs key.

bar

-(CPView)bar
Returns the slider's bar.

constrainKnobPosition

-(CGPoint)constrainKnobPosition:(CGPoint)aPoint
Parameters:
aPoint

isVertical

-(BOOL)isVertical
Returns YES if the slider is vertical.

knob

-(CPView)knob
Returns the slider's knob.

knobThickness

-(float)knobThickness
Returns the thickness of the slider's knob. This value is in pixels, and is the size of the knob along the slider's track.

maxValue

-(double)maxValue
Returns the slider's maximum value

minValue

-(double)minValue
Returns the slider's minimum value

mouseDown

-(void)mouseDown:(CPEvent)anEvent
Notifies the receiver that the user has clicked the mouse down in its area.
Parameters:
anEvent - contains information about the click

mouseDragged

-(void)mouseDragged:(CPEvent)anEvent
Notifies the receiver that the user has initiated a drag over it. A drag is a mouse movement while the left button is down.
Parameters:
anEvent - contains information about the drag

mouseUp

-(void)mouseUp:(CPEvent)anEvent
Notifies the receiver that the user has released the left mouse button.
Parameters:
anEvent - contains information about the release

setAltIncrementValue

-(void)setAltIncrementValue:(double)anIncrementValue
Sets the value the slider will be incremented if the user holds the ALT key.
Parameters:
anIncrementValue

setFrameSize

-(void)setFrameSize:(CGSize)aSize
Sets the receiver's frame size. If 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.
Parameters:
aSize - the new size for the frame

setMaxValue

-(void)setMaxValue:(double)aMaxValue
Sets the slider's maximum value
Parameters:
aMaxValue - the new maximum value

setMinValue

-(void)setMinValue:(double)aMinValue
Sets the slider's minimum value
Parameters:
aMinValue - the new minimum value

setValue

-(void)setValue:(double)aValue
Sets the slider's value
Parameters:
aValue - the new slider value

value

-(double)value
Returns the slider's value

Created on Sat Sep 13 14:15:43 PDT 2008