PtrNumberLine

INHERITS FROM	NumberLine : View : Responder : Object

DECLARED IN	PtrNumberLine.h

CLASS DESCRIPTION

A PtrNumberLine displays a horizontal number line and an arrow which can be dragged along the line by the user to choose particular values.  An action message can be sent to a designated target as the arrow is dragged, or the PtrNumberLine can be queried for the current value.

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 NumberLine	int	orientation;
int	labelPosition;
float	linePosition;
float	backgroundGray;
float	lineGray;
float	labelGray;
float	borderWidth;
struct __tickInfo 	tickInfo;
id	numberLineImage;

Defined in PtrNumberLine	float	x;
NXRect	pointerRect;
id	pointerNXImage;
id	target;
SEL	action;

x 	The value on the number line at which the pointer is pointing.

pointerRect 	The rectangle, in current coordinates, for the pointer.

pointerNXImage 	An NXImage containing the drawing of the pointer.

target 	Will receive action messages as the arrow is dragged.

action 	The message sent to the target as the arrow is dragged.

METHOD TYPES

Initializing a new PtrNumberLine	- initFrame:

Moving the Arrow	- mouseDown: 
- x
- setX:
- acceptsFirstMouse

Target and Action	- setAction: 
- action
- setTarget:
- target

Drawing the NumberLine	- drawSelf::
- pointerNXImage
- pointerLocation

INSTANCE METHODS

acceptsFirstMouse
- (BOOL)acceptsFirstMouse

Calculates the tick marks and labels for the current number line.  This method updates all the values of the structure tickInfo.  It doesn't do any drawing into either the numberLineNXImage or the View.  This method is invoked whenever the bounds change.  You will not need to invoke it yourself.

action
- action

Returns the current center point of the number line.

See also:  - setCenter, - setMin:max:

drawSelf::
- drawSelf:(const NXRect *)rects :(int)rectCount

Composites the contents of numberLineNXImage onto the NumberLine.

initFrame:
- initFrame:(const NXRect *)frameRect

Initializes a new NumberLine object.  The number line will display the range -10 to 10 and will be set at linePosition 30.  If frameRect.size.height is greater than frameRect.size.width, the number line will be vertical; otherwise, it will be horizontal.  Labels will be below a horizontal number line or to the left of a vertical one.

mouseDown:
- mouseDown:(NXEvent *)theEvent

Returns one of the constants BELOWLEFT or ABOVERIGHT to indicate the position where the tick mark labels will be drawn.  The default is below a horizontal number line or to the left of a vertical number line.

See also:  - setLabelPosition:

pointerLocation
- (NXPoint)pointerLocation

Returns the position, in default coordinates, at which the number line will be drawn within the view.  The position is measured from the bottom in case of a horizontal number line and from the right in case of a vertical number line.  The default position is 30.

See also:  - setLinePosition:

pointerNXImage
- pointerNXImage

Returns the current rightmost or topmost endpoint of the number line.  Redraws only if autodisplay is on.  Returns self.

See also:  - min, - setMin:max:, - setCenter:, - slide:, - zoomIn:, - zoomOut:

setAction:
- setAction:(SEL)anAction

Returns the current leftmost or bottommost endpoint of the number line.  Redraws only if autodisplay is on.  Returns self.

See also: - max, - setMin:max:, - setCenter:, - slide:, - zoomIn:, - zoomOut:

setTarget:
- setTarget:anObject

Returns the NXImage containing the drawing of the number line.  This allows, with autodisplay off,  other objects to do their own compositing in order to increase drawing speed.  Returns self.

See also:   - setAutodisplay: (View)

setX:
- setX:(float)newValue

Returns one of the constants HORIZONTAL or VERTICAL, indicating whether the number line is horizontal or vertical.  It will be VERTICAL if and only if the NumberLine is taller than it is wide. 

target
- target

Sets the background gray for the NumberLine.  The background will be transparent, and the default gray is NX_WHITE.  Does not redraw.  Returns self.

x
- (float)x

Indicates whether or not a black border should be drawn around the NumberLine and, if so, its width in unscaled (default) coordinates.  If  shouldHaveBorder is NO, width will be ignored.  Does not redraw.  Returns self.