home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / p / prbgi097.zip / C.ZIP / TV2.H < prev    next >
C/C++ Source or Header  |  1992-12-15  |  4KB  |  120 lines

  1. #ifndef __TV2__H
  2. #define __TV2__H
  3.  
  4. #define Uses_TInputLine
  5. #define Uses_TLabel
  6. #define Uses_TSItem
  7. #define Uses_TListBox
  8. #define Uses_TButton
  9. #define Uses_TView
  10. #define Uses_TDialog
  11. #define Uses_TWidonw
  12. #define Uses_TWidonwInit
  13. #define Uses_TCollection
  14. #include <tv.h>
  15.  
  16.  
  17. const int cmEnumChange = 2041;
  18.  
  19. /*====================================*/
  20. class TInput_float: public  TInputLine
  21. /*====================================*/
  22.       {
  23.          public:
  24.          virtual ushort dataSize();
  25.          virtual void   getData(void *rec);
  26.          virtual void   setData(void *rec);
  27.          TInput_float (const TRect& bounds, int aMaxLen):
  28.                TInputLine(bounds,aMaxLen) {};
  29. //         ~TInput_float ();
  30.       };
  31.  
  32. // The only reason to create following class is to make protected
  33. // field count of TCollection accessible
  34. /*====================================*/
  35. class TCollection2 : public TCollection
  36. /*====================================*/
  37. {
  38. public:
  39.   TCollection2( ccIndex aLimit, ccIndex aDelta ):
  40.         TCollection( aLimit, aDelta ) {};
  41.   ccIndex size() { return count; };
  42.     virtual void *readItem( ipstream& is) = 0;
  43.     virtual void writeItem( void *obj, opstream& os) = 0;
  44. };
  45.  
  46.  
  47. /*====================================*/
  48. class TStrCollection : public TCollection2
  49. /*====================================*/
  50. {
  51. public:
  52.     TStrCollection( short aLimit, short aDelta ):
  53.                   TCollection2(aLimit, aDelta) {};
  54. private:
  55.     virtual void freeItem( void *item )
  56.     { if (item!=NULL) delete item; }
  57.  
  58.     // virtual const char *streamableName() const
  59.     //    { return name; }
  60.     virtual void *readItem( ipstream& is)
  61.     {  return is.readString(); }
  62.     virtual void writeItem( void *obj, opstream& os)
  63.     {  os.writeString( (const char *)obj ); }
  64. //protected:
  65. //    TStringCollection( StreamableInit ) : TSortedCollection ( streamableInit ) {};
  66. //public:
  67. //    static const char * const near name;
  68. //    static TStreamable *build();
  69. };
  70.  
  71.  
  72.  
  73. /*==============================*/
  74. class TDialogDbl: public TDialog
  75. /*==============================*/
  76. {
  77.    public:
  78.    //TWindowInit::TWindowInit ( TFrame *(*cFrame)( TRect ) ):
  79.    // TWindowInit( cFrame ) {};
  80.    TDialogDbl (const TRect& bounds, const char* aTitle):
  81.               TDialog (bounds, aTitle),
  82.               TWindowInit( &TDialog::initFrame )
  83.                {};
  84.    virtual void handleEvent(TEvent& event);
  85. };
  86.  
  87. /*===================================*/
  88. class TEnumArrow : public TStaticText
  89. /*===================================*/
  90. {
  91.     TView *Link;
  92. public:
  93.     TEnumArrow( const TRect& bounds, const char *aTitle,
  94.                 TView *aLink );
  95.     virtual void handleEvent( TEvent& event );
  96.     virtual TPalette& getPalette() const;
  97.     // virtual void shutDown();
  98. };
  99.  
  100.  
  101. /*=================================*/
  102. class TEnumValue : public TInputLine
  103. /*=================================*/
  104. {
  105. public:
  106.     TCollection2  *List;
  107.     ccIndex       focusedItem;
  108.     TEnumValue( const TRect& bounds, int aMaxLen );
  109.     // ~TEnumValue();
  110.     virtual void newFocusedItem( ccIndex newItem );
  111.     virtual void newList ( TCollection2 *aList, ccIndex focusedNo );
  112.     virtual void handleEvent( TEvent& event );
  113.     virtual void MakeSelection();
  114.     virtual ushort dataSize() { return sizeof(ccIndex); };
  115.     virtual void   getData(void *rec);
  116.     virtual void   setData(void *rec);
  117.     // virtual void shutDown();
  118. };
  119.  
  120. #endif // __TV2__H