home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1994 June / NEBULA_SE.ISO / SourceCode / MiscKit / Headers / misckit / MiscInspector.h < prev    next >
Encoding:
Text File  |  1994-03-23  |  3.2 KB  |  93 lines

  1. /* MiscInspector.h                 
  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.  * Usage: For rapid prototyping just create one instans for one view/attribute
  7.  *          you want to inspect/control.
  8.  *          Create a subclass to add the real code.
  9.  *          It works almost the same way as the WorkspaceInspectors do. So it 
  10.  *          should be straight forward. Just write your revert:, ok: methods and
  11.  *          your almost done. You MUST add [super ok/revert:sender].(see below)
  12.  *          The only difference is 'doesHandleSelection'. There you have to
  13.  *          check weqther the managers selection is worth your attention or not.
  14.  *          Remember that the window, textDidChange etc methods always need the
  15.  *          manager to work properly.
  16.  *
  17.  * Notes: This class depends on the swapView stuff and therefore it is not
  18.  *          possible to have one object in charge of different views!
  19.  *          I don't find this a very serious limitation. In the very rare cases
  20.  *          where you want to do that you should use an InspectorWrapper. Take a 
  21.  *          look at the way the default inspectors are implemented.
  22.  *
  23.  *          If you really want to change the ok/rev. Buttons title...do it.
  24.  *          But remember to reset them when you willSwapOut !
  25.  *          And take care of ColorWells. Remember to deactivate then when
  26.  *          swapping out.
  27.  *
  28.  * Written by:         Thomas Engel
  29.  * Created:            08.02.1994 (Copyright 1994 Thomas Engel)
  30.  * Last modified:     22.02.1994
  31.  */
  32.  
  33. //    This object is included in the MiscKit by permission from the author
  34. //    and its use is governed by the MiscKit license, found in the file
  35. //    "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  36. //    for a list of all applicable permissions and restrictions.
  37.  
  38. #import <misckit/MiscSwapContentsController.h>
  39.  
  40. @interface MiscInspector:MiscSwapContentsController
  41. {
  42.     id        manager;
  43. }
  44.  
  45. // doesHandleSelection should return weather we are intersted or not.
  46. // Setting the manager has the effect that the inspector will add itself to
  47. // the managers inspector list ( [self setManager:.. registerSelf:YES] )
  48. // Avoiding registration is needed when we work with inspectorWrappers.
  49.  
  50. - (BOOL)doesHandleSelection;
  51. - setManager:anObject;
  52. - setManager:anObject registerSelf:(BOOL)flag;
  53. - manager;
  54.  
  55. // Use revert to load the NIB etc. Same stuff as with SwapContentsControllers
  56. // and IB/WM Inspectors.
  57.  
  58. - ok:sender;
  59. - revert:sender;
  60.  
  61. // The following methods are almost stupid . They only ask the manager for
  62. // the same info. They are included for more WM-Inspector appearance.
  63.  
  64. - window;
  65. - okButton;
  66. - revertButton;
  67.  
  68. - selection;
  69. - (unsigned)selectionCount;
  70.  
  71. - touch:sender;
  72. - textDidChange:sender;
  73.  
  74. // As for the IB-Inspectors each inspector can handle button appearance.
  75. // Attention this can only work the right way when you include 
  76. // [super ok/revert] to your overridden methods.
  77. // revert should be the first, ok the last action in your privat ok/revert
  78. // stuff.
  79. // By default we want buttons...if they exist!
  80.  
  81. - (BOOL)wantsButtons;
  82.  
  83. @end
  84.  
  85. /*
  86.  * History: 08.02.94 First code moved here.
  87.  *
  88.  *
  89.  * Bugs: - No read/write.
  90.  *
  91.  *         - wantsButtons does only Hide the Buttons right now. Maybe there is
  92.  *           a way to size the swapView. (is it desireable ?)
  93.  */