CPObjectCPResponder
CPView
CPControl
CPScroller
@implementation CPScroller : CPControl
Method Summary | |
---|---|
+(float) | scrollerWidth Returns the CPScroller 's width for a CPRegularControlSize . |
+(float) | scrollerWidthForControlSize:(CPControlSize)aControlSize Returns the width of a CPScroller for the specified CPControlSize . |
-(id) | initWithFrame:(CGRect)aFrame Initializes the receiver for usage with the specified bounding rectangle. |
-(void) | checkSpaceForParts Check if there's enough space in the scroller to display the knob. |
-(CPControlSize) | controlSize Returns the scroller's control size. |
-(void) | drawArrow:(CPScrollerArrow)anArrow highlight:(BOOL)shouldHighlight Draws the specified arrow and sets the highlight. |
-(void) | drawKnob Draws the knob. |
-(void) | drawKnobSlot Draws the knob's slot. |
-(void) | drawParts Caches images for the scroll arrow and knob. |
-(void) | highlight:(BOOL)shouldHighlight Draws the scroller's arrow with a possible highlight, if the user's mouse is over it. |
-(CPScrollerPart) | hitPart Returns the part of the scroller that was hit. |
-(float) | knobProportion Return's the knob's proportion. |
-(void) | layoutSubviews Lays out the scrollers subviews. |
-(void) | mouseDown:(CPEvent)anEvent Notifies the receiver that the user has clicked the mouse down in its area. |
-(CGRect) | rectForPart:(CPScrollerPart)aPart |
-(void) | setControlSize:(CPControlSize)aControlSize Sets the scroller's size. |
-(void) | setEnabled:(BOOL)shouldBeEnabled Sets whether the receiver responds to mouse events. |
-(void) | setFloatValue:(float)aValue Sets the scroller's knob position (ranges from 0. |
-(void) | setFloatValue:(float)aValue knobProportion:(float)aProportion Sets the position and proportion of the knob. |
-(void) | setFrameSize:(CGSize)aSize Sets the receiver's frame size. |
-(CPScrollerPart) | testPart:(CGPoint)aPoint Returns the part of the scroller that would be hit by aPoint . |
-(void) | trackKnob:(CPEvent)anEvent Tracks the knob. |
-(void) | trackScrollButtons:(CPEvent)anEvent Tracks the scroll button. |
-(CPUsableScrollerParts) | usableParts Returns all the parts of the scroller that are usable for displaying. |
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 |
---|
+(float)scrollerWidth
CPScroller
's width for a CPRegularControlSize
.+(float)scrollerWidthForControlSize:(CPControlSize)aControlSize
CPScroller
for the specified CPControlSize
.aControlSize
- the size of a controller to return the width for-(id)initWithFrame:(CGRect)aFrame
aFrame
-(void)checkSpaceForParts
-(CPControlSize)controlSize
-(void)drawArrow:(CPScrollerArrow)anArrow highlight:(BOOL)shouldHighlight
anArrow
- the arrow to drawshouldHighlight
- sets whether the arrow should be highlighted-(void)drawKnob
-(void)drawKnobSlot
-(void)drawParts
-(void)highlight:(BOOL)shouldHighlight
shouldHighlight
- YES
will draw the
arrow highlighted if the mouse is hovering over it.-(CPScrollerPart)hitPart
-(float)knobProportion
-(void)layoutSubviews
-(void)mouseDown:(CPEvent)anEvent
anEvent
- contains information about the click-(CGRect)rectForPart:(CPScrollerPart)aPart
aPart
-(void)setControlSize:(CPControlSize)aControlSize
aControlSize
- the scroller's size-(void)setEnabled:(BOOL)shouldBeEnabled
shouldBeEnabled
-(void)setFloatValue:(float)aValue
aValue
- the knob position (ranges from 0.0 to 1.0)-(void)setFloatValue:(float)aValue knobProportion:(float)aProportion
aValue
- the knob position (ranges from 0.0 to 1.0)aProportion
- the knob's proportion (ranges from 0.0 to 1.0)-(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-(CPScrollerPart)testPart:(CGPoint)aPoint
aPoint
.aPoint
- the simulated point hit-(void)trackKnob:(CPEvent)anEvent
anEvent
- the input event-(void)trackScrollButtons:(CPEvent)anEvent
anEvent
- the input event-(CPUsableScrollerParts)usableParts
Created on Sat Sep 13 14:15:43 PDT 2008