ftp.nice.ch/pub/next/developer/resources/classes/misckit/MiscKit.1.10.0.s.gnutar.gz#/MiscKit/Temp/MiscCompletionText.rtf

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

Release 0.1  Copyleft ©1995 by Thomas Engel.  All Rights Reserved.






MiscCompletionText






Inherits From:	Text

Declared In:	MiscCompletionText.h

Depends On:	<appkit/appkit.h>





Class Description

This subclass enables a text completion mechanism triggered by pressing the ESC key. To be more useful it is recommended that you use the poseAs: method to replace the normal Text class. This way all Text, TextField and Form instances will try to perform completion.  This is because Forms and TextField use a common instance of class Text to do their work. Now our subclass takes care of a real textDelegate method to ensure completion gets where it was intendetd to.  So just use delegates as you have done before.

If you don't like posing, just use it as a real subclass. This is only marginally more difficult after all.

In the future this addition might migrate into the EmacsText object or some other classes. I'm sorry to create yet another tiny class but this is the most elegant way I found to extend all my apps with easy text completion.





Method Types

	- keyDown:





Instance Methods

keyDown:
- keyDown:(NXEvent *)event

Tries to catch the ESC key press and ask the texts delegate to perform completion. It does not select any portion of text. It is up to the delegate to decide how to treat that. By default it should try to use a current section. If there is none it should 

See also:  - textShouldPerformCompletion (Delegate)





Methods Implemented by the Delegate

textShouldPerformCompletion:
- textShouldPerformCompletion:sender

Send to the delegate once the ESC key gets pressed. Returning nil causes the Text to use the default key handling method. Otherwise nothing gets done.




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