home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 2.ddi / TVDEMOS.ZIP / CALENDAR.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  2.4 KB  |  90 lines

  1. /*-------------------------------------------------------*/
  2. /*                                                       */
  3. /*   Turbo Vision 1.0                                    */
  4. /*   Copyright (c) 1991 by Borland International         */
  5. /*                                                       */
  6. /*   Calendar.h: Header file for Calendar.cpp            */
  7. /*-------------------------------------------------------*/
  8.  
  9. #if !defined( __CALENDAR_H )
  10. #define __CALENDAR_H
  11.  
  12. class TCalendarView : public TView
  13. {
  14.  
  15. public:
  16.  
  17.     TCalendarView(TRect & r);
  18.     TCalendarView( StreamableInit ) : TView(streamableInit) { };
  19.     virtual void handleEvent(TEvent& event);
  20.     virtual void draw();
  21.  
  22. private:
  23.  
  24.     unsigned days, month, year;
  25.     unsigned curDay, curMonth, curYear;
  26.  
  27.     virtual const char *streamableName() const
  28.         { return name; }
  29.  
  30. protected:
  31.  
  32.     virtual void write( opstream& );
  33.     virtual void *read( ipstream& );
  34.  
  35. public:
  36.  
  37.     static const char * const name;
  38.     static TStreamable *build();
  39. };
  40.  
  41. inline ipstream& operator >> ( ipstream& is, TCalendarView& cl )
  42.     { return is >> (TStreamable&) cl; }
  43. inline ipstream& operator >> ( ipstream& is, TCalendarView*& cl )
  44.     { return is >> (void *&) cl; }
  45.  
  46. inline opstream& operator << ( opstream& os, TCalendarView& cl )
  47.     { return os << (TStreamable&) cl; }
  48. inline opstream& operator << ( opstream& os, TCalendarView* cl )
  49.     { return os << (TStreamable *) cl; }
  50.  
  51.  
  52. class TCalendarWindow : public TWindow
  53. {
  54.  
  55. public:
  56.  
  57.     TCalendarWindow();
  58.     TCalendarWindow( StreamableInit ) :
  59.         TWindow(streamableInit), TWindowInit(&TCalendarWindow::initFrame) { };
  60.  
  61. private:
  62.  
  63.     virtual const char *streamableName() const
  64.         { return name; }
  65.  
  66. protected:
  67.  
  68.     virtual void write( opstream& );
  69.     virtual void *read( ipstream& );
  70.  
  71. public:
  72.  
  73.     static const char * const name;
  74.     static TStreamable *build();
  75.  
  76. };
  77.  
  78. inline ipstream& operator >> ( ipstream& is, TCalendarWindow& cl )
  79.     { return is >> (TStreamable&) cl; }
  80. inline ipstream& operator >> ( ipstream& is, TCalendarWindow*& cl )
  81.     { return is >> (void *&) cl; }
  82.  
  83. inline opstream& operator << ( opstream& os, TCalendarWindow& cl )
  84.     { return os << (TStreamable&) cl; }
  85. inline opstream& operator << ( opstream& os, TCalendarWindow* cl )
  86.     { return os << (TStreamable *) cl; }
  87.  
  88.  
  89. #endif      // __CALENDAR_H
  90.