Release 1.4  by Raymond Lutz, 24 juin 1993.

CubicSlider

INHERITS FROM	Slider: Control : View : Responder : Object

DECLARED IN	CubicSlider.h

CLASS DESCRIPTION

As Sliders, CubicSliders are Controls that have a sliding knob that can be moved to represent a value between a minimum and a maximum. In addition, this subclass allows the user to interactively set those extremum values by double-clicking on the knob. Different actions can then be taken: 

either the user narrows the slider range 

	- entering a superior minimum value (or an inferior maximum) in a small form popped over the slider, or

	- pushing a button identified with a NXscrollMenuDown icon which function is to use for the new 
	   extremum value the current slider value, as set just before the double-click;

or either he enlarges the slider range

	- entering  an inferior minimum value (or a superior maximum) in the small form, or

	- pushing a button identified with a NXscrollMenuRight (NXscrollMenuLeft) icon which function is to 
	   quadruple the current range and place the added interval  at the specified extremity.

Double-clicking on the left half of the knob will designate the minimum value as the one to be modified and, inversely, double-clicking on its right  half will designate the maximum value. To exit edit mode without any modification simply press enter, the unchanged selected text in the form will be taken as the extremum value.

Also,  an added mechanism allows a precise control of the slider value. When inquired about its value (with a doubleValue, floatValue or intValue message), the slider takes the knob position, passes it through a cubic transfer function  and returns this transformed value: since a flat region surrounds the initial knob position, large moves give small output value variations, thus an increased resolution is attained. The polynomial  is redefined after each mouseUp so its flat region still surrounds the new value selected by the user.  The user can toggle between this behavior and the normal one by ALT double-clicking the slider.

CubicSlider (and an accompanying CubicSliderCell) can be dragged into your application from Interface Builder's Palettes panel, and its attributes set by Inspector panels.  

INSTANCE VARIABLES

Inherited from Object	Class	isa;

Inherited from Responder	id	nextResponder;

Inherited from View	NXRect	frame;
NXRect	bounds;
id	superview;
id	subviews;
id	window;
struct __vFlags	vFlags;

Inherited from Control	int	tag;
id	cell;
struct _conFlags	conFlags;

Declared in CubicSlider	(none)

METHOD TYPES

Initializing a new  slider instance	± initFrame:

Setting CubicSlider Values	- doubleValue
- floatValue
- intValue
	- linearDoubleValue
- linearFloatValue
- linearIntValue
- maxValue
- minValue
- setDoubleValue: 
- setFloatValue: 
- setIntValue: 
- setMaxValue: 
- setMinValue: 

Setting Transfer Function	- setCubic:
- isCubic

Setting User Access	- setMinEditable
- minIsEditable
- setMaxEditable
- maxIsEditable

Setting Absolute Range	- setAbsoluteMinValue
- absoluteMinValueSet
- absoluteMinValue
- clearAbsoluteMinValue

- setAbsoluteMaxValue
- absoluteMaxValueSet
- absoluteMaxValue
- clearAbsoluteMaxValue

Targets And Actions	- upAction
- setUpAction: 
- upTarget: 
- setUpTarget: 
- setUpTarget:action: 

INSTANCE METHODS

initFrame:
± initFrame:(const NXRect *)frameRect

Initializes and returns the receiver, a new instance of CubicSlider.  The slider must be horizontal and frameRect wider than it is high; otherwise it will not work...  By default, the slider is continuous and cubic.  After initializing the slider, invoke the sizeToFit method to resize the slider to accommodate its knob.  This method is the designated initializer for the CubicSlider class.  

setEnabled:
- setEnabled:(BOOL)flag

If flag is YES, enables the CubicSlider; if NO, disables the CubicSlider.  Redraws the interior of the CubicSlider if autodisplay is on and the enabled state has changed.  Returns self.  

minValue
- (double)minValue

Returns the minimum value of the CubicSlider.

setMinValue:
- setMinValue:(double)aDouble

Sets the minimum value of the CubicSlider. If  aDouble conflicts  with a set absoluteMinValue (being smaller) then absoluteMinValue will also be set to this specified minimum value. Returns self.

See also: ±  setAbsoluteMinValue:

maxValue
- (double)maxValue

Returns the maximum value of the CubicSlider.

setMaxValue:
- setMaxValue:(double)aDouble

Sets the maximum value of the CubicSlider. If  aDouble conflicts  with a set absoluteMaxValue (being greater) then absoluteMaxValue will also be set to this specified maximum value. Returns self.

See also: ±  setAbsoluteMaxValue:

setMinEditable:
- setMinEditable:(BOOL) aFlag

Sets the slider minimum value user access. If flag is YES, the user will be able to specify a new minimum value after a double-click; if NO, a system beep will inform that the minimum value can't be edited. Returns self.

See also: ±  setAbsoluteMinValue:

minIsEditable:
- (BOOL) minIsEditable

 Returns YES if the user can edit the slider minimum value, NO otherwise.

setMaxEditable:
- setMaxEditable:(BOOL) aFlag

Sets the slider maximum value user access. If flag is YES, the user will be able to specify a new maximum value after a double-click; if NO, a system beep will inform that the maximum value can't be edited. Returns self.

See also: ±  setAbsoluteMaxValue:

maxIsEditable:
- (BOOL) maxIsEditable

 Returns YES if the user can edit the slider maximum value, NO otherwise.

setAbsoluteMinValue:
- setAbsoluteMinValue:(double)aDouble

Sets a slider absoluteMinValue: even if the user has access to the slider minimum value, he won't be allowed to set it smaller then  aDouble (a system beep will indicate that a limit exists and has been reached). If  aDouble conflicts  with the current slider minimum value (being greater) then the slider minimum value will also be set to aDouble. Returns self.

See also: ±  setMinValue, ±  absoluteMinValue, ±  absoluteMinValueSet, ±  clearAbsoluteMinValue

absoluteMinValueSet
- (BOOL) absoluteMinValueSet

Returns YES if an absoluteMinValue has been set, NO otherwise.

See also: ±  absoluteMinValue, ±  setAbsoluteMinValue, ±  clearAbsoluteMinValue

 absoluteMinValue
- (double)absoluteMinValue

Returns the absoluteMinValue of the CubicSlider (no check done if set or not ).

See also:  ±  setAbsoluteMinValue, ±  absoluteMinValueSet, ±  clearAbsoluteMinValue

clearAbsoluteMinValue
- clearAbsoluteMinValue
  
Clears the absoluteMinValue of the CubicSlider. Returns self.

See also:  ±  absoluteMinValue, ± setAbsoluteMinValue, ±  AbsoluteMinValueSet

setAbsoluteMaxValue:
- setAbsoluteMaxValue:(double)aDouble

Sets a slider AbsoluteMaxValue: even if the user has access to the slider maximum value, he won't be allowed to set it greater then  aDouble (a system beep will indicate that a limit exists and has been reached). If  aDouble conflicts  with the current slider maximum value (being smaller) then the slider maximum value will also be set to aDouble. Returns self.

See also: ±  setMaxValue, ±  absoluteMaxValue, ±  AbsoluteMaxValueSet, ±  clearAbsoluteMaxValue

absoluteMaxValueSet
- (BOOL) absoluteMaxValueSet

Returns YES if an absoluteMaxValue has been set, NO otherwise.

See also: ±  absoluteMaxValue, ±  setAbsoluteMaxValue, ±  clearAbsoluteMaxValue

 absoluteMaxValue
- (double)absoluteMaxValue

Returns the absoluteMaxValue of the CubicSlider (no check done if set or not ).

See also:  ±  setAbsoluteMaxValue, ±  AbsoluteMaxValueSet, ±  clearAbsoluteMaxValue

clearAbsoluteMaxValue
- clearAbsoluteMaxValue
  
Clears the absoluteMaxValue of the CubicSlider. Returns self.

See also:  ±  absoluteMaxValue, ± setAbsoluteMaxValue, ±  AbsoluteMaxValueSet

setCubic:
- setCubic:(BOOL) aFlag

If flag is YES, the transfer function will be a cubic polynomial; if NO, it will be linear, as its superclass (that is, no transfer function).  
Returns self.

See also: ±  linearIntValue, ±  linearFloatValue, ±  linearDoubleValue

isCubic:
- (BOOL) isCubic

 Returns YES if the slider has a cubic polynomial transfer function, NO otherwise (no transfer function).

setUpTarget:action:
- setUpTarget:anObject action:(SEL)aSelector

Sets the receiver's up target and up action method to anObject and aSelector. The later is sent to the former when   the slider cell  receives a stopTracking:at:inView:mouseIsUp: message (that is, when the user releases the slider knob). Useful when one needs user feedback about transformations  too computing intensive to be done continuously: an approximation of the final result can be updated by the standard target  and the final result thoroughly determined by this up target. Returns self.

See also:  ± setUpTarget:, ± setUpAction:, ± mouseIsUp

upTarget
- target

Returns the receiver's target

setUpTarget:
- setUPTarget:anObject

Sets the receiver's upTarget to anObject.  Returns self.

See also:  ± setUpAction:

upAction
- (SEL)upAction

Returns the selector for the receiver's action method. 

See also:  ± setUpAction:

setUpAction
- setUpAction:(SEL)aSelector

Sets the receiver's up action method to aSelector.  Returns self.

See also:  ± setUpTarget:

mouseIsUp
- (BOOL)mouseIsUp

Returns YES if the user released the slider knob, NO if he is still dragging (this is an alternative to setUpTarget:action: and used with a continuous slider). 

linearDoubleValue
- (double)linearDoubleValue

Returns the linear value of the CubicSlider.

floatValue
- (float)floatValue

Returns the value of the CubicSlider as a float.

intValue
- (int)intValue

Returns the value of the CubicSlider as an int.

doubleValue
- (double)doubleValue

Returns the value of the CubicSlider.

setDoubleValue:
- setDoubleValue:(double)aDouble

Sets the value of the CubicSlider to aDouble.  Updates the CubicSlider knob position to reflect the new value and returns self.

setFloatValue:
- setFloatValue:(float)aFloat

Sets the value of the CubicSlider to aDouble.  Updates the CubicSlider knob position to reflect the new value and returns self.

setIntValue:
- setIntValue:(int)anInt

Sets the value of the CubicSlider to anInt.  Updates the CubicSlider knob position to reflect the new value and returns self.

linearFloatValue
- (float)linearFloatValue

Returns the linear value of the CubicSlider as a float.

linearIntValue
- (int)linearIntValue

Returns the linear value of the CubicSlider as an int.

METHODS IMPLEMENTED BY TARGETS 

takeCubicSliderStatusFrom:
- takeCubicSliderStatusFrom: sender

This method invoked by CubicSlider (or a Matrix owning CubicSliderCells) when one of its extremum values has been modified by the user or when its transfer function has been toggled between linear and cubic polynomial with an ALT double-click. Targets are the regular cell (or matrix) action target and the additionnal CubicSliderCell upTarget  (if any).