home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 26 / CD_ASCQ_26_1295.iso / vrac / tvme30.zip / TVCOLR.TV2 < prev    next >
Text File  |  1995-08-02  |  8KB  |  165 lines

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