home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 (1993) / nebula.bin / SourceCode / MiniExamples / FilterFunctions / NameTextField.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-09-29  |  1002 b   |  38 lines

  1.  
  2. /*
  3.  *      You may freely copy, distribute and reuse the code
  4.  *      in this example.  NeXT disclaims any warranty of
  5.  *      any kind, expressed or implied, as to its fitness
  6.  *      for any particular use.
  7.  *
  8.  *      Written by: Susan Rayl
  9.  *
  10.  *      Created 21-Mar-91
  11.  */
  12.  
  13. #import <appkit/TextField.h>
  14. #import <appkit/Text.h>
  15.  
  16. @interface NameTextField:TextField
  17. {
  18.     NXTextFilterFunc oldTextFilter; /* hold the original filter func */
  19. }
  20.  
  21. /* override these methods to set a new text filter function for the Text object
  22.  * which acts as the FieldEditor for this TextField.
  23.  */
  24. - becomeFirstResponder;
  25. - selectText:sender;
  26.  
  27. /* override this method to restore the original text filter function to the
  28.  * Text object.
  29.  */
  30. - textDidEnd:anObject endChar:(unsigned short)whyEnd;
  31.  
  32. /* this is the text filter function which will be used by the Text object to
  33.  * (possibly) manipulate the characters entered by the user.
  34.  */
  35. char *nameFilter(id textObj, char *inputText, int *inputLength, int position);
  36.  
  37. @end
  38.