Copyright ã1998 by Robert Frank  All Rights Reserved.

NS_DEV_DOCFOR:objc_class:Text;,NIIntProperty

Inherits From:	NICharProperty : NIBoolProperty : NIProperty : Object

Declared In:	NIProperty.h

Class Description

The NIIntProperty class defines an object that manages the connection between a GUI item and a NetInfo entry. NIIntProperty objects link a NetInfo string to a GUI element. The GUI element must be a single textField ¬ It may not be an element of a form or of an array of textfields created by alt-dragging. It may optionally be accompanied by a slider. ¬

The value entered in the textfield will only be accepted if terminated by hitting return or leaving the field.

The GUI objects are sent the following methods:

	TextField:

		- setTextDelegate:sender
		- setStringValue:(const char *)stringValue
		- setIntValue:(int)value
		- (int)stringValue

		is expected to send:

		- textDidEnd:textObject endChar:(unsigned short)whyEnd
		- textDidChange:sender
		
	Slider:

		- setTarget:sender
		- setAction:@selector(method:)
		- (int)intValue

Instance Variables

id slider;
int intVal;
const char *defaultText;
const char *zero;

slider 	An optional slider.
intVal	The value last set.
defaultText	The optional text to be shown when setting the value for the default (-1).
zero	The optional text to be shown when setting a value of zero (0)

Method Types

Initializing the NIIntProperty object	- init:properties:name:text:slider:default:zero:

Instance Methods

NS_DEV_DOCFOR:objc_method:[Text-initFrame:text:alignment:];,init:properties:name:text:slider:default:zero:

- init:sender
properties:(ni_proplist *)props
name:(const char *)label
text:t slider:s
default:(const char *)d
zero:(const char *)z

Initializes a new NIIntProperty object.  This is the designated initializer for NIIntProperty objects:  If you subclass NIProperty, your subclass's designated initializer must maintain the initializer chain by sending a message to super to invoke this method.  See the introduction to the class specifications for more information.

The seven arguments specify the delegate (sender) to which the propertyWillChange and propertyDidChange methods will be sent, the property list as read from NetInfo (props), the string containing the name of the NetInfo entry (label), the GUI textfield object (t), a slider (s), the text to present when setting the default value (d), and the text to present when setting the zero value (s).

The slider (s) is optional an may be nil. If a slider is present, it may be used to set the integer value. The minimum value o f the slider is set to -1 (the default). 

The default text is not optional and must be specified. This will be shown when after entering -1 or moving the slider to the minimum position.

The zero text is optional and will only be shown if not Null. This text is shown after entering 0 or moving the slider to the zero position.

Returns self.

See also:  - addInt:text:slider:zero: (NIDirectory), Delegates Implemented (NIProperty)