home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / Apps / DevTools / eText5 / Source / unused4Code / PEN.bproj / PEN.m < prev    next >
Encoding:
Text File  |  1994-07-26  |  1.8 KB  |  77 lines

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //    FILENAME:    PEN.m
  3. //    SUMMARY:    Defines a protocol for the PEN agents for eText documents
  4. //    PROTOCOLS:    <Agent>
  5. //    INTERFACES:    PEN.nib
  6. //    AUTHOR:        Rohit Khare
  7. //    COPYRIGHT:    (c) 1993,4 California Institure of Technology, eText Project
  8. ///////////////////////////////////////////////////////////////////////////////
  9. //    DESCRIPTION
  10. //        This is a demo mockup of PEN.
  11. ///////////////////////////////////////////////////////////////////////////////
  12. //    HISTORY
  13. //    05/05/94:    Migrated to eText4
  14. //    11/15/93:    Created. Derived from calls in the rest of the code
  15. ///////////////////////////////////////////////////////////////////////////////
  16.  
  17. #import "PEN.h"
  18.  
  19. @implementation PEN
  20.  
  21. + toolAwake:theApp
  22. {
  23.     [theApp registerAgent:[PEN class] 
  24.                      name:NXUniqueString("PEN")
  25.                 menuLabel:NXUniqueString("PEN Helper")
  26.                   menuKey:0];
  27.     return self;
  28. }
  29.  
  30. - init
  31. {
  32.     char        buf[MAXPATHLEN];
  33.     NXBundle   *bundle;
  34.  
  35.      bundle = [NXBundle bundleForClass:[PEN class]];
  36.     if ( [bundle getPath:buf forResource:"PEN" ofType:"nib"] ) {
  37.         [NXApp loadNibFile:buf owner:self withNames:NO];
  38.     } else {
  39.         NXLogError("NIB not found: PEN");
  40.     }
  41.     return self;
  42. }
  43.  
  44. - awakeFromNib
  45. {
  46.     theView = [thePanel contentView];
  47.     return self;
  48. }
  49.  
  50. - (const char*) name {return NXUniqueString("PEN");} 
  51.  
  52. - init:theNavinfo {[self init]; navinfo = theNavinfo; return self;}
  53.  
  54. //- free {[thePanel free]; return [super free];}
  55. - controlView  {return theView;}
  56.  
  57. - getMinSize:(NXSize *) min
  58. {    
  59.     NXRect bounds;
  60.     
  61.     [theView getBounds:&bounds];
  62.     min->width = bounds.size.width;
  63.     min->height = 0.0; // 24.0;
  64.     return self;
  65. }
  66.  
  67. - getMaxSize:(NXSize *) max
  68. {    
  69.     NXRect bounds;
  70.  
  71.     [theView getBounds:&bounds];
  72.     max->width = bounds.size.width;
  73.     max->height = bounds.size.height;
  74.     return self;
  75. }
  76.  
  77. @end