ftp.nice.ch/pub/next/developer/apps/ClassEditor.0.4.NIHS.bsd.tar.gz#/ClassEditor.0.4.NIHS.bsd/Source/MiscSources.subproj/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 becausee Froms 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 a little harder 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.





Instance Variables

- none -





Method Types

	- myMethod





Class Methods

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 threat 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 else gets done.

Be aware of the fact that the sender might not be the object you expect it to be. Forms and TextFields use those Text objects for the real work. Now the sender will be such an internal Text object. You can  easily check that by taking a close look at the sender's delegate. If it is not you, you should use that delegate to find out more about the real sending object.




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