mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 13:40:54 +00:00
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6444 72102866-910b-0410-8b05-ffd578937521
386 lines
12 KiB
HTML
386 lines
12 KiB
HTML
<html><head>
|
|
<title>NSSliderCell</title>
|
|
</head>
|
|
<body>
|
|
<a href="NSSlider.html">[Previous]</a>
|
|
<a href="Gui.html">[Up]</a>
|
|
<a href="NSSpellChecker.html">[Next]</a>
|
|
<h1>NSSliderCell</h1>
|
|
<h3>Authors</h3>
|
|
<dl>
|
|
<dt><a href="http://www.gnustep.org/developers/whoiswho.html">Richard Frith-Macdonald</a>
|
|
<dd>
|
|
<dt>James Dessart
|
|
<dd>
|
|
</dl>
|
|
<p>Version: 0.2</p>
|
|
<p>Date: 11 March, 2000</p>
|
|
<h2><a name="cont-0">NSSliderCell</a></h2>
|
|
<h2><a name="NSSliderCell">NSSliderCell</a></h2>
|
|
<p><b>Declared in:</b> Gui/NSSliderCell.h</p>
|
|
<p><b>Inherits from:</b> NSActionCell</p>
|
|
<p><b>Conforms to:</b> NSCoding
|
|
</p>
|
|
<hr>
|
|
|
|
<p>
|
|
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.</p>
|
|
|
|
|
|
<p>
|
|
An NSSliderCell can be customized through its <code>set...</code> methods.
|
|
If these do not provide enough customization, a subclass can be created, which
|
|
overrides any of the follwing methods: <code>knobRectFlipped:</code>,
|
|
<code>drawBarInside:flipped:</code>, <code>drawKnob:</code>,
|
|
or <code>prefersTrackingUntilMouseUp</code>.</p>
|
|
|
|
|
|
<ul>
|
|
<li><a href="NSSliderCell.html#method-0">+prefersTrackingUntilMouseUp</a>
|
|
<li><a href="NSSliderCell.html#method-1">-allowsTickMarkValuesOnly</a>
|
|
<li><a href="NSSliderCell.html#method-2">-altIncrementValue</a>
|
|
<li><a href="NSSliderCell.html#method-3">-closestTickMarkValueToValue:</a>
|
|
<li><a href="NSSliderCell.html#method-4">-drawBarInside:flipped:</a>
|
|
<li><a href="NSSliderCell.html#method-5">-drawKnob</a>
|
|
<li><a href="NSSliderCell.html#method-6">-drawKnob:</a>
|
|
<li><a href="NSSliderCell.html#method-7">-indexOfTickMarkAtPoint:</a>
|
|
<li><a href="NSSliderCell.html#method-8">-isVertical</a>
|
|
<li><a href="NSSliderCell.html#method-9">-knobRectFlipped:</a>
|
|
<li><a href="NSSliderCell.html#method-10">-knobThickness</a>
|
|
<li><a href="NSSliderCell.html#method-11">-maxValue</a>
|
|
<li><a href="NSSliderCell.html#method-12">-minValue</a>
|
|
<li><a href="NSSliderCell.html#method-13">-numberOfTickMarks</a>
|
|
<li><a href="NSSliderCell.html#method-14">-rectOfTickMarkAtIndex:</a>
|
|
<li><a href="NSSliderCell.html#method-15">-setAllowsTickMarkValuesOnly:</a>
|
|
<li><a href="NSSliderCell.html#method-16">-setAltIncrementValue:</a>
|
|
<li><a href="NSSliderCell.html#method-17">-setKnobThickness:</a>
|
|
<li><a href="NSSliderCell.html#method-18">-setMaxValue:</a>
|
|
<li><a href="NSSliderCell.html#method-19">-setMinValue:</a>
|
|
<li><a href="NSSliderCell.html#method-20">-setNumberOfTickMarks:</a>
|
|
<li><a href="NSSliderCell.html#method-21">-setTickMarkPosition:</a>
|
|
<li><a href="NSSliderCell.html#method-22">-setTitle:</a>
|
|
<li><a href="NSSliderCell.html#method-23">-setTitleCell:</a>
|
|
<li><a href="NSSliderCell.html#method-24">-setTitleColor:</a>
|
|
<li><a href="NSSliderCell.html#method-25">-setTitleFont:</a>
|
|
<li><a href="NSSliderCell.html#method-26">-tickMarkPosition</a>
|
|
<li><a href="NSSliderCell.html#method-27">-tickMarkValueAtIndex:</a>
|
|
<li><a href="NSSliderCell.html#method-28">-title</a>
|
|
<li><a href="NSSliderCell.html#method-29">-titleCell</a>
|
|
<li><a href="NSSliderCell.html#method-30">-titleColor</a>
|
|
<li><a href="NSSliderCell.html#method-31">-titleFont</a>
|
|
<li><a href="NSSliderCell.html#method-32">-trackRect</a>
|
|
</ul>
|
|
<hr>
|
|
<h2><a name="method-0">prefersTrackingUntilMouseUp</a></h2>
|
|
+ (BOOL) <b>prefersTrackingUntilMouseUp</b><br>
|
|
|
|
<p>
|
|
The default implementation returns <code>YES</code>, so that the slider
|
|
continues to track the user's movement even if the cursor leaves the slider's
|
|
track.</p>
|
|
|
|
|
|
<p>
|
|
Do not call this method directly. Override it in subclasses where the tracking
|
|
behaviour needs to be different.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-1">allowsTickMarkValuesOnly</a></h2>
|
|
- (BOOL) <b>allowsTickMarkValuesOnly</b><br>
|
|
|
|
<p>
|
|
As of yet, unimplemented.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-2">altIncrementValue</a></h2>
|
|
- (double) <b>altIncrementValue</b><br>
|
|
|
|
<p>
|
|
Returns the value by which the slider is incremented when the user holds down
|
|
the ALT key.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-3">closestTickMarkValueToValue:</a></h2>
|
|
- (double) <b>closestTickMarkValueToValue:</b> (double)aValue<br>
|
|
|
|
<p>
|
|
As of yet, unimplemented.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-4">drawBarInside:flipped:</a></h2>
|
|
- (void) <b>drawBarInside:</b> (NSRect)aRect <b>flipped:</b> (BOOL)flipped<br>
|
|
|
|
<p>
|
|
Draws the slider's track, not including the bezel, in <var>aRect</var></p>
|
|
|
|
|
|
<p>
|
|
<var>flipped</var> indicates whether the control view has a flipped
|
|
coordinate system.</p>
|
|
|
|
|
|
<p>
|
|
Do not call this method directly, it is provided for subclassing only.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-5">drawKnob</a></h2>
|
|
- (void) <b>drawKnob</b><br>
|
|
|
|
<p>
|
|
Calculates the rect in which to draw the knob, then calls <code>drawKnob</code>
|
|
Before calling this method, a <code>lockFocus</code> message must be sent to the
|
|
cell's control view.</p>
|
|
|
|
|
|
<p>
|
|
When subclassing NSSliderCell, do not override this method. Override
|
|
<code>drawKnob:</code> instead.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-6">drawKnob:</a></h2>
|
|
- (void) <b>drawKnob:</b> (NSRect)knobRect<br>
|
|
|
|
<p>
|
|
Draws the knob in <var>knobRect</var>. Before calling this method, a
|
|
<code>lockFocus</code> message must be sent to the cell's control view.</p>
|
|
|
|
|
|
<p>
|
|
Do not call this method directly. It is included for subclassing only.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-7">indexOfTickMarkAtPoint:</a></h2>
|
|
- (int) <b>indexOfTickMarkAtPoint:</b> (NSPoint)point<br>
|
|
|
|
<p>
|
|
As of yet, unimplemented.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-8">isVertical</a></h2>
|
|
- (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>
|
|
<h2><a name="method-9">knobRectFlipped:</a></h2>
|
|
- (NSRect) <b>knobRectFlipped:</b> (BOOL)flipped<br>
|
|
|
|
<p>
|
|
Returns the rect in which to draw the knob, based on the coordinate system
|
|
of the NSSlider or NSMatrix this NSSliderCell is associated with.
|
|
<var>flipped</var> indicates whether or not that coordinate system is flipped,
|
|
which can be determined by sending the <code>isFlipped</code> message to the
|
|
associated NSSlider or NSMatrix.</p>
|
|
|
|
|
|
<p>
|
|
Do not call this method directly. It is included for subclassing only.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-10">knobThickness</a></h2>
|
|
- (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>
|
|
<h2><a name="method-11">maxValue</a></h2>
|
|
- (double) <b>maxValue</b><br>
|
|
|
|
<p>
|
|
Returns the maximum value that the slider represents.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-12">minValue</a></h2>
|
|
- (double) <b>minValue</b><br>
|
|
|
|
<p>
|
|
Returns the minimum value that the slider represents.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-13">numberOfTickMarks</a></h2>
|
|
- (int) <b>numberOfTickMarks</b><br>
|
|
|
|
<p>
|
|
As of yet, unimplemented.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-14">rectOfTickMarkAtIndex:</a></h2>
|
|
- (NSRect) <b>rectOfTickMarkAtIndex:</b> (int)index<br>
|
|
|
|
<p>
|
|
As of yet, unimplemented.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-15">setAllowsTickMarkValuesOnly:</a></h2>
|
|
- (void) <b>setAllowsTickMarkValuesOnly:</b> (BOOL)flag<br>
|
|
|
|
<p>
|
|
As of yet, unimplemented.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-16">setAltIncrementValue:</a></h2>
|
|
- (void) <b>setAltIncrementValue:</b> (double)increment<br>
|
|
|
|
<p>
|
|
Sets the value by which the slider will be be incremented when with the
|
|
ALT key down to <var>increment</var>.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-17">setKnobThickness:</a></h2>
|
|
- (void) <b>setKnobThickness:</b> (float)thickness<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>
|
|
<h2><a name="method-18">setMaxValue:</a></h2>
|
|
- (void) <b>setMaxValue:</b> (double)aDouble<br>
|
|
|
|
<p>
|
|
Sets the maximum value that the sliders represents to <var>maxValue</var>.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-19">setMinValue:</a></h2>
|
|
- (void) <b>setMinValue:</b> (double)aDouble<br>
|
|
|
|
<p>
|
|
Sets the minimum value that the sliders represents to <var>maxValue</var>.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-20">setNumberOfTickMarks:</a></h2>
|
|
- (void) <b>setNumberOfTickMarks:</b> (int)numberOfTickMarks<br>
|
|
|
|
<p>
|
|
As of yet, unimplemented.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-21">setTickMarkPosition:</a></h2>
|
|
- (void) <b>setTickMarkPosition:</b> (NSTickMarkPosition)position<br>
|
|
|
|
<p>
|
|
As of yet, unimplemented.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-22">setTitle:</a></h2>
|
|
- (void) <b>setTitle:</b> (NSString*)title<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>
|
|
<h2><a name="method-23">setTitleCell:</a></h2>
|
|
- (void) <b>setTitleCell:</b> (NSCell*)aCell<br>
|
|
|
|
<p>
|
|
Sets the cell used to draw the title to <var>titleCell</var>.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-24">setTitleColor:</a></h2>
|
|
- (void) <b>setTitleColor:</b> (NSColor*)color<br>
|
|
|
|
<p>
|
|
Sets the colour with which the title will be drawn to <var>color</var>.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-25">setTitleFont:</a></h2>
|
|
- (void) <b>setTitleFont:</b> (NSFont*)font<br>
|
|
|
|
<p>
|
|
Sets the font with which the title will be drawm to <var>font</var>.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-26">tickMarkPosition</a></h2>
|
|
- (NSTickMarkPosition) <b>tickMarkPosition</b><br>
|
|
|
|
<p>
|
|
As of yet, unimplemented.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-27">tickMarkValueAtIndex:</a></h2>
|
|
- (double) <b>tickMarkValueAtIndex:</b> (int)index<br>
|
|
|
|
<p>
|
|
As of yet, unimplemented.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-28">title</a></h2>
|
|
- (NSString*) <b>title</b><br>
|
|
|
|
<p>
|
|
Returns the title of the slider as an <code>NSString</code>.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-29">titleCell</a></h2>
|
|
- (id) <b>titleCell</b><br>
|
|
|
|
<p>
|
|
Returns the cell used to draw the title.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-30">titleColor</a></h2>
|
|
- (NSColor*) <b>titleColor</b><br>
|
|
|
|
<p>
|
|
Returns the colour used to draw the title.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-31">titleFont</a></h2>
|
|
- (NSFont*) <b>titleFont</b><br>
|
|
|
|
<p>
|
|
Returns the font used to draw the title.</p>
|
|
|
|
|
|
<hr>
|
|
<h2><a name="method-32">trackRect</a></h2>
|
|
- (NSRect) <b>trackRect</b><br>
|
|
|
|
<p>
|
|
Returns the rect of the track, minus the bezel.</p>
|
|
|
|
|
|
<hr>
|
|
</body>
|
|
|
|
</html>
|