home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.mdf / SourceCode / Palettes / Calendar / UsingCalendarPalette / Calendar.h < prev    next >
Encoding:
Text File  |  1993-01-18  |  2.5 KB  |  84 lines

  1. //----------------------------------------------------------------------------------------------------
  2. //
  3. //    Calendar
  4. //
  5. //    Inherits From:        Control
  6. //
  7. //    Declared In:        Calendar.h
  8. //
  9. //    Class Description
  10. //
  11. //        Calendar is a simple Control subclass that provides a UI
  12. //        widget for presenting and selecting dates in a calendar form.
  13. //        Subclassing from Control allows target/action manipulation
  14. //        via IB (this class has been palettized and provides IB friendly
  15. //        methods).  An action is sent to a target when a day is selected
  16. //        within the calendar day matrix (this matrix does allow an empty
  17. //        selection also resulting in an action send).  As with all controls
  18. //        you may enable/disable.  
  19. //
  20. //        Month, day, and year instance variables take an int argument.
  21. //        Valid values for month are 1 -12, where January = 1.  Valid
  22. //        values for day are 0, 1 - (last day of month), where 0 indicates
  23. //        an empty selection.  Valid values for year are 1 - 9999. 
  24. //
  25. //
  26. //    Disclaimer
  27. //
  28. //        You may freely copy, distribute and reuse this software and its
  29. //        associated documentation. I disclaim any warranty of any kind, 
  30. //        expressed or implied, as to its fitness for any particular use.
  31. //
  32. //----------------------------------------------------------------------------------------------------
  33. #import <appkit/appkit.h>
  34. #import <sys/time.h>    
  35.  
  36.  
  37. @interface Calendar : Control
  38. {
  39.     int        month;
  40.     int        day;
  41.     int        year;
  42.  
  43. @private
  44.     id        monthTextField, dayMatrix, yearTextField, weekdayTextField;
  45.     BOOL    isEnabled;
  46. }
  47.  
  48.  
  49. //----------------------------------------------------------------------------------------------------
  50. //    Accessors
  51. //----------------------------------------------------------------------------------------------------
  52. - month: (int) aMonth;
  53. - day: (int)aDay;
  54. - year: (int) aYear;
  55.  
  56. - (const char*) monthStringValue;
  57. - (const char*) dayStringValue;
  58. - (const char*) yearStringValue;
  59. - (const char*) dayOfWeekStringValue;
  60. - (const char*) dateStringValue;
  61.  
  62. - (int) monthIntValue;
  63. - (int) dayIntValue;
  64. - (int) yearIntValue;
  65. - (int) dayOfWeekIntValue;
  66.  
  67.  
  68. //----------------------------------------------------------------------------------------------------
  69. //    Action Methods
  70. //----------------------------------------------------------------------------------------------------
  71. - incrementMonth: sender;
  72. - decrementMonth: sender;
  73.  
  74. - incrementYear: sender;
  75. - decrementYear: sender;
  76.  
  77. - takeMonthIntValueFrom: sender;
  78. - takeDayIntValueFrom: sender;
  79. - takeYearIntValueFrom: sender;
  80.  
  81. - showSystemDate: sender;
  82.  
  83.  
  84. @end