SkinColors.h
上传用户:weijiexitu
上传日期:2007-01-18
资源大小:54k
文件大小:2k
源码类别:

菜单

开发平台:

WINDOWS

  1. // SkinColors.h: interface for the CSkinColors class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_SKINCOLORS_H__CC5BF634_6783_41C7_9CE6_321CCB130425__INCLUDED_)
  5. #define AFX_SKINCOLORS_H__CC5BF634_6783_41C7_9CE6_321CCB130425__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. // color mapping
  10. struct ColorItem { LPCTSTR szName; int nColor; };
  11. // new colors
  12. enum
  13. {
  14. COLOR_PARENTBKGND = 0x00ff,
  15. COLOR_LAST,
  16. };
  17. static ColorItem colorMap[] = 
  18. {
  19. { _T("SCROLLBAR"), COLOR_SCROLLBAR },
  20. { _T("BACKGROUND"), COLOR_BACKGROUND },
  21. { _T("ACTIVECAPTION"), COLOR_ACTIVECAPTION },
  22. { _T("INACTIVECAPTION"), COLOR_INACTIVECAPTION },
  23. { _T("MENU"), COLOR_MENU },
  24. { _T("WINDOW"), COLOR_WINDOW },
  25. { _T("WINDOWFRAME"), COLOR_WINDOWFRAME },
  26. { _T("MENUTEXT"), COLOR_MENUTEXT },
  27. { _T("WINDOWTEXT"), COLOR_WINDOWTEXT },
  28. { _T("CAPTIONTEXT"), COLOR_CAPTIONTEXT },
  29. { _T("ACTIVEBORDER"), COLOR_ACTIVEBORDER },
  30. { _T("INACTIVEBORDER"), COLOR_INACTIVEBORDER },
  31. { _T("APPWORKSPACE"), COLOR_APPWORKSPACE },
  32. { _T("HIGHLIGHT"), COLOR_HIGHLIGHT },
  33. { _T("HIGHLIGHTTEXT"), COLOR_HIGHLIGHTTEXT },
  34. { _T("BTNFACE"), COLOR_BTNFACE },
  35. { _T("BTNSHADOW"), COLOR_BTNSHADOW },
  36. { _T("GRAYTEXT"), COLOR_GRAYTEXT },
  37. { _T("BTNTEXT"), COLOR_BTNTEXT },
  38. { _T("INACTIVECAPTIONTEXT"), COLOR_INACTIVECAPTIONTEXT },
  39. { _T("BTNHIGHLIGHT"), COLOR_BTNHIGHLIGHT },
  40. { _T("3DDKSHADOW"), COLOR_3DDKSHADOW },
  41. { _T("3DLIGHT"), COLOR_3DLIGHT },
  42. { _T("INFOTEXT"), COLOR_INFOTEXT },
  43. { _T("INFOBK"), COLOR_INFOBK },
  44. #ifndef _WIN32_WCE
  45. #if(WINVER >= 0x0500) // xp
  46. { _T("HOTLIGHT"), COLOR_HOTLIGHT },
  47. { _T("GRADIENTACTIVECAPTION"), COLOR_GRADIENTACTIVECAPTION },
  48. { _T("GRADIENTINACTIVECAPTION"), COLOR_GRADIENTINACTIVECAPTION },
  49. #endif /* WINVER >= 0x0500 */
  50. #endif
  51. { _T("DESKTOP"), COLOR_DESKTOP },
  52. { _T("3DFACE"), COLOR_3DFACE },
  53. { _T("3DSHADOW"), COLOR_3DSHADOW },
  54. { _T("3DHIGHLIGHT"), COLOR_3DHIGHLIGHT }, 
  55. { _T("3DHILIGHT"), COLOR_3DHILIGHT },
  56. #ifndef _WIN32_WCE
  57. { _T("BTNHILIGHT"), COLOR_BTNHILIGHT },
  58. #endif
  59. // new colors
  60. { _T("PARENTBKGND"), COLOR_PARENTBKGND },
  61. };
  62. const int NUM_COLORS = sizeof(colorMap) / sizeof(ColorItem);
  63. static LPCTSTR GetColorName(int nColor)
  64. {
  65. int nCount = NUM_COLORS;
  66. while (nCount--)
  67. {
  68. if (colorMap[nCount].nColor == nColor)
  69. return colorMap[nCount].szName;
  70. }
  71. return NULL;
  72. }
  73. #endif // !defined(AFX_SKINCOLORS_H__CC5BF634_6783_41C7_9CE6_321CCB130425__INCLUDED_)