Mac Developer Library

Developer

AppKit Framework Reference NSLevelIndicatorCell Class Reference

Options
Deployment Target:

On This Page
Language:

NSLevelIndicatorCell

Inheritance


Import Statement


Swift

import AppKit

Objective-C

@import AppKit;

Availability


Available in OS X v10.4 and later.

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.

  • Initializes the receiver with the style specified by levelIndicatorStyle.

    Declaration

    Swift

    init(levelIndicatorStyle levelIndicatorStyle: NSLevelIndicatorStyle)

    Objective-C

    - (instancetype)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.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • minValue minValue Property

    The minimum value of the control.

    Declaration

    Swift

    var minValue: Double

    Objective-C

    @property double minValue

    Discussion

    The default value of this property is 0.0.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • maxValue maxValue Property

    The maximum value of the control.

    Declaration

    Swift

    var maxValue: Double

    Objective-C

    @property double maxValue

    Discussion

    The maximum value is dependent on the style of the control. For continuous styles, the default value of this property is 100.0. For discrete styles, the default maximum value is 5.0.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • The style of the level indicator control.

    Declaration

    Swift

    var levelIndicatorStyle: NSLevelIndicatorStyle

    Objective-C

    @property NSLevelIndicatorStyle levelIndicatorStyle

    Discussion

    The style determines the default minimum and maximum values of the control. For a list of possible styles, see NSLevelIndicatorStyle.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • The warning value of the level indicator control.

    Declaration

    Swift

    var warningValue: Double

    Objective-C

    @property double warningValue

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • The critical value of the level indicator control.

    Declaration

    Swift

    var criticalValue: Double

    Objective-C

    @property double criticalValue

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • The placement of tick marks on the level indicator control.

    Declaration

    Swift

    var tickMarkPosition: NSTickMarkPosition

    Objective-C

    @property NSTickMarkPosition tickMarkPosition

    Discussion

    Use this property to set the position where the control draws tick marks. Regardless of the value in this property, tick marks are not drawn if the value in the numberOfTickMarks property is 0.

    The default value of this property is NSTickMarkBelow, which also corresponds to the value NSTickMarkLeft for vertically oriented level indicators.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • The number of tick marks displayed by the control.

    Declaration

    Swift

    var numberOfTickMarks: Int

    Objective-C

    @property NSInteger numberOfTickMarks

    Discussion

    The value in this property represents all of the tick marks displayed by the control, including those positioned at the minimum and maximum values. The default value of this property is 0, which results in no tick marks being displayed.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • The number of major tick marks displayed by the control.

    Declaration

    Swift

    var numberOfMajorTickMarks: Int

    Objective-C

    @property NSInteger numberOfMajorTickMarks

    Discussion

    The value in this property must be less than or equal to the value in the numberOfTickMarks property.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

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

    Declaration

    Swift

    func tickMarkValueAtIndex(_ index: Int) -> Double

    Objective-C

    - (double)tickMarkValueAtIndex:(NSInteger)index

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

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

    Declaration

    Swift

    func rectOfTickMarkAtIndex(_ index: Int) -> NSRect

    Objective-C

    - (NSRect)rectOfTickMarkAtIndex:(NSInteger)index

    Discussion

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

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

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

    Declaration

    Swift

    func setImage(_ image: NSImage?)

    Objective-C

    - (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.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Constants used to specify the control’s appearance.

    Declaration

    Swift

    enum NSLevelIndicatorStyle : UInt { case RelevancyLevelIndicatorStyle case ContinuousCapacityLevelIndicatorStyle case DiscreteCapacityLevelIndicatorStyle case RatingLevelIndicatorStyle }

    Objective-C

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

    Constants

    • RelevancyLevelIndicatorStyle

      NSRelevancyLevelIndicatorStyle

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

      Available in OS X v10.4 and later.

    • RatingLevelIndicatorStyle

      NSRatingLevelIndicatorStyle

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

      Available in OS X v10.4 and later.

    • DiscreteCapacityLevelIndicatorStyle

      NSDiscreteCapacityLevelIndicatorStyle

      A style similar to audio level indicators in iTunes.

      Available in OS X v10.4 and later.

    • ContinuousCapacityLevelIndicatorStyle

      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.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.