home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1994 June / NEBULA_SE.ISO / SourceCode / MiscKit / Source / MiscInspectorKit / MiscInspectorWrapper.m < prev    next >
Encoding:
Text File  |  1994-03-08  |  2.4 KB  |  108 lines

  1. /* MiscInspectorWrapper.m                 
  2.  *
  3.  * This is a class that allows a simple collection of single inspectors that
  4.  * work one the same type of data. To the manager they all appear as one
  5.  * mulitpurpose inspector.
  6.  *
  7.  * For more interface-info see the header file. In depth information
  8.  * can be found here in the source-code.
  9.  *
  10.  * Written by:         Thomas Engel
  11.  * Created:            08.02.1994 (Copyleft)
  12.  * Last modified:     24.02.1994
  13.  */
  14.  
  15. //#import "MiscInspectorWrapper.h"
  16. //#import "MiscInspector.h"
  17. //#import "MiscSwapView.h"
  18. #import <misckit/misckit.h>
  19.  
  20. @implementation MiscInspectorWrapper
  21.  
  22. - (BOOL)doesHandleSelection
  23. {
  24.     // Because we are not able to load a default NIB will we'll return NO 
  25.     // by default here.
  26.     // Your subclass has to do some work here
  27.     
  28.     return NO;
  29. }
  30.  
  31. - setManager:anObject
  32. {
  33.     manager = anObject;
  34.     [manager addInspector:self];
  35.     return self;
  36. }
  37.  
  38. - addInspector:anInspector
  39. {
  40.     // We don't add the inspector to the real manager but only to our
  41.     // controller list. After we have done so we can inform the single 
  42.     // inspector(controller) who the real manager is. But then he will not
  43.     // register automatically! No now and not in the future.
  44.     
  45.     if( !controllers ) controllers = [List new];
  46.     
  47.     [controllers addObject:anInspector];
  48.     [anInspector setManager:manager registerSelf:NO];
  49.     return self;
  50. }
  51.  
  52. - addWrappedControllers
  53. {
  54.     // Let get the real swapView and add all our controllers
  55.     
  56.     id    swapView;
  57.     int    i;
  58.     
  59.     swapView = [manager swapView];
  60.     for( i=0; i<[controllers count]; i++ )
  61.         [swapView addController:[controllers objectAt:i]];
  62.  
  63.     return self;
  64. }
  65.  
  66. - window
  67. {
  68.     return [manager window];
  69. }
  70.  
  71. - okButton
  72. {
  73.     return [manager okButton];
  74. }
  75.  
  76. - revertButton
  77. {
  78.     return [manager revertButton];
  79. }
  80.  
  81. - selection
  82. {
  83.     return [manager selection];
  84. }
  85.  
  86. - (unsigned)selectionCount
  87. {
  88.     return [manager selectionCount];
  89. }
  90.  
  91. @end
  92.  
  93. /*
  94.  * History: 24.02.94 Added the selection etc methods.
  95.  *
  96.  *            08.02.94 First code entered.
  97.  *
  98.  *
  99.  * Bugs: - no read/write;
  100.  *
  101.  *         - addInspector might cause some problems if the controllers register
  102.  *           befoe the real manager has registered.
  103.  *           Not really a big deal because this can only happen when we use 
  104.  *           wrappers inside a NIB that also contains the inspectorManager.
  105.  *           This is useless because we have created wrappers to work a NIB
  106.  *           wrappers in some way and doesHandle load the NIB so the manager 
  107.  *           definitly will be valid...when you use this object as intended.
  108.  */