home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.mdf / SourceCode / MiscKit1.2.6 / Documentation / SwapKitTutorial.rtfd / AtomGraphicsController.m < prev    next >
Encoding:
Text File  |  1994-02-24  |  1.3 KB  |  60 lines

  1. /* AtomGraphicsController.h                 
  2.  *
  3.  * This subclass of MiscInspector is in charge of the atom graphics
  4.  * settings.
  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:            11.01.1994 (Copyleft)
  11.  * Last modified:     08.02.1994
  12.  */
  13.  
  14. #import "AtomGraphicsController.h"
  15. #import "../../Atom.h"
  16.  
  17. @implementation AtomGraphicsController
  18.  
  19. - colorDidChange:sender
  20. {
  21.     [self touch:self];
  22.     return self;
  23. }
  24.  
  25. - resetColor:sender
  26. {
  27.     // Here we set the color to the motherAtoms color!
  28.     
  29.     [colorWell setColor:[[[self selection] motherAtom] color]];
  30.     [self colorDidChange:self];
  31.     return self;
  32. }
  33.  
  34. - ok:sender
  35. {
  36.     [[self selection] setColor:[colorWell color]];
  37.     return [super ok:sender];
  38. }
  39.  
  40. - revert:sender
  41. {
  42.     [super revert:sender];
  43.  
  44.     [colorWell setColor:[[self selection] color]];
  45.     return self;
  46. }
  47.  
  48. @end
  49.  
  50. /*
  51.  * History: 11.01.94 First implementation.
  52.  *
  53.  *
  54.  * Bugs: - There is a bug! Resetting the color does not remove the color 
  55.  *           inside the atom but only set its color to the motherAtoms color.
  56.  *           This is not nice! I have to include a check to the okRoutine.
  57.  *
  58.  *         - Not really wrong. I know I could have cached the selection but it
  59.  *           is not necessary...so I saved the memory.
  60.  */