2000-02-28 16:33:27 +00:00
|
|
|
<?xml version="1.0"?>
|
2001-12-17 16:51:51 +00:00
|
|
|
<!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 0.6.7//EN" "http://www.gnustep.org/gsdoc-0_6_7.xml">
|
|
|
|
<gsdoc base="NSSlider" next="NSSliderCell" prev="NSPrintOperation" up="NSDocumentController">
|
2000-02-28 16:33:27 +00:00
|
|
|
<head>
|
|
|
|
<title>NSSlider</title>
|
2001-12-17 16:51:51 +00:00
|
|
|
<author name="Ovidiu Predescu">
|
|
|
|
<email address="ovidiu@net-community.com">
|
|
|
|
ovidiu@net-community.com
|
|
|
|
</email>
|
2000-02-28 16:33:27 +00:00
|
|
|
</author>
|
2001-12-17 16:51:51 +00:00
|
|
|
<author name="Felipe A. Rodriguez">
|
|
|
|
<email address="far@ix.netcom.com">
|
|
|
|
far@ix.netcom.com
|
|
|
|
</email>
|
2000-03-14 04:06:23 +00:00
|
|
|
</author>
|
2001-12-17 16:51:51 +00:00
|
|
|
<copy>1996 Free Software Foundation, Inc.</copy>
|
2000-02-28 16:33:27 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<chapter>
|
2001-12-17 16:51:51 +00:00
|
|
|
<heading>Class Description</heading>
|
|
|
|
<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>
|
2000-02-28 16:33:27 +00:00
|
|
|
<class name="NSSlider" super="NSControl">
|
2001-12-17 16:51:51 +00:00
|
|
|
<declared>AppKit/NSSlider.h</declared>
|
|
|
|
<desc>
|
|
|
|
</desc>
|
2000-02-29 11:01:41 +00:00
|
|
|
<method type="BOOL">
|
|
|
|
<sel>acceptsFirstMouse:</sel>
|
2001-12-17 16:51:51 +00:00
|
|
|
<arg type="NSEvent*">theEvent</arg>
|
2000-02-29 11:01:41 +00:00
|
|
|
<desc>
|
2001-12-17 16:51:51 +00:00
|
|
|
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.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="BOOL">
|
|
|
|
<sel>allowsTickMarkValuesOnly</sel>
|
|
|
|
<desc>
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="double">
|
|
|
|
<sel>altIncrementValue</sel>
|
|
|
|
<desc>
|
2001-12-17 16:51:51 +00:00
|
|
|
Returns the value by which the slider will be
|
|
|
|
incremented if the user holds down the ALT key.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="double">
|
|
|
|
<sel>closestTickMarkValueToValue:</sel>
|
|
|
|
<arg type="double">aValue</arg>
|
|
|
|
<desc>
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="NSImage*">
|
|
|
|
<sel>image</sel>
|
|
|
|
<desc>
|
2001-12-17 16:51:51 +00:00
|
|
|
Returns the image drawn in the slider's track.
|
|
|
|
Returns <code>nil</code> if this has not been set.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="int">
|
|
|
|
<sel>indexOfTickMarkAtPoint:</sel>
|
|
|
|
<arg type="NSPoint">point</arg>
|
|
|
|
<desc>
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="int">
|
|
|
|
<sel>isVertical</sel>
|
|
|
|
<desc>
|
2001-12-17 16:51:51 +00:00
|
|
|
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.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="float">
|
|
|
|
<sel>knobThickness</sel>
|
|
|
|
<desc>
|
2001-12-17 16:51:51 +00:00
|
|
|
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.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="double">
|
|
|
|
<sel>maxValue</sel>
|
|
|
|
<desc>
|
2001-12-17 16:51:51 +00:00
|
|
|
Returns the maximum value that the slider
|
|
|
|
represents.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="double">
|
|
|
|
<sel>minValue</sel>
|
|
|
|
<desc>
|
2001-12-17 16:51:51 +00:00
|
|
|
Returns the minimum value that the slider
|
|
|
|
represents.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="int">
|
|
|
|
<sel>numberOfTickMarks</sel>
|
|
|
|
<desc>
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="NSRect">
|
|
|
|
<sel>rectOfTickMarkAtIndex:</sel>
|
|
|
|
<arg type="int">index</arg>
|
|
|
|
<desc>
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="void">
|
|
|
|
<sel>setAllowsTickMarkValuesOnly:</sel>
|
|
|
|
<arg type="BOOL">flag</arg>
|
|
|
|
<desc>
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="void">
|
|
|
|
<sel>setAltIncrementValue:</sel>
|
|
|
|
<arg type="double">increment</arg>
|
|
|
|
<desc>
|
2001-12-17 16:51:51 +00:00
|
|
|
Sets the value by which the slider will be
|
|
|
|
incremented, when the ALT key is held down, to
|
|
|
|
<var>increment</var>.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="void">
|
|
|
|
<sel>setImage:</sel>
|
2001-12-17 16:51:51 +00:00
|
|
|
<arg type="NSImage*">backgroundImage</arg>
|
2000-02-29 11:01:41 +00:00
|
|
|
<desc>
|
2001-12-17 16:51:51 +00:00
|
|
|
Sets the image to be displayed in the slider's track
|
|
|
|
to <var>barImage</var>.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="void">
|
|
|
|
<sel>setKnobThickness:</sel>
|
2001-12-17 16:51:51 +00:00
|
|
|
<arg type="float">aFloat</arg>
|
2000-02-29 11:01:41 +00:00
|
|
|
<desc>
|
2001-12-17 16:51:51 +00:00
|
|
|
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.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="void">
|
|
|
|
<sel>setMaxValue:</sel>
|
2001-12-17 16:51:51 +00:00
|
|
|
<arg type="double">aDouble</arg>
|
2000-02-29 11:01:41 +00:00
|
|
|
<desc>
|
2001-12-17 16:51:51 +00:00
|
|
|
Sets the maximum value that the sliders represents to
|
|
|
|
<var>maxValue</var>.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="void">
|
|
|
|
<sel>setMinValue:</sel>
|
2001-12-17 16:51:51 +00:00
|
|
|
<arg type="double">aDouble</arg>
|
2000-02-29 11:01:41 +00:00
|
|
|
<desc>
|
2001-12-17 16:51:51 +00:00
|
|
|
Sets the minimum value that the slider represents to
|
|
|
|
<var>minValue</var>.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="void">
|
|
|
|
<sel>setNumberOfTickMarks:</sel>
|
|
|
|
<arg type="int">numberOfTickMarks</arg>
|
|
|
|
<desc>
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="void">
|
|
|
|
<sel>setTickMarkPosition:</sel>
|
|
|
|
<arg type="NSTickMarkPosition">position</arg>
|
|
|
|
<desc>
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="void">
|
|
|
|
<sel>setTitle:</sel>
|
2001-12-17 16:51:51 +00:00
|
|
|
<arg type="NSString*">aString</arg>
|
2000-02-29 11:01:41 +00:00
|
|
|
<desc>
|
2001-12-17 16:51:51 +00:00
|
|
|
Sets the title of the slider to <var>barTitle</var>.
|
|
|
|
This title is displayed on the slider's track, behind
|
|
|
|
the knob.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="void">
|
|
|
|
<sel>setTitleCell:</sel>
|
2001-12-17 16:51:51 +00:00
|
|
|
<arg type="NSCell*">aCell</arg>
|
2000-02-29 11:01:41 +00:00
|
|
|
<desc>
|
2001-12-17 16:51:51 +00:00
|
|
|
Sets the cell used to draw the title to
|
|
|
|
<var>titleCell</var>.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="void">
|
|
|
|
<sel>setTitleColor:</sel>
|
2001-12-17 16:51:51 +00:00
|
|
|
<arg type="NSColor*">aColor</arg>
|
2000-02-29 11:01:41 +00:00
|
|
|
<desc>
|
2001-12-17 16:51:51 +00:00
|
|
|
Sets the colour with which the title will be drawn to
|
|
|
|
<var>color</var>.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="void">
|
|
|
|
<sel>setTitleFont:</sel>
|
2001-12-17 16:51:51 +00:00
|
|
|
<arg type="NSFont*">fontObject</arg>
|
2000-02-29 11:01:41 +00:00
|
|
|
<desc>
|
2001-12-17 16:51:51 +00:00
|
|
|
Sets the font with which the title will be drawm to
|
|
|
|
<var>font</var>.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="NSTickMarkPosition">
|
|
|
|
<sel>tickMarkPosition</sel>
|
|
|
|
<desc>
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="double">
|
|
|
|
<sel>tickMarkValueAtIndex:</sel>
|
|
|
|
<arg type="int">index</arg>
|
|
|
|
<desc>
|
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="NSString*">
|
|
|
|
<sel>title</sel>
|
|
|
|
<desc>
|
2001-12-17 16:51:51 +00:00
|
|
|
Returns the title of the slider as an
|
|
|
|
<code>NSString</code>.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="id">
|
|
|
|
<sel>titleCell</sel>
|
|
|
|
<desc>
|
2001-12-17 16:51:51 +00:00
|
|
|
Returns the cell used to draw the title.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="NSColor*">
|
|
|
|
<sel>titleColor</sel>
|
|
|
|
<desc>
|
2001-12-17 16:51:51 +00:00
|
|
|
Returns the colour used to draw the title.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
|
|
|
</method>
|
|
|
|
<method type="NSFont*">
|
|
|
|
<sel>titleFont</sel>
|
|
|
|
<desc>
|
2001-12-17 16:51:51 +00:00
|
|
|
Returns the font used to draw the title.
|
2000-02-29 11:01:41 +00:00
|
|
|
</desc>
|
2000-02-28 18:37:00 +00:00
|
|
|
</method>
|
2000-02-28 16:33:27 +00:00
|
|
|
</class>
|
|
|
|
</chapter>
|
|
|
|
</body>
|
|
|
|
</gsdoc>
|