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 » Menubar text color[theme CExtPaintManagerOffice2003] Collapse All
Subject Author Date
Steve Margarita Jan 1, 2009 - 8:38 PM

Is there anyone successfully tried to change the text color on the menu bar by using theme CExtPaintManagerOffice2003 of profuis??


Hope there is someone to reply my question.

Steve Margarita Feb 27, 2009 - 2:54 AM

I wanted to change the menu bar text color because



CExtPaintManagerOffice2003 < This class enabled us to change the text color of its submenu item BUT NOT the menu bar text color..


If you got better ways to change it, then it’ll be the best..

Technical Support Jan 6, 2009 - 12:22 PM

Technical support does not know why you need to change themed text color, but knows how to do this for any UI theme:

class CMyToolBarButtonWithRedTextColor : public CExtBarButton
{
public:
            CMyToolBarButtonWithRedTextColor( CExtToolControlBar * pBar = NULL, UINT nCmdID = ID_SEPARATOR, UINT nStyle = 0 )
                        : CExtBarButton( pBar, nCmdID, nStyle )
            {
            }
            void PaintCompound( CDC & dc, bool bPaintParentChain, bool bPaintChildren, bool bPaintOneNearestChildrenLevelOnly )
            {
                        ASSERT_VALID( this );
                        ASSERT_VALID( (&dc) );
                        ASSERT( dc.GetSafeHdc() != NULL );
                        CExtToolControlBar * pBar = GetBar();
                        ASSERT_VALID( pBar );
                        if( ! IsPaintAble( dc ) )
                                    return;
                        if( AnimationClient_StatePaint( dc ) )
                                    return;
                        if( bPaintParentChain )
                                    PaintParentChain( dc );
                        CWnd * pCtrl = CtrlGet();
                        if(                     ( pCtrl != NULL )
                                    &&        (           ( ! m_bVertDocked )
                                                ||           GetCtrlVisibleVertically()
                                                )
                                    )
                                    return;
                        CRect rcArea( m_ActiveRect );
                        if( rcArea.right <= rcArea.left || rcArea.bottom <= rcArea.top )
                                    return;
                        if( (! IsVisible() ) || ( GetStyle() & TBBS_HIDDEN ) != 0 || (! dc.RectVisible(&m_ActiveRect) ) )
                                    return;
                        bool bDockSiteCustomizeMode = pBar->_IsDockSiteCustomizeMode();
                        bool bPushed = ( IsPressed() && (!bDockSiteCustomizeMode) ) ? true : false;
                        bool bEnabled = ( IsDisabled() && (!bDockSiteCustomizeMode) ) ? false : true;
                        bool bHover = ( IsHover() && (!bDockSiteCustomizeMode) ) ? true : false;
                        if( (! bDockSiteCustomizeMode ) && (! GetBar()->IsForceHoverWhenMenuTracking() ) )
                        {
                                    if( CExtToolControlBar::g_bMenuTracking || CExtPopupMenuWnd::IsMenuTracking() )
                                                bHover = false;
                                    else if( !bHover )
                                                bHover = IsPressedTracking();
                        }
                        bool bIndeterminate = ( IsIndeterminate() && (!bDockSiteCustomizeMode) ) ? true : false;
                        CExtSafeString sText = GetText();
                        CExtCmdIcon * pIcon = GetIconPtr();
                        CExtCmdIcon * pIconLarge = NULL;
                        if( pIcon != NULL && (! pIcon->IsEmpty() ) && IsLargeIcon() )
                        {
                                    CSize _sizeIcon = pIcon->GetSize();
                                    _sizeIcon.cx *= 2;
                                    _sizeIcon.cy *= 2;
                                    pIconLarge = new CExtCmdIcon;
                                    if( pIconLarge->CreateScaledCopy( *pIcon, _sizeIcon ) )
                                                pIcon = pIconLarge;
                        }
                        bool bHorz = IsHorzBarOrientation();
                        HFONT hFont = (HFONT) pBar -> OnGetToolbarFont( ! bHorz, false ) -> GetSafeHandle();
                        CExtPaintManager::PAINTPUSHBUTTONDATA _ppbd(
                                    this, bHorz, rcArea, sText, pIcon, true, bHover, bPushed, bIndeterminate, bEnabled, m_bDrawBorder, false, false, 0,
                                    hFont, ( IsAbleToTrackMenu() &&           (! pBar->_IsSimplifiedDropDownButtons() ) ) ? true : false, 0,
                                    (!bEnabled) || ( bEnabled && (!bHover) && (!bPushed) )
                                    );
                        _ppbd.m_rcBorderSizes = OnQueryBorderSizes( bHorz );
                        _ppbd.m_nIconAlignment = OnQueryAlignmentIcon( bHorz );
                        _ppbd.m_nTextAlignment = OnQueryAlignmentText( bHorz );
                        _ppbd.m_rcIconMargins = OnQueryMarginsIcon( bHorz );
                        _ppbd.m_rcTextMargins = OnQueryMarginsText( bHorz );
                        if( OnQueryMaxButtonWidth( bHorz ) >= 0 )
                                    _ppbd.m_bWordBreak = true;    
                        if( GetSeparatedDropDown() )
                        {
                                    _ppbd.m_bSeparatedDropDown = true;
                                    _ppbd.m_bHoverDropDown = m_bDropDownHT;
                                    if( m_bDropDownHT && bPushed && ( ! bDockSiteCustomizeMode ) )
                                                _ppbd.m_bPushedDropDown = true;
                        }
                        _ppbd.m_clrCustomAccentEffectForIcon = OnQueryCustomAccentEffectForIcon( dc );
                        bool bChecked = ( ( GetStyle() & TBBS_CHECKED ) != 0 ) ? true  : false;
                        _ppbd.m_bChecked = bChecked;
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
// we need red text color
_ppbd.m_clrForceTextNormal = RGB(255,0,0);
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
                        pBar->PmBridge_GetPM()->PaintPushButton( dc, _ppbd );
#if (!defined __EXT_MFC_NO_CUSTOMIZE)
                        CExtCustomizeSite * pSite = pBar->GetCustomizeSite();
                        if( pSite != NULL && pSite->IsCustomizeMode() && pSite->CustomizedNodeGet() != NULL && pSite->CustomizedNodeGet() == GetCmdNode( false ) )
                                    pBar->PmBridge_GetPM()->PaintDragSourceRect( dc, rcArea );
#endif
                        if( pIconLarge != NULL )
                                    delete pIconLarge;
                        if( bPaintChildren )
                                    PaintChildren( dc, bPaintOneNearestChildrenLevelOnly );
            }
};

class CMyMenuBar : public CExtMenuControlBar
{
public:
            CExtBarButton * OnCreateBarCommandBtn( UINT nCmdID, UINT nStyle = 0 )
            {
                        ASSERT_VALID( this );
                        CExtBarButton * pTBB = new CMyToolBarButtonWithRedTextColor( this, nCmdID, nStyle );
                        ASSERT_VALID( pTBB );
                        return pTBB;
            }

};



Steve Margarita Jan 5, 2009 - 2:12 AM

is it nobody know how to answer this question?? even technical support?