NSSliderCell

Authors

Ovidiu Predescu( ovidiu@net-community.com )

Copyright: (C) 1996,1999 Free Software Foundation, Inc.

Class Description

An NSSliderCell controls the behaviour and appearance of an associated NSSlider, or a single slider in an NSMatrix. Tick marks are defined in the official standard, but are not implemented in GNUstep.

An NSSliderCell can be customized through its set... methods. If these do not provide enough customization, a subclass can be created, which overrides any of the follwing methods: knobRectFlipped:, drawBarInside:flipped:, drawKnob:, or prefersTrackingUntilMouseUp.

NSSliderCell : NSActionCell

Declared: AppKit/NSSliderCell.h
Conform: NSCoding

prefersTrackingUntilMouseUp

+ (BOOL) prefersTrackingUntilMouseUp;


allowsTickMarkValuesOnly

- (BOOL) allowsTickMarkValuesOnly;


altIncrementValue

- (double) altIncrementValue;

Returns the value by which the slider is incremented when the user holds down the ALT key.


closestTickMarkValueToValue:

- (double) closestTickMarkValueToValue: (double)aValue;


drawBarInside:flipped:

- (void) drawBarInside: (NSRect)rect flipped: (BOOL)flipped;


drawKnob

- (void) drawKnob;


drawKnob:

- (void) drawKnob: (NSRect)knobRect;


indexOfTickMarkAtPoint:

- (int) indexOfTickMarkAtPoint: (NSPoint)point;


isVertical

- (int) isVertical;

Returns whether or not the slider is vertical. If, for some reason, this cannot be determined, for such reasons as the slider is not yet displayed, this method returns -1. Generally, a slider is considered vertical if its height is greater than its width.


knobRectFlipped:

- (NSRect) knobRectFlipped: (BOOL)flipped;


knobThickness

- (float) knobThickness;

Returns the thickness of the slider's knob. This value is in pixels, and is the size of the knob along the slider's track.


maxValue

- (double) maxValue;

Returns the maximum value that the slider represents.


minValue

- (double) minValue;

Returns the minimum value that the slider represents.


numberOfTickMarks

- (int) numberOfTickMarks;


rectOfTickMarkAtIndex:

- (NSRect) rectOfTickMarkAtIndex: (int)index;


setAllowsTickMarkValuesOnly:

- (void) setAllowsTickMarkValuesOnly: (BOOL)flag;


setAltIncrementValue:

- (void) setAltIncrementValue: (double)increment;

Sets the value by which the slider will be be incremented when with the ALT key down to increment.


setKnobThickness:

- (void) setKnobThickness: (float)thickness;

Sets the thickness of the knob to thickness, in pixels. This value sets the amount of space which the knob takes up in the slider's track.


setMaxValue:

- (void) setMaxValue: (double)aDouble;

Sets the maximum value that the sliders represents to maxValue.


setMinValue:

- (void) setMinValue: (double)aDouble;

Sets the minimum value that the sliders represents to maxValue.


setNumberOfTickMarks:

- (void) setNumberOfTickMarks: (int)numberOfTickMarks;


setTickMarkPosition:

- (void) setTickMarkPosition: (NSTickMarkPosition)position;


setTitle:

- (void) setTitle: (NSString*)title;

Sets the title of the slider to barTitle. This title is displayed on the slider's track, behind the knob.


setTitleCell:

- (void) setTitleCell: (NSCell*)aCell;

Sets the cell used to draw the title to titleCell.


setTitleColor:

- (void) setTitleColor: (NSColor*)color;

Sets the colour with which the title will be drawn to color.


setTitleFont:

- (void) setTitleFont: (NSFont*)font;

Sets the font with which the title will be drawm to font.


tickMarkPosition

- (NSTickMarkPosition) tickMarkPosition;


tickMarkValueAtIndex:

- (double) tickMarkValueAtIndex: (int)index;


title

- (NSString*) title;


titleCell

- (id) titleCell;

Returns the cell used to draw the title.


titleColor

- (NSColor*) titleColor;

Returns the colour used to draw the title.


titleFont

- (NSFont*) titleFont;

Returns the font used to draw the title.


trackRect

- (NSRect) trackRect;

Returns the rect of the track, minus the bezel.