File:  [NeXTSTEP 3.3 examples] / Examples / IndexingKit / QueryFieldEditor / README.rtf
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:49:02 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;}
\paperw13040
\paperh9600
\margl120
\margr120
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\f0\b\i0\ulnone\fs36\fc0\cf0 QueryFieldEditor
\b0\fs28 \
by Adam Hertz\
\
This example is a field editor that does escape completion against any IXBTree cursor.  It is used by Webster, Librarian and the ToDoList example.  Attach it to a TextField, and when the user types Esc, it completes the prefix using an IXBTree's key space as the set of possible completions.\
\
It behaves like (and was inspired by) the escape completion in Edit: it cycles through all possible completions for a given prefix.  Attach it to a TextField by implementing the Window delegate's - windowWillReturnFieldEditor:toObject: delegate method.  Arm it with any IXBTree cursor, such as an IXBTreeCursor or an IXPostingCursor, and away you go.\
\
The interface and implementation files for this example, QueryFieldEditor.h and QueryFieldEditor.m, are included in the ToDoList example.\
\
The following code sample shows how the Window delegate manages the QueryFieldEditor:\
\

\fs24 #import <btree/IXBTreeCursor.h>\
\
// This window delegate method sets the field editor for the TextField in the instance \
// variable queryField from the instance variable fieldEditor. The first time through, it \
// creates the field editor and loads it with a cursor from the instance variable cursor\
\
- windowWillReturnFieldEditor:sender toObject:client\
\{	\
    if (client != queryField) return nil;\
    if (fieldEditor == nil)\
    \{\
	fieldEditor = [[QueryFieldEditor alloc] init];\
	[fieldEditor setCursor:cursor];\
    \}\
\
    return fieldEditor;\
\}\

}

unix.superglobalmegacorp.com

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