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

  1. //----------------------------------------------------------------------------------------------------
  2. //
  3. //    CalendarClockInspector
  4. //
  5. //    Inherits From:        ClockInspector
  6. //
  7. //    Declared In:        CalendarClockInspector.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 "CalendarClockInspector.h"
  17. #import "CalendarClock.h"
  18.  
  19.  
  20. @implementation CalendarClockInspector
  21.  
  22. //----------------------------------------------------------------------------------------------------
  23. //    Private Methods
  24. //----------------------------------------------------------------------------------------------------
  25. + (const char*) _nib
  26. {
  27.     return "CalendarClockInspector";
  28. }
  29.  
  30.  
  31. - _validateOptions
  32. {
  33.     if ([[options findCellWithTag: 0] state])
  34.         {
  35.         [[options findCellWithTag:1] setEnabled: YES];
  36.         [[options findCellWithTag:2] setEnabled: YES];
  37.         [[options findCellWithTag:3] setEnabled: YES];
  38.         }
  39.     else
  40.         {
  41.         [[options findCellWithTag:1] setEnabled: NO];
  42.         [[options findCellWithTag:2] setEnabled: NO];
  43.         [[options findCellWithTag:3] setEnabled: NO];
  44.         }
  45.  
  46.     return self;
  47. }
  48.     
  49.  
  50. //----------------------------------------------------------------------------------------------------
  51. //    Reverting Attributes
  52. //----------------------------------------------------------------------------------------------------
  53. - revertOptions
  54. {
  55.     [[options findCellWithTag:0] setState:[object isDisplayEnabled]];
  56.     [[options findCellWithTag:1] setState:[object wantsSeconds]];
  57.     [[options findCellWithTag: 2] setState:[object wantsYear]];
  58.     [[options findCellWithTag: 3] setState:[object wantsMilitaryTime]];
  59.     [[options findCellWithTag: 4] setState:[object isDraggable]];
  60.     [[options findCellWithTag: 5] setState:[object willAcceptDrop]];
  61.     [[options findCellWithTag: 6] setState:[object _timerMode]];
  62.     [[options findCellWithTag: 7] setState:[object activateOnAwake]];
  63.     [self _validateOptions];
  64.     return self;
  65. }
  66.  
  67.  
  68. - revertDisplay
  69. {
  70.     [colorOrImage selectCellWithTag: [object _backgroundIsColor]];
  71.     [backgroundImage image: [object backgroundImage]];
  72.     [backgroundColor setColor: [object backgroundColor]];
  73.     [timecolor setColor: [object timeColor]];
  74.     [datecolor setColor: [object dateColor]];
  75.     [weekdaycolor setColor: [object weekdayColor]];
  76.     [monthcolor setColor: [object monthColor]];
  77.     return self;
  78. }
  79.     
  80.  
  81. //----------------------------------------------------------------------------------------------------
  82. //    Setting Attributes
  83. //----------------------------------------------------------------------------------------------------
  84. - setClockOptions: sender
  85. {
  86.     [object setDisplayEnabled: [[options findCellWithTag:0] state]];
  87.     [object wantsSeconds: [[options findCellWithTag:1] state]];
  88.     [object wantsYear: [[options findCellWithTag:2] state]];
  89.     [object wantsMilitaryTime: [[options findCellWithTag:3] state]];
  90.     [object isDraggable: [[options findCellWithTag:4] state]];
  91.     [object willAcceptDrop: [[options findCellWithTag:5] state]];
  92.     [object _timerMode: [[options findCellWithTag:6] state]];
  93.     [object activateOnAwake: [[options findCellWithTag:7] state]];
  94.     [self _validateOptions];
  95.     return [self ok:nil];
  96. }
  97.  
  98.  
  99. - setTimeColor: sender
  100. {
  101.     [object timeColor: [sender color]];
  102.     return [self ok:nil];
  103. }
  104.     
  105.  
  106. - setDateColor: sender
  107. {
  108.     [object dateColor: [sender color]];
  109.     return [self ok:nil];
  110. }
  111.  
  112.  
  113. - setWeekdayColor: sender
  114. {
  115.     [object weekdayColor: [sender color]];
  116.     return [self ok:nil];
  117. }
  118.     
  119.  
  120. - setMonthColor: sender
  121. {
  122.     [object monthColor: [sender color]];
  123.     return [self ok:nil];
  124. }
  125.  
  126.  
  127. @end