home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / grafik / mgl11 / demo / demo.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-09  |  2.3 KB  |  94 lines

  1. /****************************************************************************
  2. *
  3. *                    Demo - Demonstration Program for the
  4. *                        MegaGraph Graphics Library
  5. *
  6. *                    Copyright (C) 1994 SciTech Software.
  7. *                            All rights reserved.
  8. *
  9. * Filename:        $RCSfile: demo.hpp $
  10. * Version:        $Revision: 1.2 $
  11. *
  12. * Language:        C++ 3.0
  13. * Environment:    any
  14. *
  15. * Description:    Header file for the demo program's main class.
  16. *
  17. * $Id: demo.hpp 1.2 1994/03/09 11:29:32 kjb release $
  18. *
  19. ****************************************************************************/
  20.  
  21. #ifndef    __DEMO_HPP
  22. #define    __DEMO_HPP
  23.  
  24. #ifndef    __MVISION_HPP
  25. #include "mvision.hpp"
  26. #endif
  27.  
  28. #ifndef    __TPROGRAM_HPP
  29. #include "tprogram.hpp"
  30. #endif
  31.  
  32. #ifndef    __TMENU_HPP
  33. #include "tmenubar.hpp"
  34. #endif
  35.  
  36. /*------------------------------ Constants --------------------------------*/
  37.  
  38. // Application command codes
  39.  
  40. const ushort
  41.  
  42.     cmNextDemo            = 1000,            // Move onto next demo
  43.     cmPrevDemo            = 1001,            // Move back to prev demo
  44.     cmAutoDemo            = 1002,            // Toggle automatic operation
  45.     cmSetExplanation    = 1003,            // Set the explanation window text
  46.     cmSetDemoTitle        = 1004,            // Set the demo title text
  47.  
  48. // Menu command codes
  49.  
  50.     cmAbout                = 100,            // Bring up the about box
  51.     cmVideoMode            = 101,            // Change the current video mode
  52.     cmLineDemo            = 102,
  53.     cmEllipseDemo        = 103,
  54.     cmArcDemo            = 104,
  55.     cmPolygonDemo        = 105,
  56.     cmRectangleDemo        = 106,
  57.     cmColorDemo            = 107,
  58.     cmMarkerDemo        = 108,
  59.     cmPatternDemo        = 109,
  60.     cmFloodFillDemo        = 110,
  61.     cmAnimationDemo        = 111,
  62.     cmEmptyDemo            = 112;            // No demo to display
  63.  
  64. /*---------------------------- Global Variables ---------------------------*/
  65.  
  66. extern int forcedriver;
  67. extern int snowlevel;
  68.  
  69. /*-------------------------- Class definitions ----------------------------*/
  70.  
  71. class Demo : public TProgram {
  72. protected:
  73.  
  74.             // Method to change the video mode
  75.             void changeVideoMode();
  76.  
  77. public:
  78.             // Constructor
  79.             Demo();
  80.  
  81.             // Virtual destructor
  82.     virtual    ~Demo();
  83.  
  84.             // Virtual to handle an event
  85.     virtual    void handleEvent(TEvent& event,phaseType phase = phFocused);
  86.  
  87.             // Methods to create the menubar, status line and desktop etc
  88.     static    TMenuBar *initMenuBar(const TRect& bounds);
  89.     static    TDeskTop *initDeskTop(const TRect& bounds);
  90.     static    void initVideoMode(int& driver,int& mode);
  91.     };
  92.  
  93. #endif    // __DEMO_HPP
  94.