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 General Discussion » Coloring Issues Collapse All
Subject Author Date
Ryan Allgaier May 19, 2006 - 12:15 PM

Office2003/OfficeXP Paint Manager:
The control bar captions appear to be painted with either COLOR_BTNFACE/COLOR_BTNTEXT, or COLOR_HIGHLIGHT/COLOR_CAPTIONTEXT with focus. On certain windows themes ("Inside Your Computer" for example), the focused mode gets painted with white text on a yellow background -- making the text very difficult to read. To fix this problem, I’ve changed COLOR_CAPTIONTEXT to COLOR_HIGHLIGHTTEXT in CExtPaintManagerXP::PaintGripper (at line 15330). Is this the most appropriate fix for this problem?

Studio2005 Paint Manager:
The dock marker ships in ProfUIS with a light-blue color when in use, which is probably what exists with the default Windows color theme. In VS 2005 Final though, the dock marker color is derived from COLOR_HIGHLIGHT. I’ve found that when I remove the if-statement that sets the dock marker color to RGB(0,64,196) (at line 24864), I get appropriate colors. Is there a particular reason this behavior is still present?

Technical Support May 20, 2006 - 10:31 AM

Thank you for your suggestion. Yes, the COLOR_CAPTIONTEXT constant can be replaced with the COLOR_HIGHLIGHTTEXT in the CExtPaintManagerXP::PaintGripper() method. The fix for the second issue will be available in Pro-UIS 2.54 (coming soon). Here is the updated method:

void CExtPaintManager::DockMarker_AdjustHighlightedArea(

    COLORREF * pClrSurface,

    int nClrSurfaceDX,

    int nClrSurfaceDY,

    bool bTabShape,

    bool bTabsAtTop,

    const CRect & rcTabMainArea,

    const CRect & rcTabBottomMiddleArea,

    COLORREF clrAdjustMain,

    COLORREF clrAdjustBorder,

    int nBorderMetric

    )

{

    ASSERT_VALID( this );

    ASSERT( nBorderMetric >= 0 );

    ASSERT( pClrSurface != NULL );

    ASSERT( nClrSurfaceDX > 0 );

    ASSERT( nClrSurfaceDY > 0 );

CRect rcMainArea( 0, 0, nClrSurfaceDX, nClrSurfaceDY );

    if( bTabShape )

        rcMainArea = rcTabMainArea;

    if( stat_GetBPP() > 8 )

    {

        if( clrAdjustMain == COLORREF(-1L) )

            clrAdjustMain = ::GetSysColor( COLOR_HIGHLIGHT );

        if( m_eStyle2005 == __ES2005_BETA2 || m_eStyle2005 == __ES2005_RC )

            clrAdjustMain = RGB(0,64,196);

        if( nBorderMetric > 0 && clrAdjustBorder == COLORREF(-1L) )

            clrAdjustBorder = ::GetSysColor( COLOR_ACTIVEBORDER );

        unsigned nPixelIdx = 0;

        for( int nY = 0; nY < nClrSurfaceDY; nY++ )

        {

            for( int nX = 0; nX < nClrSurfaceDX; nX++, nPixelIdx++ )

            {

                if( bTabShape )

                {

                    CPoint ptTest( nX, nClrSurfaceDY - nY - 1 );

                    if(        (! rcTabMainArea.PtInRect( ptTest ) )

                        &&    (! rcTabBottomMiddleArea.PtInRect( ptTest ) )

                        )

                        continue;

                }

                COLORREF clrAdjustMix = clrAdjustMain;

                if( nBorderMetric > 0 )

                {

                    CPoint ptTest( nX, nClrSurfaceDY - nY - 1 );

                    if(            bTabShape

                            &&    rcTabBottomMiddleArea.PtInRect( ptTest )

                            &&    (

                                    ( bTabsAtTop

                                        ? ( ptTest.y <= ( rcTabBottomMiddleArea.top + nBorderMetric ) )

                                        : ( ptTest.y >= ( rcTabBottomMiddleArea.bottom - nBorderMetric ) )

                                        )

                                ||    ptTest.x < (rcTabBottomMiddleArea.left + nBorderMetric)

                                ||    nX >= (rcTabBottomMiddleArea.right - nBorderMetric)

                                )

                            )

                            clrAdjustMix = clrAdjustBorder;

                    else if(    rcMainArea.PtInRect( ptTest )

                            &&    (

                                    ( bTabsAtTop

                                        ? ( ptTest.y > ( rcMainArea.bottom - nBorderMetric ) )

                                        : ( ptTest.y < ( rcMainArea.top + nBorderMetric ) )

                                        )

                                ||    ptTest.x < (rcMainArea.left + nBorderMetric)

                                ||    ptTest.x >= (rcMainArea.right - nBorderMetric)

                                ||    (

                                        ( bTabsAtTop

                                            ? ( ptTest.y <= ( rcMainArea.top + nBorderMetric ) )

                                            : ( ptTest.y >= ( rcMainArea.bottom - nBorderMetric ) )

                                            )

                                    &&    (    (!bTabShape)

                                        ||    (    bTabShape

                                            &&    (    ptTest.x < (rcTabBottomMiddleArea.left + nBorderMetric )

                                                ||    ptTest.x >= (rcTabBottomMiddleArea.right - nBorderMetric )

                                                )

                                            )

                                        )

                                    )

                                )

                            )

                            clrAdjustMix = clrAdjustBorder;

 

                }

                COLORREF clrTemp = pClrSurface[ nPixelIdx ];

                clrTemp =

                    RGB(

                        min(

                            255,

                            GetRValue( clrTemp )

                                + ( ( GetBValue( clrAdjustMix ) - GetRValue( clrTemp ) ) / 2 ) ),

                        min(

                            255,

                            GetGValue( clrTemp )

                                + ( ( GetGValue( clrAdjustMix ) - GetGValue( clrTemp ) ) / 2 ) ),

                        min(

                            255,

                            GetBValue( clrTemp )

                                + ( ( GetRValue( clrAdjustMix ) - GetBValue( clrTemp ) ) / 2 ) )

                        );

                pClrSurface[ nPixelIdx ] =

                    CExtBitmap::stat_HLS_Adjust(

                        clrTemp,

                        0.0,

                        0.10,

                        0.0

                        );

            }

        }

    }

    else

    {

        COLORREF clrDark = GetColor( COLOR_3DSHADOW, this );

        unsigned nPixelIdx = 0;

        for( int nY = 0; nY < nClrSurfaceDY; nY++ )

        {

            for( int nX = 0; nX < nClrSurfaceDX; nX++, nPixelIdx++ )

            {

                if( bTabShape )

                {

                    CPoint ptTest( nX, nClrSurfaceDY - nY );

                    if(        (! rcTabMainArea.PtInRect( ptTest ) )

                        &&    (! rcTabBottomMiddleArea.PtInRect( ptTest ) )

                        )

                        continue;

                }

                if(        ( (nY&0x01) != 0 && (nX&0x01) == 0 )

                    ||    ( (nY&0x01) == 0 && (nX&0x01) != 0 )

                    )

                    pClrSurface[ nPixelIdx ] = clrDark;

            }

        }

    }

}