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 / TVBGI.H < prev    next >
C/C++ Source or Header  |  1992-12-15  |  3KB  |  113 lines

  1. /*---------------------------------------------------------*/
  2. /*                                                         */
  3. /*   Turbo Vision 1.0                                      */
  4. /*   Turbo Vision BGI Support Demo Header File             */
  5. /*   Copyright (c) 1991 by Borland International           */
  6. /*                                                         */
  7. /*---------------------------------------------------------*/
  8.  
  9. #if !defined( __TVBGI_H )
  10. #define __TVBGI_H
  11.  
  12. #define Uses_TApplication
  13. #define Uses_TMenuBar
  14. #define Uses_TStatusLine
  15. #include <tv.h>
  16. #include "tv2.h"
  17.  
  18. const
  19.    MAXSIZE = 150,
  20.    MAXPATH = 80;
  21.  
  22. const
  23.    cmNewWin       = 1000,
  24.    cmGraphOptions = 1002,
  25.    // cmDoGraphics   = 1003,
  26.  
  27.    cmReportStatus       = 4004,
  28.    cmBar3DDemo          = 4005,
  29.    cmRandomBars         = 4006,
  30.    cmColorDemo          = 4007,
  31.    cmArcDemo            = 4008,
  32.    cmCircleDemo         = 4009,
  33.    cmPieDemo            = 4010,
  34.    cmBarDemo            = 4011,
  35.    cmLineRelDemo        = 4012,
  36.    cmPutPixelDemo       = 4013,
  37.    cmPutImageDemo       = 4014,
  38.    cmLineToDemo         = 4015,
  39.    cmLineStyleDemo      = 4016,
  40.    cmUserLineStyleDemo  = 4017,
  41.    cmFillStyleDemo      = 4018,
  42.    cmFillPatternDemo    = 4019,
  43.    cmPolyDemo           = 4020;
  44.  
  45. const
  46.    hlChangeDir  = cmChangeDir,        // History list ID
  47.    hlSetBGIPath = 4002;       // History list ID
  48.  
  49. const int hcGraphBuild = 0xFFFE,
  50.           hcGraphPrint = 0xFFFF;
  51.  
  52. class TBGIApp : public TApplication
  53. {
  54. public:
  55.  
  56.     TBGIApp();
  57.     virtual ~TBGIApp();
  58.  
  59.     virtual void handleEvent( TEvent& Event );
  60.     static TMenuBar *initMenuBar( TRect );
  61.     static TStatusLine *initStatusLine( TRect );
  62.     virtual void outOfMemory();
  63.     void newWin();
  64.     void doGraphics(int far func(void far * UserPointer), void far* UserPointer);
  65.     void SetGraphOptions();
  66.     void changeDir();
  67.     void tile();
  68.     void cascade();
  69.  
  70.     int appDriver;
  71.     int appMode;
  72.     struct { char bgiPath[MAXPATH];
  73.              char PrintDest[MAXPATH];
  74.              float  PicWidth,PicHeight;
  75.              int    Preview,StdBGI;
  76.              ccIndex PrinterNo,PRTModeNo;
  77.            } Options;
  78. };
  79.  
  80. class TEnumMode;
  81. class TEnumPrinter: public TEnumValue
  82. {
  83.    public:
  84.    TEnumMode *EnumM;
  85.    TEnumPrinter(const TRect& bounds );
  86.    virtual void newFocusedItem( ccIndex newItem );
  87. };
  88.  
  89. class TEnumMode: public TEnumValue
  90. {
  91.    const TEnumPrinter *EnumP;
  92.    public:
  93.    TEnumMode ( const TRect& bounds, const TEnumPrinter *EP );
  94.    virtual void MakeSelection();
  95.    Boolean setModes(Boolean errMsg);
  96. };
  97.  
  98.  
  99. extern Boolean graphActive;
  100. extern void    *driverPtr;
  101. extern unsigned int driverSize;
  102. extern char  emptyString[];
  103. //extern char *bgiPath;
  104. extern int driver;
  105. extern int mode;
  106.  
  107. extern Boolean graphAppInit( int, int, char *, Boolean);
  108. extern void graphAppDone();
  109. extern Boolean graphicsStart();
  110. extern void graphicsStop();
  111.  
  112. #endif  // __TVBGI_H
  113.