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 » About title text color of the tab page. - VS2005, VS2008 style Collapse All
Subject Author Date
Seung Cheol Lee Jun 4, 2010 - 4:12 AM

At Visual Studio 2005/2008, the tile text color of the tab page  is black to click the tab.


But the title text color of the tab page at prof-uis style ( VS2005, VS 2008 ) is white.


So it is difficult to see the title text of the tab page because the title color is white.


I would like to  know that there is the way to change the title text color to black.


 

Technical Support Jun 8, 2010 - 12:06 PM

Thank you for providing the screen shots. We reproduced the white caption issue. To fix it, please update the source code for the following method:

void CExtPaintManagerXP::PaintGripper(
            CDC & dc,
            CExtPaintManager::PAINTGRIPPERDATA & _pgd
            )
{
            ASSERT_VALID( this );
            ASSERT( dc.GetSafeHdc() != NULL );
CRect rectGripper( _pgd.m_rcGripper );
            if( _pgd.m_bSideBar || _pgd.m_bFloating )
            {
                        if( _pgd.m_bFlashCaptionHighlightedState )
                        {
                                    ASSERT( _pgd.m_clrFlashCaptionBackground != COLORREF(-1L) );
                                    ASSERT( _pgd.m_clrFlashCaptionText != COLORREF(-1L) );
                                    dc.FillSolidRect( rectGripper, _pgd.m_clrFlashCaptionBackground );
                        } // if( _pgd.m_bFlashCaptionHighlightedState )
                        else
                        {
                                    COLORREF clrGrip =
                                                GetColor(
                                                            _pgd.m_bSideBar ? ( _pgd.m_bActive ? COLOR_HIGHLIGHT : XPCLR_3DFACE_DARK ) : COLOR_3DSHADOW,
                                                            _pgd.m_pHelperSrc,
                                                            _pgd.m_lParam 
                                                            );
                                    if( ! _pgd.m_bHelperNoFill )
                                                dc.FillSolidRect( rectGripper, clrGrip );
                                    if(                     _pgd.m_bSideBar
                                                &&        (!_pgd.m_bHelperNoFill)
                                                &&        (!_pgd.m_bFloating)
                                                &&        (!_pgd.m_bActive)
                                                )
                                    { // rect border of docked bar caption like VS-.NET-7.0
                                                COLORREF clrSideRect = GetColor( COLOR_3DSHADOW, _pgd.m_pHelperSrc, _pgd.m_lParam );
                                                stat_PaintDotNet3dRect( dc, rectGripper, clrSideRect, clrSideRect );
                                    } // rect border of docked bar caption like VS-.NET-7.0
                        } // else from  // if( _pgd.m_bFlashCaptionHighlightedState )
                        int nTextLen = 0;
                        if(                     _pgd.m_sCaption != NULL
                                    &&        ( nTextLen = int(_tcslen(_pgd.m_sCaption)) ) > 0
                                    &&        (! _pgd.m_rcText.IsRectEmpty() )
                                    &&        _pgd.m_rcText.right > _pgd.m_rcText.left
                                    &&        _pgd.m_rcText.bottom > _pgd.m_rcText.top
                                    )
                        {
                                    e_paint_manager_name_t ePMN = OnQueryPaintManagerName();
                                    e_system_theme_t eST = OnQuerySystemTheme();
                                    COLORREF clrText = _pgd.m_bFlashCaptionHighlightedState;
                                    if( ! _pgd.m_clrFlashCaptionText )
                                    {
                                                if(                     ( ePMN == Office2003 || ePMN == Studio2005 )
                                                            &&        g_PaintManager.m_bIsWinVistaOrLater
                                                            )
                                                            clrText = GetColor( COLOR_BTNTEXT, _pgd.m_pHelperSrc, _pgd.m_lParam );
                                                else if( _pgd.m_bActive || (! _pgd.m_bSideBar) )
                                                            clrText = GetColor(
                                                                                    ( ( ePMN == Office2003 || ePMN == Studio2005 ) && ( eST == ThemeLunaSilver ) ) ? COLOR_WINDOW : COLOR_HIGHLIGHTTEXT,
                                                                                    _pgd.m_pHelperSrc, _pgd.m_lParam
                                                                                    );
                                                else
                                                            clrText = GetColor( COLOR_BTNTEXT, _pgd.m_pHelperSrc, _pgd.m_lParam );
                                    }
//                                  COLORREF clrText =
//                                              _pgd.m_bFlashCaptionHighlightedState
//                                                          ?          _pgd.m_clrFlashCaptionText
//                                                          :           (
//                                                                                  ( _pgd.m_bActive || (! _pgd.m_bSideBar) )
//                                                                                              ? GetColor(
//                                                                                                          ( ( ePMN == Office2003 || ePMN == Studio2005 ) && ( eST == ThemeLunaSilver ) )
//                                                                                                                      ? COLOR_WINDOW : COLOR_HIGHLIGHTTEXT,
//                                                                                                          _pgd.m_pHelperSrc, _pgd.m_lParam
//                                                                                                          )
//                                                                                              : GetColor( COLOR_BTNTEXT, _pgd.m_pHelperSrc, _pgd.m_lParam )
//                                                                      );
                                    COLORREF clrOldText =
                                                dc.SetTextColor(clrText);
                                    int nOldBkMode = dc.SetBkMode( TRANSPARENT );
                                    CFont * pCurrFont =
                                                (! _pgd.m_bHorz)
                                                            ? ( _pgd.m_bSideBar ? (&m_FontNormalBC) : (&m_FontBoldBC) )
                                                            : ( _pgd.m_bSideBar ? (&m_FontNormalVertXBC) : (&m_FontBoldVertXBC) )
                                                            ;
                                    CFont * pOldFont = dc.SelectObject( pCurrFont );
                                    if( !_pgd.m_bHorz )
                                    { // if text is horizontal
                                                bool bFloatingFixedBar = false;
                                                UINT nDtAlign = _pgd.m_bForceRTL ? DT_RIGHT : DT_LEFT;
                                                if( _pgd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtMiniDockFrameWnd) ) )
                                                {
                                                            CExtControlBar * pBar = ((CExtMiniDockFrameWnd *)_pgd.m_pHelperSrc)->GetControlBarExt( false );
                                                            if( pBar != NULL && pBar->IsFixedMode() )
                                                                        bFloatingFixedBar = true;
                                                }
                                                if( bFloatingFixedBar )
                                                {
                                                            CExtSafeString sCaption( _pgd.m_sCaption );
                                                            INT nAvailableWidth = _pgd.m_rcText.Width();
                                                            for( ; ; ) 
                                                            {
                                                                        INT nWidth = stat_CalcTextWidth( dc, *pCurrFont, sCaption );                                          
                                                                        if( nAvailableWidth >= nWidth  || sCaption.IsEmpty() )
                                                                                    break;
                                                                        sCaption.Delete( sCaption.GetLength() - 1 );
                                                            } 
                                                            if( sCaption.GetLength() > 0 )
                                                            DrawText( dc.m_hDC, sCaption, sCaption.GetLength(), (LPRECT)&_pgd.m_rcText, nDtAlign|DT_SINGLELINE|DT_VCENTER|DT_NOCLIP );
                                                } // if( bFloatingFixedBar )
                                                else
                                                            DrawText( dc.m_hDC, _pgd.m_sCaption, nTextLen, (LPRECT)&_pgd.m_rcText, nDtAlign|DT_SINGLELINE|DT_VCENTER|DT_END_ELLIPSIS );
                                    } // if text is horizontal
                                    else
                                    { // if text is vertical
                                                LOGFONT lf;
                                                ::memset(&lf,0,sizeof(LOGFONT));
                                                pCurrFont->GetLogFont(&lf);
                                                int _cyHorzFont = abs(lf.lfHeight);
                                                int _cyTextMargin = (_pgd.m_rcText.Width() - _cyHorzFont)  / 2;
                                                CRect rcString = 
                                                            CRect(
                                                                        CPoint( _pgd.m_rcText.left + _cyTextMargin - __ExtMfc_CXTEXTMARGIN, _pgd.m_rcText.bottom - __ExtMfc_CYTEXTMARGIN ),
                                                                        _pgd.m_rcText.Size()
                                                                        );
                                                rcString.DeflateRect( 2, 2 );
                                                CRect rcExclude;
                                                rcExclude.SetRect(
                                                            _pgd.m_rcGripper.left,
                                                            _pgd.m_rcGripper.top,
                                                            _pgd.m_rcGripper.right,
                                                            _pgd.m_rcText.top
                                                            );
                                                dc.ExcludeClipRect( &rcExclude );
                                                rcString.OffsetRect( -2, -3 );
                                                DrawText( dc.m_hDC, _pgd.m_sCaption, nTextLen, rcString, DT_SINGLELINE|DT_NOCLIP|DT_NOPREFIX ); // don’t forget DT_NOCLIP
                                                dc.SelectClipRgn( NULL );
                                    } // if text is vertical
                                    dc.SelectObject( pOldFont );
                                    dc.SetBkMode( nOldBkMode );
                                    dc.SetTextColor( clrOldText );
                        }
            } // if( _pgd.m_bSideBar || _pgd.m_bFloating )
            else
            {
                        COLORREF clrGrip = GetColor( CLR_3DFACE_OUT, _pgd.m_pHelperSrc, _pgd.m_lParam );
                        CRect rcGripToClear( _pgd.m_rcGripper );
                        rcGripToClear.DeflateRect( 1, 1 );
                        if(                     _pgd.m_pHelperSrc != NULL
                                    &&        _pgd.m_pHelperSrc->IsKindOf( RUNTIME_CLASS(CExtToolControlBar) )
                                    &&        ((CControlBar*)_pgd.m_pHelperSrc)->m_pDockSite != NULL
                                    &&        ((CExtToolControlBar*)_pgd.m_pHelperSrc)->m_bForceNoBalloonWhenRedockable
                                    )
                        {
                        }
                        else
                                    dc.FillSolidRect( rcGripToClear, clrGrip );
                        CPen pen;
                        pen.CreatePen( PS_SOLID, 1, GetColor( XPCLR_GRIPPER, _pgd.m_pHelperSrc, _pgd.m_lParam ) );
                        CPen * pOldPen = dc.SelectObject( &pen );
                        if( _pgd.m_bHorz )
                        {
                                    rectGripper.DeflateRect( 4, 1, 6, 2 );
                                    rectGripper.right = rectGripper.left + 5;
                                    rectGripper.DeflateRect( 1, 0 );
                                    CRect rcLine( rectGripper );
                                    INT nLineCount = rectGripper.Height() / (1 + 1);
                                    rcLine.top += rcLine.Height() - (1 + 1) * nLineCount;
                                    rcLine.bottom = rcLine.top + 1;
                                    for( INT nLine = 0; nLine < nLineCount; nLine++ )
                                    {
                                                dc.MoveTo( rcLine.left, rcLine.top + 1 );
                                                dc.LineTo( rcLine.right, rcLine.bottom );
                                                rcLine.OffsetRect( 0, 1 + 1 );
                                    }
                        }
                        else
                        {
                                    rectGripper.OffsetRect( 1, 0 );
                                    rectGripper.DeflateRect( 1, 4, 2, 6 );
                                    rectGripper.bottom = rectGripper.top + 5;
                                    rectGripper.DeflateRect( 0, 1 );
                                    CRect rcLine( rectGripper );
                                    int nLineCount = rectGripper.Width() / (1 + 1);
                                    rcLine.left += rcLine.Width() - (1 + 1) * nLineCount;
                                    rcLine.right = rcLine.left + 1;
                                    for( int nLine = 0; nLine < nLineCount; nLine++ )
                                    {
                                                dc.MoveTo( rcLine.left + 1, rcLine.top );
                                                dc.LineTo( rcLine.right, rcLine.bottom );
                                                rcLine.OffsetRect( 1 + 1, 0 );
                                    }
                        } // else from if( _pgd.m_bHorz )
                        dc.SelectObject( pOldPen );
            } // else from if( _pgd.m_bSideBar || _pgd.m_bFloating )
}

Technical Support Jun 7, 2010 - 11:18 AM

We are sorry but in the case of Prof-UIS the title text color is also black. We suspect the issue you are reporting depends on the Windows version and desktop theme settings. Please provide us with additional information.

Seung Cheol Lee Jun 7, 2010 - 6:24 PM

I send the additional information with screen shot.


To : support@prof-uis.com


Title : About title text color of the tab page. - VS2005, VS2008 style


Could you confirm the e-mail.