home *** CD-ROM | disk | FTP | other *** search
/ Nebula / nebula.bin / SourceCode / Palettes / Clocks / Inspectors.subproj / AnalogClockInspector.m < prev    next >
Text File  |  1992-12-05  |  3KB  |  103 lines

  1. //----------------------------------------------------------------------------------------------------
  2. //
  3. //    AnalogClockInspector
  4. //
  5. //    Inherits From:        ClockInspector
  6. //
  7. //    Declared In:        AnalogClockInspector.h
  8. //
  9. //    Disclaimer
  10. //
  11. //        You may freely copy, distribute and reuse this software and its
  12. //        associated documentation. I disclaim any warranty of any kind, 
  13. //        expressed or implied, as to its fitness for any particular use.
  14. //
  15. //----------------------------------------------------------------------------------------------------
  16. #import "AnalogClockInspector.h"
  17. #import "AnalogClock.h"
  18.  
  19.  
  20. @implementation AnalogClockInspector
  21.  
  22. //----------------------------------------------------------------------------------------------------
  23. //    Private Methods
  24. //----------------------------------------------------------------------------------------------------
  25. + (const char*) _nib
  26. {
  27.     return "AnalogClockInspector";
  28. }
  29.  
  30.  
  31. - _validateOptions
  32. {
  33.     [[options findCellWithTag:1] setEnabled: [[options findCellWithTag: 0] state]];
  34.     return self;
  35. }
  36.     
  37.  
  38. //----------------------------------------------------------------------------------------------------
  39. //    Reverting Attributes
  40. //----------------------------------------------------------------------------------------------------
  41. - revertOptions
  42. {
  43.     [[options findCellWithTag:0] setState:[object isDisplayEnabled]];
  44.     [[options findCellWithTag:1] setState:[object wantsSeconds]];
  45.     [[options findCellWithTag: 2] setState:[object isDraggable]];
  46.     [[options findCellWithTag: 3] setState:[object willAcceptDrop]];
  47.     [[options findCellWithTag: 4] setState:[object _timerMode]];
  48.     [[options findCellWithTag: 5] setState:[object activateOnAwake]];
  49.     [self _validateOptions];
  50.     return self;
  51. }
  52.  
  53.  
  54. - revertDisplay
  55. {
  56.     [colorOrImage selectCellWithTag: [object _backgroundIsColor]];
  57.     [backgroundColor setColor: [object backgroundColor]];
  58.     [backgroundImage image: [object backgroundImage]];
  59.     [clockfaceimage image: [object clockFace]];
  60.     [hourAndMinuteHandcolor setColor: [object hourAndMinuteHandColor]];
  61.     [secondHandcolor setColor: [object secondHandColor]];
  62.     return self;
  63. }
  64.     
  65.  
  66. //----------------------------------------------------------------------------------------------------
  67. //    Setting Attributes
  68. //----------------------------------------------------------------------------------------------------
  69. - setClockOptions: sender
  70. {
  71.     [object setDisplayEnabled: [[options findCellWithTag:0] state]];
  72.     [object wantsSeconds: [[options findCellWithTag:1] state]];
  73.     [object isDraggable: [[options findCellWithTag:2] state]];
  74.     [object willAcceptDrop: [[options findCellWithTag:3] state]];
  75.     [object _timerMode: [[options findCellWithTag:4] state]];
  76.     [object activateOnAwake: [[options findCellWithTag:5] state]];
  77.     [self _validateOptions];
  78.     return [self ok:nil];
  79. }
  80.  
  81.  
  82. - setClockFaceImage: sender
  83. {
  84.     [object clockFace: [clockfaceimage image]];
  85.     return [self ok:nil];
  86. }
  87.     
  88.     
  89. - setHourAndMinuteHandColor: sender
  90. {
  91.     [object hourAndMinuteHandColor: [sender color]];
  92.     return [self ok:nil];
  93. }
  94.     
  95.  
  96. - setSecondHandColor: sender
  97. {
  98.     [object secondHandColor: [sender color]];
  99.     return [self ok:nil];
  100. }
  101.     
  102.  
  103. @end