Inherits from | |
Conforms to | |
Framework | /System/Library/Frameworks/AppKit.framework |
Availability | Available in Mac OS X v10.4 and later. |
Declared in | NSLevelIndicator.h |
Related sample code |
NSLevelIndicator is a subclass of NSControl that displays a value on a linear scale. Level indicators provide a visual representation of a level or amount of something, using discrete values. While similar to NSSlider, it provides a more customized visual feedback to the user. Level indicators do not have a “knob” indicating the current setting or allowing the user to adjust settings. The supported indicator styles include:
A capacity style level indicator. The continuous mode for this style is often used to indicate conditions such as how much data is on hard disk. The discrete mode is similar to audio level indicators in audio playback applications. You can specify both a warning value and a critical value that provides additional visual feedback to the user.
A ranking style level indicator. This is similar to the star ranking displays provided in iTunes and iPhoto. You can also specify your own ranking image.
A relevancy style level indicator. This style is used to display the relevancy of a search result, for example in Mail.
NSLevelIndicator uses an NSLevelIndicatorCell to implement much of the control’s functionality. NSLevelIndicator provides cover methods for most of NSLevelIndicatorCell’s methods, which invoke the corresponding cell method.
– setMinValue:
– minValue
– setMaxValue:
– maxValue
– setWarningValue:
– warningValue
– setCriticalValue:
– criticalValue
– setTickMarkPosition:
– tickMarkPosition
– setNumberOfTickMarks:
– numberOfTickMarks
– setNumberOfMajorTickMarks:
– numberOfMajorTickMarks
– tickMarkValueAtIndex:
– rectOfTickMarkAtIndex:
Returns the receiver’s critical value.
- (double)criticalValue
NSLevelIndicator.h
Returns the receiver’s maximum value.
- (double)maxValue
NSLevelIndicator.h
Returns the receiver’s minimum value.
- (double)minValue
NSLevelIndicator.h
Returns the number of major tick marks associated with the receiver.
- (NSInteger)numberOfMajorTickMarks
NSLevelIndicator.h
Returns the number of tick marks associated with the receiver.
- (NSInteger)numberOfTickMarks
The tick marks assigned to the minimum and maximum values are included.
NSLevelIndicator.h
Returns the bounding rectangle of the tick mark identified by index (the minimum-value tick mark is at index 0).
- (NSRect)rectOfTickMarkAtIndex:(NSInteger)index
If no tick mark is associated with index, the method raises a NSRangeException
.
NSLevelIndicator.h
Sets the receiver’s critical value to criticalValue.
- (void)setCriticalValue:(double)criticalValue
NSLevelIndicator.h
Sets the maximum value the receiver can represent to maxValue.
- (void)setMaxValue:(double)maxValue
NSLevelIndicator.h
Sets the minimum value the receiver can represent to minValue.
- (void)setMinValue:(double)minValue
NSLevelIndicator.h
Sets the number of major tick marks displayed by the receiver.
- (void)setNumberOfMajorTickMarks:(NSInteger)count
The count must be less than or equal to the number of tick marks returned by numberOfTickMarks
. For example, if the number of tick marks is 11 and you specify 3 major tick marks, the resulting level indicator will display 3 major tickmarks alternating with 8 minor tick marks, as in the example shown in Figure 1.
NSLevelIndicator.h
Sets the number of tick marks displayed by the receiver (which include those assigned to the minimum and maximum values) to count.
- (void)setNumberOfTickMarks:(NSInteger)count
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.
NSLevelIndicator.h
Sets where tick marks appear relative to the receiver.
- (void)setTickMarkPosition:(NSTickMarkPosition)position
This method has no effect if no tick marks have been assigned (that is, numberOfTickMarks
returns 0).
NSLevelIndicator.h
Sets the receiver’s warning value to warningValue.
- (void)setWarningValue:(double)warningValue
NSLevelIndicator.h
Returns how the receiver’s tick marks are aligned with it.
- (NSTickMarkPosition)tickMarkPosition
The default alignments are NSTickMarkBelow
and NSTickMarkLeft
.
NSLevelIndicator.h
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
NSLevelIndicator.h
Returns the receiver’s warning value.
- (double)warningValue
NSLevelIndicator.h
© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-03-01)