ftp.nice.ch/pub/next/developer/resources/palettesfor2.xx/EntryCheckForm.N.bs.tar.gz#/EntryCheckForm/GeneralFormCell.rtf

This is GeneralFormCell.rtf in view mode; [Download] [Up]

GeneralFormCell

INHERITS FROM:	FormCell

DECLARED IN	GeneralFormCell.h

CLASS DESCRIPTION

The GeneralFormCell implements error checking for data entered by the user.  When text editing ends, the isEntryAcceptable: method is called.  This method sends a message to self  with an argument of a string containing the data just entered.  The method sent is the selector contained in entryQual, the entry qualification method that is active.

The entry qualification method is initially set to anyType:, so all entries are considered valid.  Methods that check for various types of integers, doubles, floats, dates, and social secuirity numbers are also available.

New entry qualifiers are generally selected through the IB inspector.  However, they can also be manually set by a call to -setEntryQual:.

INSTANCE VARIABLES

Inherited from Object	Class	isa;

Inherited from Cell	char	*contents;
id	support;
struct _cFlags1	cFlags1;
struct _cFlags2	cFlags2;

Inherited from ActionCell	int	tag;
id	target;
SEL	action;

Declared in FormCell	NXCoord	titleWidth;
id	titleCell;
NXCoord	titleEndPoint;

Declared in GeneralFormCell	SEL	entryQual;

entryQual	The method used to validate field entry

METHOD TYPES

Initializing a GeneralFormCell
	-init
	
Setting and validating input	-isEntryAcceptable
	-setEntryQual
	-currentQualName

IB Inspector name	-inspectorName

Browser delegates	-browser: fillMatrix: inColumn:
	-browser: columnIsValid:
	
Entry validation methods	-anyType:
	-isDouble:
	-posDouble:
	-nonNegDouble:
	-isFloat:
	-posFloat:
	-nonNegFloat:
	-isInt:
	-posInt:
	-nonNegInt:
	-isDate:
	-isSSN:
	-isNumber:
	
INSTANCE METHODS

-anyType:
(BOOL)anyType:(const char *)aString

Always returns YES.  This makes any type of  entry in the field allowed.

-browser: fillMatrix: inColumn:
(int)browser:sender fillMatrix:matrix inColumn:(int)column

An NXBrowser delegate.  This is used to fill the IB inspector browser that displays a scrolling list of entry qualification methods to choose from.  This should never by called by your code.

-browser: columnIsValid:
(BOOL)browser:sender ColumnIsValid:(int)column

An NXBrowser delegate.  This should not be called by your code.

-currentQualName
(const char *)currentQualName

Returns the ASCII name of the method currently being used to qualify entries.

-init
init

Initialized a new instance of GeneralFormCell. The field entry qualification method is set to -anyType.

-inspectorName
(const char *) inspectorName

This should not be called by the user.  It is used by IB to specify the name of the inspector class.

-isDate:
(BOOL)isDate:(const char*)aString

Used to determine if the field entry is of the type mm/dd/yy.  This is not very robustly implemented right now.  At present, and entry that has months greater than zero and less than 13 is accepted, any day with less than 31 days is accepted, and all years greater than zero are accepted.  Thus it would be possible for the field to accept an incorrect date such as 2/31/91.  This is a good place to start improving this class. 

Returns YES if aString meets the minimal requrements

-isDouble:
(BOOL)isDouble:(const char*)aString

Returns YES if aString is a double.

-isSSN:
(BOOL)isSSN:(const char*)aString

Returns YES if aString parses into something that looks like a US social security number: 123-45-6789.  The first number must be between zero and 999, the second between zero and 99, and the last number greater than zero and less than 9999.  In addition, the '-' character must be present in the 4th and 7th postion of the string.

-isFloat:
(BOOL)isFloat:(const char*)aString

Returns YES if aString is a float.

-isInt:
(BOOL)isInt:(const char*)aString

Returns YES if aString is an integer.

-isNumber:
(BOOL)isNumber:(const char*)aString

Returns YES if aString is any type of number.

-posDouble:
(BOOL)posDouble:(const char*)aString

Returns YES if aString is a double variable greater than zero.

-posFloat:
(BOOL)posFloat:(const char*)aString

Returns YES if aString is a float variable greater than zero.

-posInt:
(BOOL)posInt:(const char*)aString

Returns YES if aString is an integer variable greater than zero.

-nonNegDouble:
(BOOL)nonNegDouble:(const char*)aString

Returns YES if aString is a double variable greater than or equal to zero.

-nonNegFloat:
(BOOL)nonNegFloat:(const char*)aString

Returns YES if aString is a float variable greater than or equal to zero.

-nonNegInt:
(BOOL)nonNegInt:(const char*)aString

Returns YES if aString is an integer variable greater than or equal to zero.

-read:
read:(NXStream*)aString

Reads the object from a typed stream.

-setEntryQual:
setEntryQual:(const char *)aString

Passed a string that corresponds to the name of the desired entry qualification method.  This sets the method used to check input.  Eg, [foo setEntryQual:"nonNegInt"] would set that GeneralFormCell to check for non-negative integers. 

-write:
write:(NXStream*)aString

writes the object to a typed stream.
 

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