home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.bin / SourceCode / MiscKit1.2.6 / Headers / misckit / MiscInspectorWrapper.h < prev    next >
Encoding:
Text File  |  1994-03-22  |  3.2 KB  |  86 lines

  1. /* MiscInspectorWrapper.h                 
  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.  * Usage: You need to implement a proper doesHandleSelection method. The
  8.  *          rest cn be done inside IB.
  9.  *          This class will be useful if you want to have one NIB that contains
  10.  *          all the different single-inspectors (subviewControllers) but you 
  11.  *          only want the NIB to be loaded when it's needed.
  12.  *          Also this enables you to programatically create many copies of
  13.  *          a single inspector and have it respond to different triggers.
  14.  *          At runtime the wrapper has to find out how many copys are needed
  15.  *          (remember: there must be a ono-on-one trigger-inspector(controller)
  16.  *           relation because of the swapView objects)
  17.  *          and he can creat them. That's how NotApplicable etc are 
  18.  *          implemented (also they are not really wrapper subclasses)
  19.  *
  20.  * Notes: Maybe it's somewhat confusing be I'll try to clarify it a little bit.
  21.  *          ...or maybe I'll confuse you even more.
  22.  *          All the single inspectors will initially think that the wrapper is
  23.  *          the real inspector manager. But this is buggy and stupid.
  24.  *          A wrapper can not provide the information about selections etc. like
  25.  *          a real manager should. But we need to fool the single inspectors for
  26.  *          the first time to let it register (addInspector) itself right here
  27.  *          at the wrapper.
  28.  *          After the wrapper has added an inspector it can set the single
  29.  *          inspectors manager to the real app inspector manager. So all 
  30.  *          selection info can be found etc . pp.
  31.  *
  32.  *          Inside the wrapper I decided to naem single inspectors just 
  33.  *          controllers because the are somehow handicaped inspectors.
  34.  *          They are lacking (or can/should lack) a usaable doesHandleSelection
  35.  *          implementation because this is perfectly handled by the wrapper.
  36.  *
  37.  * Written by:         Thomas Engel
  38.  * Created:            08.02.1994 (Copyright 1994 Thomas Engel)
  39.  * Last modified:     24.02.1994
  40.  */
  41.  
  42. //    This object is included in the MiscKit by permission from the author
  43. //    and its use is governed by the MiscKit license, found in the file
  44. //    "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  45. //    for a list of all applicable permissions and restrictions.
  46.  
  47. #import <appkit/appkit.h>
  48.  
  49. @interface MiscInspectorWrapper:Object
  50. {
  51.     id        manager;
  52.     id        controllers;
  53. }
  54.  
  55. // Locally we speak of controllers but to work properly we have to use the 
  56. // same method as the inspectorManager does.
  57. // The haredst part it to implement a new doesHandle method that checks the 
  58. // selection and loads the NIB if it finds work is one the way.
  59.  
  60. - (BOOL)doesHandleSelection;
  61. - setManager:anObject;
  62.  
  63. - addInspector:anInspector;
  64. - addWrappedControllers;
  65.  
  66. // The following methods are almost stupid . They only ask the manager for
  67. // the same info. They are included for more WM-Inspector appearance and to
  68. // Have the wrapper behave more like a MiscInspector.
  69.  
  70. - window;
  71. - okButton;
  72. - revertButton;
  73.  
  74. - selection;
  75. - (unsigned)selectionCount;
  76.  
  77. @end
  78.  
  79. /*
  80.  * History: 24.02.94 Added the selection etc methods.
  81.  *
  82.  *            08.02.94 First code entered.
  83.  *
  84.  *
  85.  * Bugs: - No read/write.
  86.  */