libs-gui/Documentation/gsdoc/NSSlider.html

290 lines
8.3 KiB
HTML
Raw Normal View History

<html>
<head>
<title>NSSlider</title>
</head>
<body>
<h1>NSSlider</h1>
<h3>Authors</h3>
<dl>
<dt>Ovidiu Predescu(<a href="mailto:ovidiu@net-community.com"><code>
ovidiu@net-community.com
</code></a>)</dt>
<dd>
</dd>
<dt>Felipe A. Rodriguez(<a href="mailto:far@ix.netcom.com"><code>
far@ix.netcom.com
</code></a>)</dt>
<dd>
</dd>
</dl>
<p>Copyright: (C) 1996 Free Software Foundation, Inc.</p>
<h1>Class Description</h1>
<p>
An NSSlider displays, and allows control of, some value in
the application. It represents a continuous stream of
values of type <code>float</code>, which can be
retrieved by the method <code>floatValue</code> and
set by the method <code>setFloatValue:</code>.
</p>
<p>
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 <code>NO</code> to the
<code>setContinuous:</code> message of a given NSSlider.
</p>
<p>
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.
</p>
<p>
As with many controls, NSSlider relies on its cell
counterpart, NSSliderCell. For more information,
please see the specification for NSSliderCell.
</p>
<p>
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.
</p>
<h2><a name="class$NSSlider">NSSlider</a> : <a href="NSControl.html#class$NSControl">NSControl</a></h2>
Declared: AppKit/NSSlider.h<br />
<p>
</p>
<h3>acceptsFirstMouse:</a></h3>
- (BOOL) <b>acceptsFirstMouse:</b> (<a href="NSEvent.html#class$NSEvent">NSEvent</a>*)theEvent;<br />
<p>
Returns <code>YES</code> 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.
</p>
<hr />
<h3>allowsTickMarkValuesOnly</a></h3>
- (BOOL) <b>allowsTickMarkValuesOnly</b>;<br />
<p>
</p>
<hr />
<h3>altIncrementValue</a></h3>
- (double) <b>altIncrementValue</b>;<br />
<p>
Returns the value by which the slider will be
incremented if the user holds down the ALT key.
</p>
<hr />
<h3>closestTickMarkValueToValue:</a></h3>
- (double) <b>closestTickMarkValueToValue:</b> (double)aValue;<br />
<p>
</p>
<hr />
<h3>image</a></h3>
- (<a href="NSImage.html#class$NSImage">NSImage</a>*) <b>image</b>;<br />
<p>
Returns the image drawn in the slider's track.
Returns <code>nil</code> if this has not been set.
</p>
<hr />
<h3>indexOfTickMarkAtPoint:</a></h3>
- (int) <b>indexOfTickMarkAtPoint:</b> (NSPoint)point;<br />
<p>
</p>
<hr />
<h3>isVertical</a></h3>
- (int) <b>isVertical</b>;<br />
<p>
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.
</p>
<hr />
<h3>knobThickness</a></h3>
- (float) <b>knobThickness</b>;<br />
<p>
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.
</p>
<hr />
<h3>maxValue</a></h3>
- (double) <b>maxValue</b>;<br />
<p>
Returns the maximum value that the slider
represents.
</p>
<hr />
<h3>minValue</a></h3>
- (double) <b>minValue</b>;<br />
<p>
Returns the minimum value that the slider
represents.
</p>
<hr />
<h3>numberOfTickMarks</a></h3>
- (int) <b>numberOfTickMarks</b>;<br />
<p>
</p>
<hr />
<h3>rectOfTickMarkAtIndex:</a></h3>
- (NSRect) <b>rectOfTickMarkAtIndex:</b> (int)index;<br />
<p>
</p>
<hr />
<h3>setAllowsTickMarkValuesOnly:</a></h3>
- (void) <b>setAllowsTickMarkValuesOnly:</b> (BOOL)flag;<br />
<p>
</p>
<hr />
<h3>setAltIncrementValue:</a></h3>
- (void) <b>setAltIncrementValue:</b> (double)increment;<br />
<p>
Sets the value by which the slider will be
incremented, when the ALT key is held down, to
<var>increment</var>.
</p>
<hr />
<h3>setImage:</a></h3>
- (void) <b>setImage:</b> (<a href="NSImage.html#class$NSImage">NSImage</a>*)backgroundImage;<br />
<p>
Sets the image to be displayed in the slider's track
to <var>barImage</var>.
</p>
<hr />
<h3>setKnobThickness:</a></h3>
- (void) <b>setKnobThickness:</b> (float)aFloat;<br />
<p>
Sets the thickness of the knob to <var>thickness</var>
, in pixels. This value sets the amount of space which
the knob takes up in the slider's track.
</p>
<hr />
<h3>setMaxValue:</a></h3>
- (void) <b>setMaxValue:</b> (double)aDouble;<br />
<p>
Sets the maximum value that the sliders represents to
<var>maxValue</var>.
</p>
<hr />
<h3>setMinValue:</a></h3>
- (void) <b>setMinValue:</b> (double)aDouble;<br />
<p>
Sets the minimum value that the slider represents to
<var>minValue</var>.
</p>
<hr />
<h3>setNumberOfTickMarks:</a></h3>
- (void) <b>setNumberOfTickMarks:</b> (int)numberOfTickMarks;<br />
<p>
</p>
<hr />
<h3>setTickMarkPosition:</a></h3>
- (void) <b>setTickMarkPosition:</b> (NSTickMarkPosition)position;<br />
<p>
</p>
<hr />
<h3>setTitle:</a></h3>
- (void) <b>setTitle:</b> (NSString*)aString;<br />
<p>
Sets the title of the slider to <var>barTitle</var>.
This title is displayed on the slider's track, behind
the knob.
</p>
<hr />
<h3>setTitleCell:</a></h3>
- (void) <b>setTitleCell:</b> (<a href="NSCell.html#class$NSCell">NSCell</a>*)aCell;<br />
<p>
Sets the cell used to draw the title to
<var>titleCell</var>.
</p>
<hr />
<h3>setTitleColor:</a></h3>
- (void) <b>setTitleColor:</b> (<a href="NSColor.html#class$NSColor">NSColor</a>*)aColor;<br />
<p>
Sets the colour with which the title will be drawn to
<var>color</var>.
</p>
<hr />
<h3>setTitleFont:</a></h3>
- (void) <b>setTitleFont:</b> (<a href="NSFont.html#class$NSFont">NSFont</a>*)fontObject;<br />
<p>
Sets the font with which the title will be drawm to
<var>font</var>.
</p>
<hr />
<h3>tickMarkPosition</a></h3>
- (NSTickMarkPosition) <b>tickMarkPosition</b>;<br />
<p>
</p>
<hr />
<h3>tickMarkValueAtIndex:</a></h3>
- (double) <b>tickMarkValueAtIndex:</b> (int)index;<br />
<p>
</p>
<hr />
<h3>title</a></h3>
- (NSString*) <b>title</b>;<br />
<p>
Returns the title of the slider as an
<code>NSString</code>.
</p>
<hr />
<h3>titleCell</a></h3>
- (id) <b>titleCell</b>;<br />
<p>
Returns the cell used to draw the title.
</p>
<hr />
<h3>titleColor</a></h3>
- (<a href="NSColor.html#class$NSColor">NSColor</a>*) <b>titleColor</b>;<br />
<p>
Returns the colour used to draw the title.
</p>
<hr />
<h3>titleFont</a></h3>
- (<a href="NSFont.html#class$NSFont">NSFont</a>*) <b>titleFont</b>;<br />
<p>
Returns the font used to draw the title.
</p>
<hr />
</body>
</html>