home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / tvision / colord / tdemo1.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-05  |  4.5 KB  |  121 lines

  1. /*-----------------------------------------------------------------------*/
  2. /* filename -       tdemo1.hpp                                           */
  3. /*                                                                       */
  4. /* function(s)                                                           */
  5. /*                  declarations for the TDemoApp class which            */
  6. /*                  demonstrates TVColorDialog                           */
  7. /*                                                                       */
  8. /* author -         Michael "Mick" Newton                                */
  9. /*                                                                       */
  10. /*-----------------------------------------------------------------------*/
  11.  
  12. /*-----------------------------------------------------------------------*/
  13. /*                                                                       */
  14. /*    TDEMO1.HPP                                                         */
  15. /*                                                                       */
  16. /*    TVColorDialog shareware version 2.0                                */
  17. /*    Copyright (C) 1992,1993 Comsoft Software                           */
  18. /*    All Rights Reserved.                                               */
  19. /*                                                                       */
  20. /*                                                                       */
  21. /*-----------------------------------------------------------------------*/
  22.  
  23.  
  24. #if !defined __TDEMO1_HPP
  25. #define __TDEMO1_HPP
  26.  
  27.  
  28. // Forward references to Turbo Vision classes *****************************
  29.  
  30. class far TApplication;
  31. class far TColorGroup;
  32. class far TDeskTop;
  33. class far TEvent;
  34. class far TMenuBar;
  35. class far TPalette;
  36. class far TRect;
  37. class far TStatusLine;
  38.  
  39.  
  40.  
  41.  
  42.  
  43. // Defines ****************************************************************
  44.  
  45. // Desktop pattern characters
  46. // NOTE: These are the actual ASCII codes for the characters which will
  47. //       be displayed as pattern character choices in TVColorDialog.
  48. //       You can modify the first 16 values to display different pattern
  49. //       character choices in the dialog. The last value however should
  50. //       not be changed because this string is accessed in the demo as a
  51. //       null terminated string.
  52. //
  53. #define patterns "\xB0\xB1\xB2\x20\xCE\xBE\xC5\xDB" \
  54.                  "\xD8\xD7\xDD\xD0\xDF\xFE\xC4\xB3" \
  55.                  "\x00"      // <--- Do not modify
  56.  
  57.  
  58.  
  59.  
  60. // Data struct for options dialog *****************************************
  61.  
  62. struct TOptionRec
  63. {
  64.    ushort addHelp;                // Include help checkbox
  65.    ushort patternCount;           // Pattern count radiobutton
  66.    ushort videoMode;              // Video mode radiobutton
  67. };
  68.  
  69.  
  70.  
  71.  
  72.  
  73. // TDemoApp ***************************************************************
  74.  
  75. class TDemoApp : public TApplication
  76. {
  77.    public:
  78.       TDemoApp();
  79.       virtual void shutDown();
  80.       static TStatusLine *initStatusLine(TRect r);
  81.       static TMenuBar *initMenuBar(TRect r);
  82.       static TDeskTop *initDeskTop(TRect r);
  83.       virtual TPalette& getPalette() const;
  84.       virtual void getEvent(TEvent& event);
  85.       virtual void handleEvent(TEvent& event);
  86.    protected:
  87.    private:
  88.       TOptionRec optrec;          // Options data record
  89.       ushort patternIndex;        // Current desktop pattern char index
  90.       void about();               // About dialog
  91.       void writePalette();        // Writes app's palette to file
  92.       TColorGroup &buildGroup1(); // Color group build function 1 of 5
  93.       TColorGroup &buildGroup2(); // Color group build function 2 of 5
  94.       TColorGroup &buildGroup3(); // Color group build function 3 of 5
  95.       TColorGroup &buildGroup4(); // Color group build function 4 of 5
  96.       TColorGroup &buildGroup5(); // Color group build function 5 of 5
  97.       void colors();              // Executes the TVColorDialog
  98.       void options();             // Executes the options dialog
  99.       void setVideoMode();        // Sets program video mode
  100.       void xdialog1();            // Executes a TXDialog1 dialog
  101.       void xdialog2();            // Executes a TXDialog2 dialog
  102.       void xdialog3();            // Executes a TXDialog3 dialog
  103.       void helpDialog();          // Notifies user if help button pressed
  104. };
  105.  
  106.  
  107.  
  108.  
  109.  
  110. // Non-member function declarations ***************************************
  111.  
  112. void exitfunc(void);
  113.  
  114.  
  115. #endif
  116.  
  117. //                                End of TDEMO1.HPP
  118.  
  119.  
  120.  
  121.