home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 17 / CD_ASCQ_17_101194.iso / vrac / ve2tv103.zip / TVCOLR.H < prev    next >
C/C++ Source or Header  |  1994-05-27  |  7KB  |  164 lines

  1. // File    : TVCOLR.H
  2. // Author  : Eric Woodruff,  CIS ID: 72134,1150
  3. // Updated : Fri 05/27/94 20:08:39
  4. // Note    : Hereby declared public domain
  5. // Compiler: Borland C++ 3.1/4.0
  6. //
  7. // Easy extensions to the colors for Turbo Vision applications.
  8. // Complete documentation for this method can be found by downloading
  9. // TVCOLR.ZIP from the BCPPDOS forum of CompuServe.
  10. //
  11. // This copy contains fewer comments on how to add extended colors so
  12. // that you can get an uncluttered view of how it works.
  13. // See TVCOLR.HDC for a fully commented view of how it works.
  14. //
  15. // NOTE: If you modify this file, modify TVCOLR.HDC accordingly!!
  16. //
  17.  
  18. #if !defined( __TVCOLR_H )
  19. #define __TVCOLR_H
  20.  
  21. #if !defined(cpColor)
  22. #define  Uses_TProgram
  23. #include <tv.h>             // Get the standard colors defined.
  24. #endif
  25.  
  26. #if !defined(cHelpColor)
  27. class _FAR fpstream;
  28. #include <helpbase.h>       // Get the help colors defined.
  29. #endif
  30.  
  31. // An alternate color palette attributes map.
  32. // I have added two colors to TButton and one color to TLabel for when those
  33. // objects are selected that the default Turbo Vision doesn't have.  If the
  34. // definition MODIFIED_TV_COLORS appears in APP.H, then those three extra
  35. // colors will be defined here.
  36.  
  37. #if defined(MODIFIED_TV_COLORS)
  38.  
  39. #define cpAltColor \
  40.     "\x07\x70\x76\x74\x17\x08\x1B\x07\x03\x0B\x70\x70\x07\x70" \
  41.     "\x00\x37\x3F\x3A\x13\x13\x3F\x1F\x00\x70\x7F\x7A\x13\x13" \
  42.     "\x70\x7F\x00\x70\x7F\x7A\x13\x13\x70\x70\x6F\x7E\x1B\x1F" \
  43.     "\x6F\x10\x1E\x70\x30\x3F\x3E\x1B\x4F\x1A\x20\x70\x07\x70" \
  44.     "\x30\x1B\x3E\x31\x13\x00\x00\x1D\x6E\x6E"
  45.  
  46. #else
  47.  
  48. #define cpAltColor \
  49.     "\x07\x70\x76\x74\x17\x08\x1B\x07\x03\x0B\x70\x70\x07\x70" \
  50.     "\x00\x37\x3F\x3A\x13\x13\x3F\x1F\x00\x70\x7F\x7A\x13\x13" \
  51.     "\x70\x7F\x00\x70\x7F\x7A\x13\x13\x70\x70\x6F\x7E\x1B\x1F" \
  52.     "\x6F\x10\x1E\x70\x30\x3F\x3E\x1B\x4F\x1A\x20\x70\x07\x70" \
  53.     "\x30\x1B\x3E\x31\x13\x00\x00"
  54.  
  55. #endif
  56.  
  57. // An Alternate Color help window attribute map.
  58. #define cAltHelpColor "\x67\x6F\x6E\x76\x76\x6F\x6E\x1E"
  59.  
  60. // Define any other palette names and the total number of available palettes.
  61. // For additional palettes, start numbering them at 3.  They must come
  62. // after the regular color, black and white, and monochrome sets because
  63. // apColor, apBlackWhite, and apMonochrome are defined as 0 through 2.
  64. #define apAltColor         3        // Alternate color palette.
  65.  
  66. #define apTotalPalettes    4        // Color, B&W, Monochrome, Alt. Color.
  67.  
  68. // Define the default extended color sets (regular colors + help colors).
  69. //
  70. // If the default TV colors have not been modified as described in
  71. // COLUPDT.DOC, some padding is added so that the indices below come out
  72. // the same regardless of this optional change.
  73. //
  74. #if defined(MODIFIED_TV_COLORS)
  75.  
  76. #define cpDefAltColor       cpAltColor cAltHelpColor
  77. #define cpDefColor          cpColor cHelpColor
  78. #define cpDefBlackWhite     cpBlackWhite cHelpBlackWhite
  79. #define cpDefMonochrome     cpMonochrome cHelpMonochrome
  80.  
  81. #else
  82.  
  83. #define cpDefAltColor       cpAltColor cAltHelpColor "\x07\x07\x07"
  84. #define cpDefColor          cpColor cHelpColor "\x07\x07\x07"
  85. #define cpDefBlackWhite     cpBlackWhite cHelpBlackWhite "\x07\x07\x07"
  86. #define cpDefMonochrome     cpMonochrome cHelpMonochrome "\x07\x07\x07"
  87.  
  88. #endif
  89.  
  90. // Define the default size.  Doesn't matter which one we use because they are
  91. // all the same size.
  92. #define cpDefSize           sizeof(cpDefColor) - 1  // Less 1 for the NULL!
  93.  
  94. // ****************************************************************************
  95. // ^^^^^^     NOTHING ABOVE THIS POINT WILL EVER CHANGE AND MUST NOT     ^^^^^^
  96. //                     (Unless you add more color palettes)
  97. // ****************************************************************************
  98. //
  99. // Extended color definitions:
  100. //
  101. // 1. TColorText additional color attributes.
  102. //
  103. #define cpColorTextAltColor   "\x1B\x1F\x4F\x4E"    // Alt color palette
  104. #define cpColorTextColor      "\x1B\x1F\x4F\x4E"    // Color palette
  105. #define cpColorTextBlackWhite "\x70\x7F\x07\x0F"    // B&W palette
  106. #define cpColorTextMonochrome "\x70\x01\x0F\x0F"    // Monochrome palette
  107.  
  108. // 2. Define the indices into the extended application palettes.
  109. //
  110. #define cCTxtInfoColor      cpDefSize + 1       // Information color
  111. #define cCTxtNotifyColor    cpDefSize + 2       // Notification color
  112. #define cCTxtWarnColor      cpDefSize + 3       // Warning color
  113. #define cCTxtErrorColor     cpDefSize + 4       // Error color
  114.  
  115. // ****************************************************************************
  116. // vvvvvv       Additional extended color definitions will go here       vvvvvv
  117. // ****************************************************************************
  118. // TMsgViewWindow and TMsgListViewer
  119.  
  120. #define cpMsgDlgAltColor   "\x48\x4E\x4F\x74\x74\x4F\x6E\x4E"
  121. #define cpMsgDlgColor      "\x48\x4E\x4F\x74\x74\x4F\x6E\x4E"
  122. #define cpMsgDlgBlackWhite "\x78\x7F\x7F\x70\x70\x70\x07\x7F"
  123. #define cpMsgDlgMonochrome "\x70\x70\x0F\x0F\x0F\x70\x0F\x01"
  124.  
  125. #define cMsgFramePassive    cCTxtErrorColor + 1   // Frame passive
  126. #define cMsgFrameActive     cCTxtErrorColor + 2   // Frame active
  127. #define cMsgFrameIcon       cCTxtErrorColor + 3   // Frame icons
  128. #define cMsgSBPage          cCTxtErrorColor + 4   // Scrollbar page
  129. #define cMsgSBCtrl          cCTxtErrorColor + 5   // Scrollbar controls
  130. #define cMsgNText           cCTxtErrorColor + 6   // Normal text
  131. #define cMsgSText           cCTxtErrorColor + 7   // Selected/Focused text
  132. #define cMsgSelected        cCTxtErrorColor + 8   // Selected (inactive) text
  133.  
  134. // TVMIndicator
  135. #define cpIndAltColor      "\x60\x7F"
  136. #define cpIndColor         "\x30\x7F"
  137. #define cpIndBlackWhite    "\x70\x70"
  138. #define cpIndMonochrome    "\x70\x70"
  139.  
  140. #define cIndEditWin        cMsgSelected + 1       // For Edit Windows
  141. #define cIndMemoFld        cMsgSelected + 2       // For Memo Fields
  142.  
  143. // ****************************************************************************
  144. // ^^^^^^       ALWAYS ADD ANY NEW DEFINITIONS JUST ABOVE THIS LINE      ^^^^^^
  145. // ****************************************************************************
  146. //
  147. // 3. Define the full extended color sets.
  148. //    NOTE: THESE DEFINES SHOULD ALWAYS BE HERE AT THE BOTTOM AND NOWHERE ELSE!
  149. // ****************************************************************************
  150.  
  151. #define cpExtAltColor       cpDefAltColor cpColorTextAltColor \
  152.                             cpMsgDlgAltColor cpIndAltColor
  153.  
  154. #define cpExtColor          cpDefColor cpColorTextColor cpMsgDlgColor \
  155.                             cpIndColor
  156.  
  157. #define cpExtBlackWhite     cpDefBlackWhite cpColorTextBlackWhite \
  158.                             cpMsgDlgBlackWhite cpIndBlackWhite
  159.  
  160. #define cpExtMonochrome     cpDefMonochrome cpColorTextMonochrome \
  161.                             cpMsgDlgMonochrome cpIndMonochrome
  162.  
  163. #endif // __TVCOLR_H
  164.