ftp.nice.ch/pub/next/developer/resources/classes/misckit/MiscKit.1.10.0.s.gnutar.gz#/MiscKit/Documentation/Classes/MiscSearcher.rtf

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

Copyright ©1995 Hugh Ashton.  All rights reserved.  Version 1.0.




MiscSearcher



Inherits From:	Object

Declared In:	MiscSearcher.h




Class Description


The MiscSearcher class is an abstract class which connects to a Text object on one end and a List of Text objects on the other.  As text is typed in the Text object (theField), if the string in theField is found in any of the Text objects contained in the List, the phrase will be highlighted (set to NX_DKGRAY) if found in the target Text objects (these will be scrolled if they are in a ScrollView). This is all accomplished by setting the MiscSearcher as a delegate of the search source Text object (automatically done).

The object should be init'ed with an ±initWithField:andTarget: message.  Alternatively, it can be created in the usual way (with ±alloc and ±init) and the setTheList: and setTheField: methods used afterwards to set these items dynamically.

As an additional "free" bonus, thanks to Canon, this also works in Japanese (or other multi-byte character languages) after the InputManager has accepted the final reading of the string (and not before).



Instance Variables





Method Types

Initializing instances	- initWithField: andList:
	- init

Getting information about	- theList
	- theField


Setting properties	- setTheList:
	- setTheField:

Specific method	- forward:

Instance Methods


forward:
	- forward:sender

Finds and displays the next instance of the string in all Text objects contained in the List. This method can be connected to any interface object.




initWithField: andList:
	- initWithField:(id)anObject andList:(anObject)aType

Initializes the instance with the first object set as the source for searching, and the list being a list of Text objects to be searched. Returns self if both theField is a Text object and theList is a List object. If either of these conditions is not met, returns nil. No check is made for the contents of theList.


setTheField:
	- setTheField:(id)anObject

Sets theField to be the Text object anObject and makes self the delegate of theField. If theField is a Text object, returns self, otherwise returns nil.



setTheList:
	- setTheList:(id)anObject

Sets theList to be the List object anObject. If theList is a List object, returns self, otherwise returns nil. No checking is done on the objects contained in theList.



theField
	- theField

A wrapper method which returns the Text object being used as theField.

theList
	- theList

A wrapper method which returns the List object holding the target Text objects.

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