File:  [NeXTSTEP 3.3 examples] / Examples / DatabaseKit / Formatter / README.rtf
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:48:58 2018 UTC (8 years, 1 month ago) by root
Branches: NeXT, MAIN
CVS tags: NeXTSTEP33, HEAD
Sample Programs from NeXSTEP 3.3

{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;\f1\fmodern Ohlfs;}
\paperw13700
\paperh10740
\margl120
\margr120
{\colortbl;\red0\green0\blue0;}
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b\i0\ulnone\fs36\fc0\cf0 DateFormatter
\b0\fs24 \
by Scott Weiner, NeXT Developer Training \
( Special thanks to Brian Pinkerton  for the original Formatter code)\
\

\b\fs28 Overview
\b0\fs24 \
\
In order to run this example, you need to have an adaptor, a model and a data source.   You should install the your .dbmodel file into your ~/Library/Databases directory.\
This example shows how to create a formatter for a DBTableView that uses a subclass of TextFieldCell to validate the user's input.  The formatter forces the user to type in values of the form xx/xx/xx where x is a number (0-9).  \
\
To use this example, drag two properties from the included DBModule in the .nib file into the DBTableView in the main window.  NOTE the second column should contain a property of type string.\
\
Compile and run.  Press the Fetch button under the DBTableView and now try to edit some information in the columns.  Notice what happens when you try to type anything that is not of the form xx/xx/xx in the second column.\
\

\b\fs28\fc1\cf1 Program Organization
\b0\fs24 \
\

\b Major Classes in the Application
\b0 \
\
 \

\pard\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fi-1900\li1900\fc1\cf1 TableViewController	A general manager object.  A subclass of the Object class.  Performs miscellaneous 		initializations. \

\pard\tx560\tx1120\tx2060\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\fi-2060\li2060\fc1\cf1 \

\pard\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fi-1900\li1900\fc1\cf1 DateFormatter		A subclass of DBFormatter.  Provides string validation for date values		\
DateTFCell		A subclass of TextFieldCell.  Only allows values of the form xx/xx/xx to be entered.		\

\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b\fs28\fc1\cf1 Topics Of Interest
\b0\fs24 \

\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\b\fc1\cf1 \

\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b0\fc1\cf1 - 
\b How to replace the format of your tableview columns with a subclass of DBFormatter\

\b0 See the files TableViewController.[hm]\
\
- 
\b How to create a subclass of DBFormatter which allow you to control user input\

\b0 See the files DateFormatter.[hm], DateTFCell.[hm]\
\

\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\b\fs28\fc1\cf1 Change History
\b0\fs24 \
September 1992		Created for 3.0 Gold
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.