- Inherits From:
- NSView
- Declared In:
- EDActivityIndicator.h
struct EDAIFlags flags;
NSColor *bgColor;
id target;
SEL action;
float xpos;
NSTimer *animationTimer;
flags All instance variables are private. bgColor target action xpos animationTimer
Animation imageChanging the indicator's appearance
- + animation
Setting and getting the indicator's attributes
- - setBackgroundColor:
- - backgroundColor
- - setDrawsBackground:
- - drawsBackground
Setting target and action
- - setHidesOnLoad:
- - hidesOnLoad
- - setIsHidden:
- - isHidden
- - setFrameRate:
- - frameRate
Managing the animation
- - setTarget:
- - target
- - setAction:
- - action
Drawing and highlighting the activity indicator
- - step:
- - startAnimation:
- - stopAnimation:
- - highlight:
+ (NSImage *)animation
Returns all frames of the animation in one NSImage. Frames are assumed to be squares and arranged in a row from left to right. Consequently, if the size of the frames is s x s and the animation contains n frames the image must be s x (s * n) in size.
This method must be efficient as it is called frequently.
- (SEL)action
Returns the receiver's action-message selector.
- (NSColor *)backgroundColor
Returns the receiver's background color.
- (BOOL)drawsBackground
Returns YES if the receiver draws its background, NO if it doesn't.
- (unsigned int)frameRate
Returns the current frame rate for the animation.
- (BOOL)hidesOnLoad
Returns YES if the receiver automatically hides when the NIB file is loaded.
- (void)highlight:(BOOL)flag
If the receiver's highlight status is different from flag, sets that status to flag and, if flag is YES, highlights the the receiver by drawing multiple slightly faded copies of the current frame's image around the image.
- (BOOL)isHidden
Returns YES if the receiver is hidden when the animation is not running.
- (void)setAction:(SEL)aSelector
Sets the selector used for the action message to aSelector.
- (void)setBackgroundColor:(NSColor *)aColor
Sets the receiver's background color to aColor.
- (void)setDrawsBackground:(BOOL)flag
Controls whether the receiver draws its background. If flag is YES, the receiver fills its background with the background color; if flag is NO, it doesn't.
- (void)setFrameRate:(unsigned int)value
Sets the frame rate for the animation. Frames are changed value times per second whith 255 being the theoretical maximum. The default is 20.
- (void)setHidesOnLoad:(BOOL)flag
Controls whether the receiver automatically hides when the NIB file is loaded. This is used so that the receiver can be visible for editing in Interface Builder but hidden when loaded into the applicaton.
- (void)setIsHidden:(BOOL)flag
Controls whether the receiver is hidden when the animation is not running. The default is YES.
- (void)setTarget:(id)anObject
Sets the receiver's target object to anObject.
- (IBAction)startAnimation:(id)sender
Starts the animation by setting up a timer that sends step: methods in the specified frequency. Note that this means that the "lengty task" can't run in the main application thread as this would block the run loop.
- (IBAction)step:(id)sender
Advances the animation by one step. This method is normally called automatically by the animation timer.
- (IBAction)stopAnimation:(id)sender
Stops the animation. Multiple start: invocations do not need to be balanced by an equivalent amount of stop: invocations.
- (id)target
Returns the receiver's target object.