Class

NSSliderCell

The appearance and behavior of an NSSlider object.

Declaration

@interface NSSliderCell : NSActionCell

Overview

You can customize an NSSliderCell to a certain degree, using its properties. If this doesn’t give you sufficient flexibility, you can create a subclass. In that subclass, you can override any of the following methods: knobRectFlipped:, drawBarInside:flipped:, drawKnob:, and prefersTrackingUntilMouseUp.

Topics

Managing Cell Behavior

altIncrementValue

The amount by which the slider changes its value when the user Option-drags the knob.

prefersTrackingUntilMouseUp

Returns a Boolean value indicating whether the NSSliderCell continues to track the pointer until the next mouse up.

trackRect

The rectangle within which the cell tracks the pointer while the mouse button is down.

Managing the Slider Type

sliderType

The slider type, either linear or circular.

Displaying the Cell

- barRectFlipped:

Returns the rectangle in which the bar is drawn.

- drawTickMarks

Draws the slider’s tick marks.

- knobRectFlipped:

Returns the rectangle in which the slider knob is drawn.

- drawBarInside:flipped:

Draws the slider’s bar—but not its bezel or knob—inside the specified rectangle.

- drawKnob

Calculates the rectangle in which the knob should be drawn, then calls drawKnob: to actually draw the knob.

- drawKnob:

Draws the slider knob in the given rectangle.

Managing Cell Appearance

knobThickness

The thickness of the slider knob, in pixels.

vertical

An integer indicating the orientation (vertical or horizontal) of the slider.

- title

Returns the slider’s title.

Deprecated
- setTitle:

Sets the title in the bar behind the slider’s knob.

Deprecated
- titleCell

Returns nil.

Deprecated
- setTitleCell:

Sets the cell used to draw the slider’s title.

Deprecated
- titleFont

Returns nil.

Deprecated
- titleColor

Returns nil.

Deprecated
- setTitleFont:

Sets the font used to draw the slider’s title.

Deprecated
- setTitleColor:

Sets the color used to draw the slider’s title.

Deprecated

Managing Value Limits

maxValue

The maximum value the slider can send to its target.

minValue

The minimum value the slider can send to its target.

Managing Tick Marks

allowsTickMarkValuesOnly

A Boolean value indicating whether the receiver fixes its values to those values represented by its tick marks.

- closestTickMarkValueToValue:

Returns the value of the tick mark closest to the specified value.

- indexOfTickMarkAtPoint:

Returns the index of the tick mark closest to the location of the slider represented by the specified point.

numberOfTickMarks

The number of tick marks associated with the slider, including the tick marks assigned to the minimum and maximum values.

- rectOfTickMarkAtIndex:

Returns the bounding rectangle of the tick mark at the specified index.

tickMarkPosition

The position of the tick marks relative to the receiver.

- tickMarkValueAtIndex:

Returns the receiver’s value represented by the tick mark at the specified index.

Constants

NSTickMarkPosition

Specifies where the tick marks of an NSSliderCell object appear.

NSSliderType

The types of sliders, used by sliderType.

Instance Methods

- imageDeprecated
- setImage:Deprecated
- setKnobThickness:

The thickness of the slider knob, in pixels.

Deprecated

Relationships

Inherits From