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

  1. /* MiscSwapContentsController.h                 
  2.  *
  3.  * A very simple class for controlling swapAble views. A subclass is a must 
  4.  * to easily work with the MiscSwapView classes.
  5.  *
  6.  * Usage: Just create a instance and connect it to the view that holds the
  7.  *          should swap in when the trigger object is activated.
  8.  *          As an alternative you can set the tag this view is related to by 
  9.  *          creating an object with the right tag and setting it to be the
  10.  *          trigger. Its very easy to do this with the IB.
  11.  *
  12.  * Notes: If you create your own viewController you should really make a sub-
  13.  *          class of this object. Otherwise you might get problems if you do not
  14.  *          implement all the methods because the swapViews are very lazy in
  15.  *          respondsTo checking.
  16.  *
  17.  *          When the view willSwapOut you should ensure that NO colorWells are
  18.  *          activated!! This may cause some trouble or inconsistency!!!!
  19.  *
  20.  * Written by:         Thomas Engel
  21.  * Created:            24.01.1994 (Copyright 1994 Thomas Engel)
  22.  * Last Modified:     14.02.1994
  23.  */
  24.  
  25. //    This object is included in the MiscKit by permission from the author
  26. //    and its use is governed by the MiscKit license, found in the file
  27. //    "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  28. //    for a list of all applicable permissions and restrictions.
  29.  
  30. #import <appkit/appkit.h>
  31.  
  32. @interface MiscSwapContentsController:Object
  33. {
  34.     id        swapView;
  35.     id        view;
  36.     id        trigger;
  37.     int        triggerTag;
  38. }
  39.  
  40. - setSwapView:aView;
  41. - swapView;
  42. - setView:aView;
  43. - view;
  44. - setTrigger:anObject;
  45. - trigger;
  46. - setTriggerTag:(int)tag;
  47. - (int)triggerTag;
  48.  
  49. // These revert/ok msg are send to setup/save the contents of a view.
  50. // Only the revert msg is invoked by default. If you have to store some
  51. // data when swapping out implement a [self ok:self] msg inside willSwapOut.
  52.  
  53. - ok:sender;
  54. - revert:sender;
  55.  
  56. // These methods are used to inform this class of its fate.
  57. // The willSwapIn method calls [self revert] by default.
  58. // Always take care of calling super when overriding these methods !
  59.  
  60. - willSwapIn;
  61. - willSwapOut;
  62. - didSwapIn;
  63. - didSwapOut;
  64.  
  65. - awakeFromNib;
  66.  
  67. @end
  68.  
  69. /*
  70.  * History: 14.02.94 Changed the classes name to MiscSwapContentsController
  71.  *                     from the MiscSwapSubviewController becauses it fits better
  72.  *                     to what it really is.
  73.  *
  74.  *            24.01.94 Made it a Misc object and changed it to work with the
  75.  *                     new Misc stuff.
  76.  *
  77.  *            09.01.94 Added the ok/revert stuff.
  78.  *
  79.  *            08.01.94 Derived from my old swapViewdelegate. The code+methods
  80.  *                     were cleaned up a bit.
  81.  *
  82.  *
  83.  * Bugs: - No read/write.
  84.  *
  85.  *         - I could have automated the colorWell 'problem' but I don't think it
  86.  *           would be a good idea. It's not only a colorWell problem.
  87.  *           Swapping out has some affect on EVERY object that is linked to the 
  88.  *           outside world.
  89.  *           A buildin soultion can not handle every case where object will be
  90.  *           linked to the outside world.
  91.  *           ( I thank the guys form UNInspector Kit because they made the 
  92.  *             notice that problem through their release notes. Anyway I think
  93.  *             this kit has a more general approach towards inspectors. )
  94.  */