Up

NSSlider

Authors

Ovidiu Predescu( ovidiu@net-community.com )
Felipe A. Rodriguez( far@ix.netcom.com )

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


Contents -

  1. Class Description

Class Description

An NSSlider displays, and allows control of, some value in the application. It represents a continuous stream of values of type float, which can be retrieved by the method floatValue and set by the method setFloatValue:.

This control is a continuous control. It sends its action message as long as the user is manipulating it. This can be changed by passing NO to the setContinuous: message of a given NSSlider.

Although methods for adding and managing a title are provided, the slider's knob can cover this title, so it is recommended that a label be added near the slider, for identification.

As with many controls, NSSlider relies on its cell counterpart, NSSliderCell. For more information, please see the specification for NSSliderCell.

Use of an NSSlider to do the role of an NSScroller is not recommended. A scroller is intended to represent the visible portion of a view, whereas a slider is intended to represent some value.

NSSlider : NSControl

Declared in:
AppKit/NSSlider.h
Standards:

Method summary

acceptsFirstMouse:

- (BOOL) acceptsFirstMouse: (NSEvent*)theEvent;
Standards: GNUstep, MacOS-X, OpenStep

Returns YES by default. This will allow the first click sent to the slider, when in an inactive window, to both bring the window into focus and manipulate the slider.


allowsTickMarkValuesOnly

- (BOOL) allowsTickMarkValuesOnly;
Standards: NotOpenStep, GNUstep, MacOS-X

Description forthcoming.


altIncrementValue

- (double) altIncrementValue;
Standards: GNUstep, MacOS-X, OpenStep

Returns the value by which the slider will be incremented if the user holds down the ALT key.


closestTickMarkValueToValue:

- (double) closestTickMarkValueToValue: (double)aValue;
Standards: NotOpenStep, GNUstep, MacOS-X

Description forthcoming.


image

- (NSImage*) image;
Standards: GNUstep, MacOS-X, OpenStep

Returns the image drawn in the slider's track. Returns nil if this has not been set.


indexOfTickMarkAtPoint:

- (int) indexOfTickMarkAtPoint: (NSPoint)point;
Standards: NotOpenStep, GNUstep, MacOS-X

Description forthcoming.


isVertical

- (int) isVertical;
Standards: GNUstep, MacOS-X, OpenStep

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.


knobThickness

- (float) knobThickness;
Standards: GNUstep, MacOS-X, OpenStep

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;
Standards: GNUstep, MacOS-X, OpenStep

Returns the maximum value that the slider represents.


minValue

- (double) minValue;
Standards: GNUstep, MacOS-X, OpenStep

Returns the minimum value that the slider represents.


numberOfTickMarks

- (int) numberOfTickMarks;
Standards: NotOpenStep, GNUstep, MacOS-X

Description forthcoming.


rectOfTickMarkAtIndex:

- (NSRect) rectOfTickMarkAtIndex: (int)index;
Standards: NotOpenStep, GNUstep, MacOS-X

Description forthcoming.


setAllowsTickMarkValuesOnly:

- (void) setAllowsTickMarkValuesOnly: (BOOL)flag;
Standards: NotOpenStep, GNUstep, MacOS-X

Description forthcoming.


setAltIncrementValue:

- (void) setAltIncrementValue: (double)increment;
Standards: GNUstep, MacOS-X, OpenStep

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


setImage:

- (void) setImage: (NSImage*)backgroundImage;
Standards: GNUstep, MacOS-X, OpenStep

Sets the image to be displayed in the slider's track to barImage.


setKnobThickness:

- (void) setKnobThickness: (float)aFloat;
Standards: GNUstep, MacOS-X, OpenStep

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;
Standards: GNUstep, MacOS-X, OpenStep

Sets the maximum value that the sliders represents to maxValue.


setMinValue:

- (void) setMinValue: (double)aDouble;
Standards: GNUstep, MacOS-X, OpenStep

Sets the minimum value that the slider represents to minValue.


setNumberOfTickMarks:

- (void) setNumberOfTickMarks: (int)numberOfTickMarks;
Standards: NotOpenStep, GNUstep, MacOS-X

Description forthcoming.


setTickMarkPosition:

- (void) setTickMarkPosition: (NSTickMarkPosition)position;
Standards: NotOpenStep, GNUstep, MacOS-X

Description forthcoming.


setTitle:

- (void) setTitle: (NSString*)aString;
Standards: GNUstep, MacOS-X, OpenStep

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;
Standards: GNUstep, MacOS-X, OpenStep

Sets the cell used to draw the title to titleCell.


setTitleColor:

- (void) setTitleColor: (NSColor*)aColor;
Standards: GNUstep, MacOS-X, OpenStep

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


setTitleFont:

- (void) setTitleFont: (NSFont*)fontObject;
Standards: GNUstep, MacOS-X, OpenStep

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


tickMarkPosition

- (NSTickMarkPosition) tickMarkPosition;
Standards: NotOpenStep, GNUstep, MacOS-X

Description forthcoming.


tickMarkValueAtIndex:

- (double) tickMarkValueAtIndex: (int)index;
Standards: NotOpenStep, GNUstep, MacOS-X

Description forthcoming.


title

- (NSString*) title;
Standards: GNUstep, MacOS-X, OpenStep

Returns the title of the slider as an NSString.


titleCell

- (id) titleCell;
Standards: GNUstep, MacOS-X, OpenStep

Returns the cell used to draw the title.


titleColor

- (NSColor*) titleColor;
Standards: GNUstep, MacOS-X, OpenStep

Returns the colour used to draw the title.


titleFont

- (NSFont*) titleFont;
Standards: GNUstep, MacOS-X, OpenStep

Returns the font used to draw the title.



Up