Mac Developer Library

Developer

AppKit Framework Reference NSLevelIndicatorCell Class Reference

Options
Deployment Target:

On This Page
Language:

NSLevelIndicatorCell

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.

Inheritance


Import Statement


import AppKit @import AppKit;

Availability


Available in OS X v10.4 and later.
  • 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

    import AppKit

    Availability

    Available in OS X v10.4 and later.

  • Sets where tick marks appear relative to the receiver.

    Declaration

    Swift

    var tickMarkPosition: NSTickMarkPosition

    Objective-C

    @property NSTickMarkPosition tickMarkPosition

    Discussion

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

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

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

    Declaration

    Swift

    var tickMarkPosition: NSTickMarkPosition

    Objective-C

    @property NSTickMarkPosition tickMarkPosition

    Discussion

    The default alignments are NSTickMarkBelow and NSTickMarkLeft.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

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

    Declaration

    Swift

    var numberOfTickMarks: Int

    Objective-C

    @property NSInteger numberOfTickMarks

    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.

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

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

    Declaration

    Swift

    var numberOfTickMarks: Int

    Objective-C

    @property NSInteger numberOfTickMarks

    Discussion

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

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

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

    Declaration

    Swift

    var numberOfMajorTickMarks: Int

    Objective-C

    @property NSInteger numberOfMajorTickMarks

    Discussion

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

    Import Statement

    import AppKit

    Availability

    Available in OS X v10.4 and later.

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

    Declaration

    Swift

    var numberOfMajorTickMarks: Int

    Objective-C

    @property NSInteger numberOfMajorTickMarks

    Import Statement

    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

    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

    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

    import AppKit

    Availability

    Available in OS X v10.4 and later.

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

    Declaration

    Swift

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

    Objective-C

    enum { NSRelevancyLevelIndicatorStyle, NSContinuousCapacityLevelIndicatorStyle, NSDiscreteCapacityLevelIndicatorStyle, NSRatingLevelIndicatorStyle }; typedef NSUInteger 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

    import AppKit

    Availability

    Available in OS X v10.4 and later.