NSLevelIndicatorCell Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AppKit.framework
Availability
Available in OS X v10.4 and later.
Declared in
NSLevelIndicatorCell.h

Overview

NSLevelIndicatorCell is a subclass of NSActionCell that provides several level indicator display styles including: capacity, ranking and relevancy. The capacity style provides both continuous and discrete modes.

Tasks

Initializing NSLevelIndicatorCell Objects

Configuring the Range of Values

Managing Tick Marks

Setting the Level-Indicator Image

Instance Methods

criticalValue

Returns the receiver’s critical value.

- (double)criticalValue
Availability
  • Available in OS X v10.4 and later.
Declared In
NSLevelIndicatorCell.h

initWithLevelIndicatorStyle:

Initializes the receiver with the style specified by levelIndicatorStyle.

- (id)initWithLevelIndicatorStyle:(NSLevelIndicatorStyle)levelIndicatorStyle
Discussion

The default value and minimum value are 0.0. The default maximum value is dependent on levelIndicatorStyle. For continuous styles, the default maximum value is 100.0. For discrete styles the default maximum value is 5.0.

Availability
  • Available in OS X v10.4 and later.
Declared In
NSLevelIndicatorCell.h

levelIndicatorStyle

Returns the level indicator style of the receiver.

- (NSLevelIndicatorStyle)levelIndicatorStyle
Discussion

Possible return values are described in “Constants.”

Availability
  • Available in OS X v10.4 and later.
Declared In
NSLevelIndicatorCell.h

maxValue

Returns the receiver’s maximum value.

- (double)maxValue
Availability
  • Available in OS X v10.4 and later.
Declared In
NSLevelIndicatorCell.h

minValue

Returns the receiver’s minimum value.

- (double)minValue
Availability
  • Available in OS X v10.4 and later.
Declared In
NSLevelIndicatorCell.h

numberOfMajorTickMarks

Returns the number of major tick marks associated with the receiver.

- (NSInteger)numberOfMajorTickMarks
Availability
  • Available in OS X v10.4 and later.
Declared In
NSLevelIndicatorCell.h

numberOfTickMarks

Returns the number of tick marks associated with the receiver.

- (NSInteger)numberOfTickMarks
Discussion

The tick marks assigned to the minimum and maximum values are included.

Availability
  • Available in OS X v10.4 and later.
Declared In
NSLevelIndicatorCell.h

rectOfTickMarkAtIndex:

Returns the bounding rectangle of the tick mark identified by index (the minimum-value tick mark is at index 0).

- (NSRect)rectOfTickMarkAtIndex:(NSInteger)index
Discussion

If no tick mark is associated with index, the method raises a NSRangeException.

Availability
  • Available in OS X v10.4 and later.
Declared In
NSLevelIndicatorCell.h

setCriticalValue:

Sets the receiver’s critical value to criticalValue.

- (void)setCriticalValue:(double)criticalValue
Availability
  • Available in OS X v10.4 and later.
Declared In
NSLevelIndicatorCell.h

setImage:

Sets the image displayed by the receiver for the NSRatingLevelIndicatorStyle to image.

- (void)setImage:(NSImage *)image
Discussion

The image is lightened to indicate a highlighted selection and dots are drawn for empty spots. The image is not stretched and no space is added between images. Setting image to nil causes the default star image to be used.

Availability
  • Available in OS X v10.4 and later.
Declared In
NSLevelIndicatorCell.h

setLevelIndicatorStyle:

Sets the style of the receiver to levelIndicatorStyle.

- (void)setLevelIndicatorStyle:(NSLevelIndicatorStyle)levelIndicatorStyle
Discussion

The available values of levelIndicatorStyle are described in “Constants.”

Availability
  • Available in OS X v10.4 and later.
Related Sample Code
Declared In
NSLevelIndicatorCell.h

setMaxValue:

Sets the maximum value the receiver can represent to maxValue.

- (void)setMaxValue:(double)maxValue
Availability
  • Available in OS X v10.4 and later.
Declared In
NSLevelIndicatorCell.h

setMinValue:

Sets the minimum value the receiver can represent to minValue.

- (void)setMinValue:(double)minValue
Availability
  • Available in OS X v10.4 and later.
See Also
Declared In
NSLevelIndicatorCell.h

setNumberOfMajorTickMarks:

Sets the number of major tick marks displayed by the receiver.

- (void)setNumberOfMajorTickMarks:(NSInteger)count
Discussion

The count must be less than or equal to the number of tick marks.

Availability
  • Available in OS X v10.4 and later.
Declared In
NSLevelIndicatorCell.h

setNumberOfTickMarks:

Sets the number of tick marks displayed by the receiver (which include those assigned to the minimum and maximum values) to numberOfTickMarks.

- (void)setNumberOfTickMarks:(NSInteger)count
Discussion

By default, this value is 0, and no tick marks appear. The number of tick marks assigned to a slider, along with the slider’s minimum and maximum values, determines the values associated with the tick marks.

Availability
  • Available in OS X v10.4 and later.
Declared In
NSLevelIndicatorCell.h

setTickMarkPosition:

Sets where tick marks appear relative to the receiver.

- (void)setTickMarkPosition:(NSTickMarkPosition)position
Discussion

This method has no effect if no tick marks have been assigned (that is, numberOfTickMarks returns 0).

Availability
  • Available in OS X v10.4 and later.
Declared In
NSLevelIndicatorCell.h

setWarningValue:

Sets the receiver’s warning value to warningValue.

- (void)setWarningValue:(double)warningValue
Availability
  • Available in OS X v10.4 and later.
Declared In
NSLevelIndicatorCell.h

tickMarkPosition

Returns how the receiver’s tick marks are aligned with it.

- (NSTickMarkPosition)tickMarkPosition
Discussion

The default alignments are NSTickMarkBelow and NSTickMarkLeft.

Availability
  • Available in OS X v10.4 and later.
Declared In
NSLevelIndicatorCell.h

tickMarkValueAtIndex:

Returns the receiver’s value represented by the tick mark at index (the minimum-value tick mark has an index of 0).

- (double)tickMarkValueAtIndex:(NSInteger)index
Availability
  • Available in OS X v10.4 and later.
Declared In
NSLevelIndicatorCell.h

warningValue

Returns the receiver’s warning value.

- (double)warningValue
Availability
  • Available in OS X v10.4 and later.
Declared In
NSLevelIndicatorCell.h

Constants

NSLevelIndicatorStyle

The following constants specify the level indicator’s style and are used by initWithLevelIndicatorStyle:, levelIndicatorStyle, and setLevelIndicatorStyle:.

enum {
   NSRelevancyLevelIndicatorStyle,
   NSContinuousCapacityLevelIndicatorStyle,
   NSDiscreteCapacityLevelIndicatorStyle,
   NSRatingLevelIndicatorStyle
};
typedef NSUInteger NSLevelIndicatorStyle;
Constants
NSRelevancyLevelIndicatorStyle

A style similar to the rank column displayed when searching in Mail.app.

Available in OS X v10.4 and later.

Declared in NSLevelIndicatorCell.h.

NSRatingLevelIndicatorStyle

A style similar to the star ranking displays provided in iTunes and iPhoto.

Available in OS X v10.4 and later.

Declared in NSLevelIndicatorCell.h.

NSDiscreteCapacityLevelIndicatorStyle

A style similar to audio level indicators in iTunes.

Available in OS X v10.4 and later.

Declared in NSLevelIndicatorCell.h.

NSContinuousCapacityLevelIndicatorStyle

A style that is often used to indicate conditions such as how much data is on a hard disk.

Available in OS X v10.4 and later.

Declared in NSLevelIndicatorCell.h.