ftp.nice.ch/pub/next/developer/resources/palettesfor2.xx/CubicSlider.README

This is the README for CubicSlider.1.4.s.tar.gz [Download] [Browse] [Up]

What is the CubicSlider?

A Slider subclass featuring two (YES! TWO!) independent 
useful functionalities:

[1] It allows verrrrry precise and direct control (without ALT) 
    of its  of value: you can cram the precision of a 2000 pixel 
    wide slider in a 100 one ! It uses  a cubic polynomial 
    transfer function dynamically redefined on each mouseUp. Yup.

[2] Extrema values are user editable (just a double-click away!) by 
    (exactly) hiding the slider  behind a form (where you can type in 
    a new min or max value, enlarging the slider range) and two 
    buttons, which functions are: 1- to put the current knob value 
    as the new min/max value, thus narrowing the slider range; 
    or 2- to double the present range and add it to the specified 
    extremum. 

New in 1.4

  - Mouse downs outside the knob correctly initiate a mouse tracking
    (as it should, being an expected superclass behavior).
  - Slight demo program mofications (about the meter view).

________________________________________________________________


		   ***  The  CubicSlider  ***

"This palette is probably the most respected slider subclass on the planet..."

Bibite 93


"People will buy copies of NeXTSTEP just to use it"

(The hypest statement about NeXTSTEP products)  


"Don't be seduced."

An impartial, well informed, Unix Review editorialist. 


Seriously, this slider has been designed with YOU in mind! It's 
not a spinoff from a personal application, it offers a fully general 
functionality and won't impose you an undesired feature ("well, I would like 
this, but not that"): everything is optional and, as a true subclass, it can
be used EXACTLY (well, almost) like a plain Slider (but who will? 8^) 

Finally, great effort have been put in the demo program design, it will 
allow you to instantly grasp the full power of this feature packed slider!

	8^)

Includes palette and demo sources, NS2.1 nibs, documentation.rtf, etc...


There have been:

	- G.H. Anderson's RangeSlider (soon to be released by AFS ) 
	- Don Yacktman's RotationSlider 1993
	- Vince Demarco's CircularSlider  1991
	- Andrew Stone's DualActingSlider 1990
	- NeXT's MySlider and MySliderCell (Ensemble, ext. dev.version 2.1),

    and now... for something a completely different:

	 	**  the CubicSlider1.4   **		


THIS one is THE definite Slider subclass!... Oops, the definite 
HORIZONTAL, FLAT Slider subclass... 8^)


Plain Slider drawback #1:

  - high granularity (i.e the finest mouse movement create a 
    large value variation).
 
Plain Slider drawback #2:

  - minValue and maxValue settings aren't accessible to the User.

There are different existing solutions  (ALT drag, 
popping panels, etc...), none completely satisfied me...

Here's how I address the low resolution problem: 

Create a non-linear transfer function, (for which input is the knob 
position, and output, the slider value) with a very low slope  region
around the current knob position, thus giving a high precision (large
knob moves give small value variations). On mouseUp, redefine the transfer 
function so its flattest zone still surrounds the new value. The function 
used is simply the cubic polynomial  (without any extrema) 
y=x^3, adequately scaled and x y-translated for

  a) the point ( minValue, minValue) to be on the curve, 
  b) the point ( maxValue, maxValue) to be on the curve too,
  c) the null slope point to be at y = "value previously selected".

One inevitable consequence of the dynamical redefinition of the fct
is the repositioning of the knob (on mouseUp) at a new position in the
slider: new function, same y -> new x... It takes a little time to get
used to, but the advantage is considerable: on a 100 pixels wide slider
one can reach (in three or four trials) a desired value within a precision
of 1 in 100 000... (a trial being a mouseDown, mouseDragging and mouseUp
sequence).

What about min and maxValues User access? Just dbl-clicking the slider  
... "It just works, virtually." TM  	8^)



	A NOTE FOR YOU BEGINNERS OUT THERE: ( I know: I'm one...)

Subclassing Appkit objects is IMHO a good starting point to learn NeXStep 
programming... It gives occasions to meet overall concepts of NeXStep: 
views, delegation, events & responders, Cells VS Controls , etc... all 
this in a well contained 
small PERSONAL project (uhh? graph paper? Na. I want something of my own 8^). 
What's more, you can palettize it (IB custom palette) and 
make all of us benefice from your first NeXTsteps! Palettes are fun.
  
passez une bonne journee,	RL

departement de physique, etat solide, 2e cycle, Raymond Lutz
ND_cube_NeXT_newbe_wannabe lutzray@ERE.UMontreal.CA (ascii only)

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.