Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CExtGridCellColor - color/name mapping inconsistency Collapse All
Subject Author Date
Andrew Moulden Oct 8, 2007 - 3:42 PM

Hi,

I have a CExtGridCellColor in a property grid, and on initialization I am setting the color value to 7D9EC0, which maps to "LightBlue" in the preset color dropdown. If the user simply clicks within the cell and then immediately moves focus to another grid cell (i.e. no edit is made), the color in the grid cell changes to ADD8E6. The text still says "LightBlue" but is painted in bold text, indicating a change from default.

It seems that this is a problem with two colors mapping to an identical name (one a Web color, the other an Office color). Presumably the RGB->text pulls one of these first out of the lookup map, and text->RGB pulls the other first. This could happen with other colors too I imagine.

For me this isn’t a major issue as I’ve just changed the default color and I’m hoping users never encounter the problem, but I believe the mapping should be consistent, otherwise it looks like a bug.

Thanks.

Technical Support Oct 9, 2007 - 11:08 AM

Thank you for reporting this issue. We have renamed web colors in CExtGridCellColor::CPackedColor::InitColorMap() method in the ../Prof-UIS/Src/ExtGridWnd.cpp file

      static struct 
      {
            LPCTSTR lpszColorName;
            COLORREF clr;
      } _arrWebColors[] =
      {
            { _T("WebSnow"),                    RGB(0xFF, 0xFA, 0xFA) },
            { _T("WebGhostWhite"),              RGB(0xF8, 0xF8, 0xFF) },
            { _T("WebWhiteSmoke"),              RGB(0xF5, 0xF5, 0xF5) },
            { _T("WebGainsboro"),               RGB(0xDC, 0xDC, 0xDC) },
            { _T("WebFloralWhite"),             RGB(0xFF, 0xFA, 0xF0) },
            { _T("WebOldLace"),                 RGB(0xFD, 0xF5, 0xE6) },
            { _T("WebLinen"),                   RGB(0xFA, 0xF0, 0xE6) },
            { _T("WebAntiqueWhite"),                  RGB(0xFA, 0xEB, 0xD7) },
            { _T("WebPapayaWhip"),              RGB(0xFF, 0xEF, 0xD5) },
            { _T("WebBlanchedAlmond"),          RGB(0xFF, 0xEB, 0xCD) },
            { _T("WebBisque"),                        RGB(0xFF, 0xFA, 0xF0) },
            { _T("WebPeachPuff"),               RGB(0xFF, 0xDA, 0xB9) },
            { _T("WebNavajoWhite"),             RGB(0xFF, 0xDE, 0xAD) },
            { _T("WebMoccasin"),                RGB(0xFF, 0xE4, 0xB5) },
            { _T("WebCornsilk"),                RGB(0xFF, 0xF8, 0xDC) },
            { _T("WebIvory"),                   RGB(0xFF, 0xFF, 0xF0) },
            { _T("WebLemonChiffon"),                  RGB(0xFF, 0xFA, 0xCD) },
            { _T("WebSeashell"),                RGB(0xFF, 0xF5, 0xEE) },
            { _T("WebHoneydew"),                RGB(0xF0, 0xFF, 0xF0) },
            { _T("WebMintCream"),               RGB(0xF5, 0xFF, 0xFA) },
            { _T("WebAzure"),                   RGB(0xF0, 0xFF, 0xFF) },
            { _T("WebAliceBlue"),               RGB(0xF0, 0xF8, 0xFF) },
            { _T("Weblavender"),                RGB(0xE6, 0xE6, 0xFA) },
            { _T("WebLavenderBlush"),           RGB(0xFF, 0xF0, 0xF5) },
            { _T("WebMistyRose"),               RGB(0xFF, 0xE4, 0xE1) },
            { _T("WebWhite"),                   RGB(0xFF, 0xFF, 0xFF) },
            { _T("WebBlack"),                   RGB(0x00, 0x00, 0x00) },
            { _T("WebDarkSlateGray"),           RGB(0x2F, 0x4F, 0x4F) },
            { _T("WebLightSlateGray"),          RGB(0x77, 0x88, 0x99) },
            { _T("WebGrey"),                    RGB(0xBE, 0xBE, 0xBE) },
            { _T("WebLightGray"),               RGB(0xD3, 0xD3, 0xD3) },
            { _T("WebMidnightBlue"),                  RGB(0x19, 0x19, 0x70) },
            { _T("WebCornflowerBlue"),          RGB(0x64, 0x95, 0xED) },
            { _T("WebDarkSlateBlue"),           RGB(0x48, 0x3D, 0x8B) },
            { _T("WebSlateBlue"),               RGB(0x6A, 0x5A, 0xCD) },
            { _T("WebMediumSlateBlue"),         RGB(0x7B, 0x68, 0xEE) },
            { _T("WebLightSlateBlue"),          RGB(0x84, 0x70, 0xFF) },
            { _T("WebNavyBlue"),                RGB(0x00, 0x00, 0x80) },
            { _T("WebDimGrey"),                 RGB(0x69, 0x69, 0x69) },
            { _T("WebSlateGrey"),               RGB(0x70, 0x80, 0x90) },
            { _T("WebMediumBlue"),              RGB(0x00, 0x00, 0xCD) },
            { _T("WebRoyalBlue"),               RGB(0x41, 0x69, 0xE1) },
            { _T("WebBlue"),                    RGB(0x00, 0x00, 0xFF) },
            { _T("WebDodgerBlue"),              RGB(0x1E, 0x90, 0xFF) },
            { _T("WebDeepSkyBlue"),             RGB(0x00, 0xBF, 0xFF) },
            { _T("WebSkyBlue"),                 RGB(0x87, 0xCE, 0xEB) },
            { _T("WebLightSkyBlue"),                  RGB(0x87, 0xCE, 0xFA) },
            { _T("WebSteelBlue"),               RGB(0x46, 0x82, 0xB4) },
            { _T("WebLightSteelBlue"),          RGB(0xB0, 0xC4, 0xDE) },
            { _T("WebLightBlue"),               RGB(0xAD, 0xD8, 0xE6) },
            { _T("WebPowderBlue"),              RGB(0xB0, 0xE0, 0xE6) },
            { _T("WebPaleTurquoise"),           RGB(0xAF, 0xEE, 0xEE) },
            { _T("WebDarkTurquoise"),           RGB(0x00, 0xCE, 0xD1) },
            { _T("WebMediumTurquoise"),         RGB(0x48, 0xD1, 0xCC) },
            { _T("WebTurquoise"),               RGB(0x40, 0xE0, 0xD0) },
            { _T("WebCyan"),                    RGB(0x00, 0xFF, 0xFF) },
            { _T("WebLightCyan"),               RGB(0xE0, 0xFF, 0xFF) },
            { _T("WebCadetBlue"),               RGB(0x5F, 0x9E, 0xA0) },
            { _T("WebMediumAquamarine"),        RGB(0x66, 0xCD, 0xAA) },
            { _T("WebAquamarine"),              RGB(0x7F, 0xFF, 0xD4) },
            { _T("WebDarkGreen"),               RGB(0x00, 0x64, 0x00) },
            { _T("WebDarkOliveGreen"),          RGB(0x55, 0x6B, 0x2F) },
            { _T("WebDarkSeaGreen"),                  RGB(0x8F, 0xBC, 0x8F) },
            { _T("WebSeaGreen"),                RGB(0x2E, 0x8B, 0x57) },
            { _T("WebMediumSeaGreen"),          RGB(0x3C, 0xB3, 0x71) },
            { _T("WebLightSeaGreen"),           RGB(0x20, 0xB2, 0xAA) },
            { _T("WebPaleGreen"),               RGB(0x98, 0xFB, 0x98) },
            { _T("WebSpringGreen"),             RGB(0x00, 0xFF, 0x7F) },
            { _T("WebLawnGreen"),               RGB(0x7C, 0xFC, 0x00) },
            { _T("WebGreen"),                   RGB(0x00, 0xFF, 0x00) },
            { _T("WebChartreuse"),              RGB(0x7F, 0xFF, 0x00) },
            { _T("WebMedSpringGreen"),          RGB(0x00, 0xFA, 0x9A) },
            { _T("WebGreenYellow"),             RGB(0xAD, 0xFF, 0x2F) },
            { _T("WebLimeGreen"),               RGB(0x32, 0xCD, 0x32) },
            { _T("WebYellowGreen"),             RGB(0x9A, 0xCD, 0x32) },
            { _T("WebForestGreen"),             RGB(0x22, 0x8B, 0x22) },
            { _T("WebOliveDrab"),               RGB(0x6B, 0x8E, 0x23) },
            { _T("WebDarkKhaki"),               RGB(0xBD, 0xB7, 0x6B) },
            { _T("WebPaleGoldenrod"),           RGB(0xEE, 0xE8, 0xAA) },
            { _T("WebLtGoldenrodYello"),        RGB(0xFA, 0xFA, 0xD2) },
            { _T("WebLightYellow"),             RGB(0xFF, 0xFF, 0xE0) },
            { _T("WebYellow"),                        RGB(0xFF, 0xFF, 0x00) },
            { _T("WebGold"),                    RGB(0xFF, 0xD7, 0x00) },
            { _T("WebLightGoldenrod"),          RGB(0xEE, 0xDD, 0x82) },
            { _T("WebGoldenrod"),               RGB(0xDA, 0xA5, 0x20) },
            { _T("WebDarkGoldenrod"),           RGB(0xB8, 0x86, 0x0B) },
            { _T("WebRosyBrown"),               RGB(0xBC, 0x8F, 0x8F) },
            { _T("WebIndianRed"),               RGB(0xCD, 0x5C, 0x5C) },
            { _T("WebSaddleBrown"),             RGB(0x8B, 0x45, 0x13) },
            { _T("WebSienna"),                        RGB(0xA0, 0x52, 0x2D) },
            { _T("WebPeru"),                    RGB(0xCD, 0x85, 0x3F) },
            { _T("WebBurlywood"),               RGB(0xDE, 0xB8, 0x87) },
            { _T("WebBeige"),                   RGB(0xF5, 0xF5, 0xDC) },
            { _T("WebWheat"),                   RGB(0xF5, 0xDE, 0xB3) },
            { _T("WebSandyBrown"),              RGB(0xF4, 0xA4, 0x60) },
            { _T("WebTan"),                     RGB(0xD2, 0xB4, 0x8C) },
            { _T("WebChocolate"),               RGB(0xD2, 0x69, 0x1E) },
            { _T("WebFirebrick"),               RGB(0xB2, 0x22, 0x22) },
            { _T("WebBrown"),                   RGB(0xA5, 0x2A, 0x2A) },
            { _T("WebDarkSalmon"),              RGB(0xE9, 0x96, 0x7A) },
            { _T("WebSalmon"),                        RGB(0xFA, 0x80, 0x72) },
            { _T("WebLightSalmon"),             RGB(0xFF, 0xA0, 0x7A) },
            { _T("WebOrange"),                        RGB(0xFF, 0xA5, 0x00) },
            { _T("WebDarkOrange"),              RGB(0xFF, 0x8C, 0x00) },
            { _T("WebCoral"),                   RGB(0xFF, 0x7F, 0x50) },
            { _T("WebLightCoral"),              RGB(0xF0, 0x80, 0x80) },
            { _T("WebTomato"),                        RGB(0xFF, 0x63, 0x47) },
            { _T("WebOrangeRed"),               RGB(0xFF, 0x45, 0x00) },
            { _T("WebRed"),                     RGB(0xFF, 0x00, 0x00) },
            { _T("WebHotPink"),                 RGB(0xFF, 0x69, 0xB4) },
            { _T("WebDeepPink"),                RGB(0xFF, 0x14, 0x93) },
            { _T("WebPink"),                    RGB(0xFF, 0xC0, 0xCB) },
            { _T("WebMediumVioletRed"),         RGB(0xC7, 0x15, 0x85) },
            { _T("WebVioletRed"),               RGB(0xD0, 0x20, 0x90) },
            { _T("WebMagenta"),                 RGB(0xFF, 0x00, 0xFF) },
            { _T("WebViolet"),                        RGB(0xEE, 0x82, 0xEE) },
            { _T("WebPlum"),                    RGB(0xDD, 0xA0, 0xDD) },
            { _T("WebLightPink"),               RGB(0xFF, 0xB6, 0xC1) },
            { _T("WebPaleVioletRed"),           RGB(0xDB, 0x70, 0x93) },
            { _T("WebMaroon"),                        RGB(0xB0, 0x30, 0x60) },
            { _T("WebOrchid"),                        RGB(0xDA, 0x70, 0xD6) },
            { _T("WebMediumOrchid"),                  RGB(0xBA, 0x55, 0xD3) },
            { _T("WebDarkOrchid"),              RGB(0x99, 0x32, 0xCC) },
            { _T("WebDarkViolet"),              RGB(0x94, 0x00, 0xD3) },
            { _T("WebBlueViolet"),              RGB(0x8A, 0x2B, 0xE2) },
            { _T("WebPurple"),                        RGB(0xA0, 0x20, 0xF0) },
            { _T("WebMediumPurple"),                  RGB(0x93, 0x70, 0xDB) },
            { _T("WebThistle"),                 RGB(0xD8, 0xBF, 0xD8) },
      };