home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / PROG_GEN / TVCOLR.ZIP / DEMO.H < prev    next >
C/C++ Source or Header  |  1994-02-08  |  3KB  |  106 lines

  1. // File    : DEMO.H
  2. // Author  : Eric Woodruff,  CIS ID: 72134,1150
  3. // Updated : Tue 02/08/94 10:27:36
  4. // Note    : Hereby declared public domain
  5. // Compiler: Borland C++ 3.1/4.0
  6. //
  7. // Header file for the TVCOLR modifications demo.
  8. //
  9.  
  10. // Miscellaneous definitions.
  11.  
  12. const int
  13.     cmAbout         = 100,      // Standard event values.
  14.     cmRepaint       = 101,
  15.     cmDOSshell      = 102,
  16.     cmColors        = 103,
  17.     cmChangePalettes = 104,
  18.     cmLoadCfg       = 105,
  19.     cmSaveCfg       = 106,
  20.     cmCloseTileable = 107,
  21.     cmScreenSize    = 108,
  22.     cmUserScreen    = 109,
  23.  
  24.     cmBlueWindow   = 110,       // Other command values.
  25.     cmGrayWindow   = 111,
  26.     cmCyanWindow   = 112,
  27.     cmDialogBox    = 113,
  28.     cmHelpWindow   = 114,
  29.     cmMakeStrings  = 115;
  30.  
  31. #if defined(Uses_DemoApp)
  32.  
  33. // Exit code values.
  34. #define EXIT_NOERR      0
  35. #define EXIT_RSCERR     1
  36. #define EXIT_SYNTAX     2
  37. #define EXIT_SWERR      3
  38.  
  39. class far TDeskTop;
  40. class far TDialog;
  41. class far TEvent;
  42. class far TMenuBar;
  43. class far TStatusLine;
  44. class far TPalette;
  45. //class far THeapView;
  46. class far TDemoHelpWindow;
  47.  
  48. // Class declarations.
  49. class TDemoApp : public TApplication
  50. {
  51. public:
  52.     TDemoApp(void);
  53.     static TMenuBar *initMenuBar(TRect r);
  54.     static TStatusLine *initStatusLine(TRect r);
  55.     static TDeskTop *initDeskTop(TRect r);
  56.  
  57.     virtual void initScreen();                  // Sets correct palette.
  58.     virtual void idle(void);
  59.     virtual void handleEvent(TEvent& Event);
  60.     virtual void outOfMemory(void);
  61.     virtual TPalette& getPalette() const;
  62.  
  63.     void loadConfig(Boolean UseFileSetting);
  64.     void saveConfig(void);
  65.  
  66. // ***************************************************************************
  67.     TWindow *createDemoWindow(char *aTitle);
  68.     TDemoHelpWindow *createDemoHelpWindow(void);
  69. };
  70.  
  71. // A couple of useful functions.
  72. ushort execDialog(TDialog *d, void *data);
  73. Boolean isTileable(TView *p, void *);
  74.  
  75. // ***************************************************************************
  76. // Interior class for displaying window colors.
  77. class TInterior : public TView
  78. {
  79. public:
  80.     TInterior(TRect &r) : TView(r) {};
  81.     virtual void draw(void);
  82. };
  83.  
  84. // Window for demonstrating the help window colors to insure they are
  85. // still in the right place.
  86. class TDemoHelpWindow : public TWindow
  87. {
  88. public:
  89.     TDemoHelpWindow(TRect &r) :
  90.        TWindow(r, "Help Window", wnNoNumber),
  91.        TWindowInit( &TDemoHelpWindow::initFrame) {};
  92.  
  93.     virtual TPalette& getPalette() const;
  94. };
  95.  
  96. // Interior class for displaying help window colors.
  97. class THelpInterior : public TView
  98. {
  99. public:
  100.     THelpInterior(TRect &r) : TView(r) {};
  101.     virtual void draw(void);
  102.     virtual TPalette& getPalette() const;
  103. };
  104.  
  105. #endif
  106.