Up

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 in:
AppKit/NSSliderCell.h
Conforms to:
NSCoding
Availability: Not in OpenStep/MacOS-X

Description forthcoming.


Instance Variables

Method summary

prefersTrackingUntilMouseUp 

+ (BOOL) prefersTrackingUntilMouseUp;
Availability: Not in OpenStep/MacOS-X

The default implementation returns YES, so that the slider continues to track the user's movement even if the cursor leaves the slider's track.

Do not call this method directly. Override it in subclasses where the tracking behaviour needs to be different.


allowsTickMarkValuesOnly 

- (BOOL) allowsTickMarkValuesOnly;
Availability: Not in OpenStep/MacOS-X

Description forthcoming.


altIncrementValue 

- (double) altIncrementValue;
Availability: Not in OpenStep/MacOS-X

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


closestTickMarkValueToValue: 

- (double) closestTickMarkValueToValue: (double)aValue;
Availability: Not in OpenStep/MacOS-X

Description forthcoming.


drawBarInside: flipped: 

- (void) drawBarInside: (NSRect)rect flipped: (BOOL)flipped;
Availability: Not in OpenStep/MacOS-X

Draws the slider's track, not including the bezel, in aRect flipped indicates whether the control view has a flipped coordinate system.

Do not call this method directly, it is provided for subclassing only.


drawKnob 

- (void) drawKnob;
Availability: Not in OpenStep/MacOS-X

Calculates the rect in which to draw the knob, then calls drawKnob: Before calling this method, a lockFocus message must be sent to the cell's control view.

When subclassing NSSliderCell, do not override this method. Override drawKnob: instead.


drawKnob: 

- (void) drawKnob: (NSRect)knobRect;
Availability: Not in OpenStep/MacOS-X

Draws the knob in knobRect. Before calling this method, a lockFocus message must be sent to the cell's control view.

Do not call this method directly. It is included for subclassing only.


indexOfTickMarkAtPoint: 

- (int) indexOfTickMarkAtPoint: (NSPoint)point;
Availability: Not in OpenStep/MacOS-X

Description forthcoming.


isVertical 

- (int) isVertical;
Availability: Not in OpenStep/MacOS-X

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;
Availability: Not in OpenStep/MacOS-X

Returns the rect in which to draw the knob, based on the coordinate system of the NSSlider or NSMatrix this NSSliderCell is associated with. flipped indicates whether or not that coordinate system is flipped, which can be determined by sending the isFlipped message to the associated NSSlider or NSMatrix.

Do not call this method directly. It is included for subclassing only.


knobThickness 

- (float) knobThickness;
Availability: Not in OpenStep/MacOS-X

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;
Availability: Not in OpenStep/MacOS-X

Returns the maximum value that the slider represents.


minValue 

- (double) minValue;
Availability: Not in OpenStep/MacOS-X

Returns the minimum value that the slider represents.


numberOfTickMarks 

- (int) numberOfTickMarks;
Availability: Not in OpenStep/MacOS-X

Description forthcoming.


rectOfTickMarkAtIndex: 

- (NSRect) rectOfTickMarkAtIndex: (int)index;
Availability: Not in OpenStep/MacOS-X

Description forthcoming.


setAllowsTickMarkValuesOnly: 

- (void) setAllowsTickMarkValuesOnly: (BOOL)flag;
Availability: Not in OpenStep/MacOS-X

Description forthcoming.


setAltIncrementValue: 

- (void) setAltIncrementValue: (double)increment;
Availability: Not in OpenStep/MacOS-X

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


setKnobThickness: 

- (void) setKnobThickness: (float)thickness;
Availability: Not in OpenStep/MacOS-X

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;
Availability: Not in OpenStep/MacOS-X

Sets the maximum value that the sliders represents to maxValue.


setMinValue: 

- (void) setMinValue: (double)aDouble;
Availability: Not in OpenStep/MacOS-X

Sets the minimum value that the sliders represents to maxValue.


setNumberOfTickMarks: 

- (void) setNumberOfTickMarks: (int)numberOfTickMarks;
Availability: Not in OpenStep/MacOS-X

Description forthcoming.


setTickMarkPosition: 

- (void) setTickMarkPosition: (NSTickMarkPosition)position;
Availability: Not in OpenStep/MacOS-X

Description forthcoming.


setTitle: 

- (void) setTitle: (NSString*)title;
Availability: Not in OpenStep/MacOS-X

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;
Availability: Not in OpenStep/MacOS-X

Sets the cell used to draw the title to titleCell.


setTitleColor: 

- (void) setTitleColor: (NSColor*)color;
Availability: Not in OpenStep/MacOS-X

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


setTitleFont: 

- (void) setTitleFont: (NSFont*)font;
Availability: Not in OpenStep/MacOS-X

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


tickMarkPosition 

- (NSTickMarkPosition) tickMarkPosition;
Availability: Not in OpenStep/MacOS-X

Description forthcoming.


tickMarkValueAtIndex: 

- (double) tickMarkValueAtIndex: (int)index;
Availability: Not in OpenStep/MacOS-X

Description forthcoming.


title 

- (NSString*) title;
Availability: Not in OpenStep/MacOS-X

Description forthcoming.


titleCell 

- (id) titleCell;
Availability: Not in OpenStep/MacOS-X

Returns the cell used to draw the title.


titleColor 

- (NSColor*) titleColor;
Availability: Not in OpenStep/MacOS-X

Returns the colour used to draw the title.


titleFont 

- (NSFont*) titleFont;
Availability: Not in OpenStep/MacOS-X

Returns the font used to draw the title.


trackRect 

- (NSRect) trackRect;
Availability: Not in OpenStep/MacOS-X

Returns the rect of the track, minus the bezel.




Instance Variables for NSSliderCell Class

_allowsTickMarkValuesOnly

@protected BOOL _allowsTickMarkValuesOnly;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_altIncrementValue

@protected float _altIncrementValue;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_isVertical

@protected BOOL _isVertical;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_knobCell

@protected id _knobCell;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_maxValue

@protected float _maxValue;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_minValue

@protected float _minValue;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_numberOfTickMarks

@protected int _numberOfTickMarks;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_tickMarkPosition

@protected NSTickMarkPosition _tickMarkPosition;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_titleCell

@protected id _titleCell;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.


_trackRect

@protected NSRect _trackRect;

Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.






Up