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

  1. /*-------------------------------------------------------*/
  2. /*                                                       */
  3. /*   Turbo Vision 1.0                                    */
  4. /*   Copyright (c) 1991 by Borland International         */
  5. /*                                                       */
  6. /*   Ascii.h: Header file for Ascii.cpp                  */
  7. /*-------------------------------------------------------*/
  8.  
  9. #if !defined( __ASCII_H )
  10. #define __ASCII_H
  11.  
  12. const int cmAsciiTableCmdBase = 910;
  13. const int cmCharFocused       =   0;
  14.  
  15.  
  16. class TTable : public TView
  17. {
  18.  
  19. public:
  20.  
  21.     TTable( TRect& r );
  22.     TTable( StreamableInit ) : TView(streamableInit) { };
  23.     virtual void draw();
  24.     virtual void handleEvent( TEvent& event );
  25.     void charFocused();
  26.  
  27. private:
  28.  
  29.     virtual const char *streamableName() const
  30.         { return name; }
  31.  
  32. protected:
  33.  
  34.     virtual void write( opstream& );
  35.     virtual void *read( ipstream& );
  36.  
  37. public:
  38.  
  39.     static const char * const name;
  40.     static TStreamable *build();
  41.  
  42. };
  43.  
  44.  
  45. inline ipstream& operator >> ( ipstream& is, TTable& cl )
  46.     { return is >> (TStreamable&) cl; }
  47. inline ipstream& operator >> ( ipstream& is, TTable*& cl )
  48.     { return is >> (void *&) cl; }
  49.  
  50. inline opstream& operator << ( opstream& os, TTable& cl )
  51.     { return os << (TStreamable&) cl; }
  52. inline opstream& operator << ( opstream& os, TTable* cl )
  53.     { return os << (TStreamable *) cl; }
  54.  
  55.  
  56. class TReport : public TView
  57. {
  58.  
  59. public:
  60.  
  61.     TReport( TRect& r );
  62.     TReport( StreamableInit ) : TView(streamableInit) { };
  63.     virtual void draw();
  64.     virtual void handleEvent( TEvent& event );
  65.  
  66. private:
  67.  
  68.     long asciiChar;
  69.  
  70.     virtual const char *streamableName() const
  71.     { return name; }
  72.  
  73. protected:
  74.  
  75.     virtual void write( opstream& );
  76.     virtual void *read( ipstream& );
  77.  
  78. public:
  79.  
  80.     static const char * const name;
  81.     static TStreamable *build();
  82.  
  83. };
  84.  
  85. inline ipstream& operator >> ( ipstream& is, TReport& cl )
  86.     { return is >> (TStreamable&) cl; }
  87. inline ipstream& operator >> ( ipstream& is, TReport*& cl )
  88.     { return is >> (void *&) cl; }
  89.  
  90. inline opstream& operator << ( opstream& os, TReport& cl )
  91.     { return os << (TStreamable&) cl; }
  92. inline opstream& operator << ( opstream& os, TReport* cl )
  93.     { return os << (TStreamable *) cl; }
  94.  
  95.  
  96. class TAsciiChart : public TWindow
  97. {
  98.  
  99. public:
  100.  
  101.     TAsciiChart();
  102.     TAsciiChart( StreamableInit ) : TWindow(streamableInit),
  103.                     TWindowInit(&initFrame) { };
  104.  
  105. private:
  106.  
  107.     virtual const char *streamableName() const
  108.     { return name; }
  109.  
  110. protected:
  111.  
  112.     virtual void write( opstream& );
  113.     virtual void *read( ipstream& );
  114.  
  115. public:
  116.  
  117.     static const char * const name;
  118.     static TStreamable *build();
  119.  
  120. };
  121.  
  122. inline ipstream& operator >> ( ipstream& is, TAsciiChart& cl )
  123.     { return is >> (TStreamable&) cl; }
  124. inline ipstream& operator >> ( ipstream& is, TAsciiChart*& cl )
  125.     { return is >> (void *&) cl; }
  126.  
  127. inline opstream& operator << ( opstream& os, TAsciiChart& cl )
  128.     { return os << (TStreamable&) cl; }
  129. inline opstream& operator << ( opstream& os, TAsciiChart* cl )
  130.     { return os << (TStreamable *) cl; }
  131.  
  132.  
  133. #endif      // __ASCII_H
  134.