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 » Bug in CExtPaintManagerOffice2007_R2_Obsidian::PaintPushButton + fix Collapse All
Subject Author Date
Offer Har Apr 8, 2008 - 6:47 AM

Hi,


I reported a bug in this function a while ago, was completly ignored, which is not something new...


However, I did fix it, and would like to share it with the community, so that if somebody have this problem it might be of help.


This is the bug description:


If you try to paint a button inside a grid cell using direct call to PaintPushButton and using the  CExtPaintManagerOffice2007_R2_Obsidian, with a specific color for the text, to color is inverted to white.


The reason is because this theme is dark, so the library inverts the default text color to white, so that it will be readable. However, it does so even if you give it a color you explicitly want. The solution is to not invert the text color if a specific color is passed in.


These are the last lines of the function, and my addition is highlighted:

   if( bInvertNormalTextColor && _ppbd.m_clrForceTextNormal == COLORREF(-1L))
        _ppbd.m_clrForceTextNormal = RGB(255,255,255);
    if( _ppbd.m_clrForceTextDisabled == COLORREF(-1L) )
        _ppbd.m_clrForceTextDisabled = RGB(141,141,141);
    CExtPaintManagerOffice2007_Impl::PaintPushButton( dc, _ppbd );
}

Technical Support Apr 9, 2008 - 12:43 PM

Please open the CExtPaintManagerOffice2007_R2_Obsidian::PaintPushButton() method and replace the following lines

            if( bInvertNormalTextColor )
                        _ppbd.m_clrForceTextNormal = RGB(255,255,255);
with these
            if(                     bInvertNormalTextColor 
                        &&       _ppbd.m_clrForceTextNormal == COLORREF(-1L)
                        )
                        _ppbd.m_clrForceTextNormal = RGB(255,255,255);
The problem should be gone.

Offer Har Apr 9, 2008 - 12:46 PM

This is exactly what I wrote...