home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.mdf / SourceCode / MiscKit1.2.6 / Source / MiscInspectorKit / MiscInspector.m < prev    next >
Encoding:
Text File  |  1994-03-08  |  1.9 KB  |  117 lines

  1. /* MiscInspector.m                 
  2.  *
  3.  * This class is a stupid single-attribute-inspector that is designed to work
  4.  * with the MiscInspectorManager and the MiscSwapView stuff.
  5.  *
  6.  * For more interface-info see the header file. In depth information
  7.  * can be found here in the source-code.
  8.  *
  9.  * Written by:         Thomas Engel
  10.  * Created:            08.02.1994 (Copyleft)
  11.  * Last modified:     08.02.1994
  12.  */
  13.  
  14. //#import "MiscInspector.h"
  15. //#import "MiscInspectorManager.h"
  16. #import <misckit/misckit.h>
  17.  
  18. @implementation MiscInspector
  19.  
  20. - (BOOL)doesHandleSelection
  21. {
  22.     // By default we will return YES here. In a real inspector class you should
  23.     // ask the manager for the selection type etc and decide then.
  24.     
  25.     return YES;
  26. }
  27.  
  28. - setManager:anObject
  29. {
  30.     return [self setManager:anObject registerSelf:YES];
  31. }
  32.  
  33. - setManager:anObject registerSelf:(BOOL)flag
  34. {
  35.     manager = anObject;
  36.     if( flag == YES ) [manager addInspector:self];
  37.     return self;
  38. }
  39.  
  40. - manager
  41. {
  42.     return manager;
  43. }
  44.  
  45. - ok:sender
  46. {
  47.     [[self window] setDocEdited:NO];
  48.     return self;
  49. }
  50.  
  51. - revert:sender
  52. {
  53.     // Here we will show/hide the buttons and set the editied state of the
  54.     // window.
  55.     // We also set the windows title to the title of the window of our view.
  56.     
  57.     [[self window] setTitle:[[view window] title]];
  58.  
  59.     if( [self wantsButtons] )
  60.             [manager setShowButtons:YES];
  61.     else    [manager setShowButtons:NO];
  62.     
  63.     [[self window] setDocEdited:NO];
  64.  
  65.     return self;
  66. }
  67.  
  68. - window
  69. {
  70.     return [manager window];
  71. }
  72.  
  73. - okButton
  74. {
  75.     return [manager okButton];
  76. }
  77.  
  78. - revertButton
  79. {
  80.     return [manager revertButton];
  81. }
  82.  
  83. - selection
  84. {
  85.     return [manager selection];
  86. }
  87.  
  88. - (unsigned)selectionCount
  89. {
  90.     return [manager selectionCount];
  91. }
  92.  
  93. - touch:sender
  94. {
  95.     [manager touch:sender];
  96.     return self;
  97. }
  98.  
  99. - textDidChange:sender
  100. {
  101.     [manager textDidChange:sender];
  102.     return self;
  103. }
  104.  
  105. - (BOOL)wantsButtons
  106. {
  107.     return YES;
  108. }
  109.  
  110. @end
  111.  
  112. /*
  113.  * History: 08.02.94 First code moved here.
  114.  *
  115.  *
  116.  * Bugs: - No read/write.
  117.  */