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 » Logo in new themes Collapse All
Subject Author Date
Robert Webb Jul 28, 2010 - 2:17 AM

The new themes have two small 16x16 icons in the top left corner, rather than one larger 32x32 icon as before.  I haven’t seen the matching version of Office, so could you tell me what icons are supposed to be used there?  Currently we have the same icon in both places, and it’s confusing for users that the top left icon in one theme opens a different menu from the top left icon in the other theme.  And if the buttons have the same icon they seem as if they should have the same function.  I’m just not sure how to make it look sensible.


One option would be to simply use the word "File" at the top of the file-menu (app-menu) instead of an icon.  Is that easily done?


Thanks,


Rob.

Robert Webb Jul 28, 2010 - 9:30 PM

Great, thanks.  I think simple "File" text will be clearer in our app.


By the way, I found a screenshot of Word2010 which shows exactly that, not two icons, just one and the word "File".


photos.pcpro.co.uk/blogs/wp-content/uploads/2009/11/word2010insertscreenshot.png


Thanks,


Rob.

Technical Support Jul 29, 2010 - 3:46 AM

The final release version of Office 2010 displays File text on the ribbon file tab. The pre-release version displays icon. Now we support both modes of the ribbon file tab in all the Office 2010 themes. We send you an e-mail with the source code update download information.

Robert Webb Jul 29, 2010 - 9:26 PM

Thanks.  Just one problem.  You draw the "File" text in black, which is very hard to see against the dark blue background.


Have another look at the screenshot I linked to above.  You’ll see that "File" is drawn in white and is much clearer.  It is drawn in a different colour from the labels on other ribbon tabs.


I hope you can fix this.


Thanks,


Rob.

Technical Support Jul 30, 2010 - 9:16 AM

We reproduced this issue on Windows XP. It was OK on the later Windows versions. Please update the source code for the following two methods:

bool CExtPaintManagerOffice2010_Impl::Ribbon_FileButtonCalcLayout(
            CDC & dc,
            CExtNcFrameImpl * pExtNcFrameImpl,
            CExtRibbonButtonFile * pFileTBB,
            LPARAM lParam // = 0L
            )
{
            ASSERT_VALID( this );
            ASSERT( dc.GetSafeHdc() != NULL );
            ASSERT( pExtNcFrameImpl != NULL );
            ASSERT_VALID( pFileTBB );
            if( IsHighContrast() )
                        return CExtPaintManagerXP::Ribbon_FileButtonCalcLayout( dc, pExtNcFrameImpl, pFileTBB, lParam );    
            if( m_bmpArrRibbonFileButton.IsEmpty() )
                        return false;
CExtRibbonBar * pRibbonBar = DYNAMIC_DOWNCAST( CExtRibbonBar, pFileTBB->GetBar() );
            if( pRibbonBar == NULL )
                        return false;
            ASSERT_VALID( pRibbonBar );
INT nTextBasedWidth = 0;
            if( pRibbonBar->m_bFileTabButtonDisplaysText )
            {
                        CExtSafeString sText = pFileTBB->GetText();
                        if( ! sText.IsEmpty() )
                        {
                                    CRect rcMeasure( 0, 0, 0, 0 );
                                    CFont * pFont = pRibbonBar->OnGetToolbarFont( false, false, pFileTBB );
                                    ASSERT( pFont->GetSafeHandle() != NULL );
                                    CFont * pOldFont = dc.SelectObject( pFont );
                                    INT nOldBkMode = dc.SetBkMode( TRANSPARENT );
                                    COLORREF clrText = RGB(0x0FF,0x0FF,0x0FF);
                                    COLORREF clrOldTextColor = dc.SetTextColor( clrText );
                                    if( g_PaintManager.m_bIsWinVistaOrLater )
                                    {
                                                CExtUxTheme::__EXT_UX_DTTOPTS dto = { sizeof(CExtUxTheme::__EXT_UX_DTTOPTS) };
                                                dto.dwFlags = __EXT_UX_DTT_COMPOSITED | __EXT_UX_DTT_TEXTCOLOR;
                                                dto.crText = clrText;
                                                CExtRichContentLayout::stat_DrawText(
                                                            dc.m_hDC, LPCTSTR(sText), &rcMeasure,
                                                            DT_SINGLELINE|DT_CENTER|DT_VCENTER|DT_NOPREFIX|DT_END_ELLIPSIS|DT_NOCLIP|DT_CALCRECT /*| ( bRTL ? DT_RTLREADING : 0 )*/, 0,
                                                            pRibbonBar->m_hWnd, VSCLASS_WINDOW, /*__EXT_UX_OTD_NONCLIENT*/ 0, 0, 0, &dto
                                                            );
                                    }
                                    else
                                                CExtRichContentLayout::stat_DrawText(
                                                            dc.m_hDC, LPCTSTR(sText), &rcMeasure,
                                                            DT_SINGLELINE|DT_CENTER|DT_VCENTER|DT_NOPREFIX|DT_END_ELLIPSIS|DT_NOCLIP|DT_CALCRECT /*| ( bRTL ? DT_RTLREADING : 0 )*/, 0
                                                            );
                                    dc.SelectObject( pOldFont );
                                    dc.SetTextColor( clrOldTextColor );
                                    dc.SetBkMode( nOldBkMode );
                                    dc.SelectObject( pOldFont );
                                    nTextBasedWidth = rcMeasure.Width() + 10;
                        } // if( ! sText.IsEmpty() )
            }
CSize _sizeTBB( m_bmpArrRibbonFileButton.GetSize().cx, m_nRibbonFileButtonHeight - 1 );
            _sizeTBB.cx = UiScalingDo( _sizeTBB.cx, __EUIST_X );
            _sizeTBB.cy = UiScalingDo( _sizeTBB.cy, __EUIST_Y );
INT nPageIndex, nPageCount = pRibbonBar->RibbonTabPageButton_GetCount();
            for( nPageIndex = 0; nPageIndex < nPageCount; nPageIndex ++ )
            {
                        CExtRibbonButtonTabPage * pTabPageTBB = pRibbonBar->RibbonTabPageButton_GetAt( nPageIndex );
                        ASSERT( pTabPageTBB );
                        if( ( pTabPageTBB->GetStyle() & TBBS_HIDDEN ) != 0 )
                                    continue;
                        if( ! pTabPageTBB->IsVisible() )
                                    continue;
                        CSize sizeTabPageButton = pTabPageTBB->Size();
                        _sizeTBB.cy = max( _sizeTBB.cy, sizeTabPageButton.cy );
                        break;
            } // for( . . .
            if( nTextBasedWidth > 0 )
                        _sizeTBB.cx = max( _sizeTBB.cx, nTextBasedWidth );
INT nTabLineHeight = pRibbonBar->RibbonLayout_GetTabLineHeight();
INT nTopBorderHeight = 0;
INT nFrameCaptionHeight = pRibbonBar->RibbonLayout_GetFrameCaptionHeight( &nTopBorderHeight );
INT nHeightAtTheTop = nTabLineHeight + nFrameCaptionHeight;
INT nBottomLineHeight = pRibbonBar->RibbonLayout_GetBottomLineHeight();
CRect rcClient;
            pRibbonBar->GetClientRect( &rcClient );
CRect rcPageBk = rcClient;
            rcPageBk.top += nHeightAtTheTop;
            rcPageBk.bottom -= nBottomLineHeight;
            if(                     pRibbonBar->RibbonLayout_IsFrameIntegrationEnabled()
                        &&        (! pRibbonBar->RibbonLayout_IsDwmCaptionIntegration() )
                        )
                        rcPageBk.top += nFrameCaptionHeight + nTopBorderHeight;
CRect rcTabLine(
                        rcPageBk.left,
                        rcPageBk.top - nTabLineHeight,
                        rcPageBk.right,
                        rcPageBk.top
                        );
            pRibbonBar->RibbonLayout_AdjustTabLineRect( rcTabLine );
INT nHorzOffset = UiScalingDo( 2, __EUIST_X );
CRect rcTBB( nHorzOffset, rcTabLine.bottom - _sizeTBB.cy, nHorzOffset + _sizeTBB.cx, rcTabLine.bottom );
            pFileTBB->Size( _sizeTBB );
            pFileTBB->SetRect( rcTBB );
            return true;
}

bool CExtPaintManagerOffice2007_Impl::Ribbon_FileButtonPaint(
            CDC & dc,
            CExtRibbonButtonFile * pFileTBB,
            LPARAM lParam // = 0L
            )
{
            ASSERT_VALID( this );
            ASSERT( dc.GetSafeHdc() != NULL );
            ASSERT_VALID( pFileTBB );
            if( IsHighContrast() )
                        return CExtPaintManagerXP::Ribbon_FileButtonPaint( dc, pFileTBB, lParam );     
            if( m_bmpArrRibbonFileButton.IsEmpty() )
                        return false;
CRect rcTBB = *pFileTBB;
            if( ! dc.RectVisible( &rcTBB ) )
                        return true;
CExtRibbonBar * pRibbonBar = DYNAMIC_DOWNCAST( CExtRibbonBar, pFileTBB->GetBar() );
            if( pRibbonBar == NULL )
                        return false;
INT nBmpIndex = 0;
CExtCmdIcon::e_paint_type_t ePT = CExtCmdIcon::__PAINT_DISABLED;

bool bSelTrackingMode = false;
const CExtToolControlBar * pToolBar = pFileTBB->GetBar();
            if( pToolBar != NULL )
            {
                        CExtMenuControlBar * pMenuBar = DYNAMIC_DOWNCAST( CExtMenuControlBar, pToolBar );
                        if(                     pMenuBar != NULL
                                    &&        pMenuBar->IsMenuBarTracking()
                                    )
                        {
                                    int nFlatTrackingIndex = pMenuBar->_FlatTrackingIndexGet();
                                    if( nFlatTrackingIndex >= 0 )
                                    {
                                                int nIndexOfTBB = pMenuBar->_GetIndexOf( pFileTBB );
                                                if( nFlatTrackingIndex == nIndexOfTBB )
                                                                        bSelTrackingMode = true;
                                    }
                        }
            }

            if( bSelTrackingMode )
            {
                                    nBmpIndex = 1;
                                    ePT = CExtCmdIcon::__PAINT_HOVER;
            }
            else if( pFileTBB->IsEnabled() )
            {
                        if( pFileTBB->IsPressed() )
                        {
                                    nBmpIndex = 2;
                                    ePT = CExtCmdIcon::__PAINT_PRESSED;
                        }
                        else if( pFileTBB->IsHover() )
                        {
                                    nBmpIndex = 1;
                                    ePT = CExtCmdIcon::__PAINT_HOVER;
                        }
                        else
                        {
                                    ePT = CExtCmdIcon::__PAINT_NORMAL;
                        }
            }

bool bRTL = false, bDwmMode = pRibbonBar->RibbonLayout_IsDwmCaptionIntegration();
            if( (dc.GetLayout()&LAYOUT_RTL) == LAYOUT_RTL )
                        bRTL = true;
DWORD dwOldRTF = 0;
CRect rcSrc( 0, 0, m_bmpArrRibbonFileButton.GetSize().cx, m_nRibbonFileButtonHeight );
            rcSrc.OffsetRect( 0, nBmpIndex * m_nRibbonFileButtonHeight );
CRect rcPadding( 0, 0, 0, 0 );
bool bTextOverTabMode = false;
            if( pRibbonBar->m_bFileTabButtonDisplaysText && IsKindOf(RUNTIME_CLASS(CExtPaintManagerOffice2010_Impl)) )
            {
                        bTextOverTabMode = true;
                        rcPadding.SetRect( 5, 3, 5, 3 );
            }
            if( (!bTextOverTabMode) && rcSrc.Size() != rcTBB.Size() )
            {
                        CExtBitmap _bmp;
                        _bmp.FromBitmap( m_bmpArrRibbonFileButton, rcSrc );
                        CRect _rcSrc( 0, 0, rcTBB.Width(), rcTBB.Height() );
                        CExtBitmap::Filter _f( CExtBitmap::Filter::gaussian );
                        _f.FilterWidthSet( 2.0 );
                        _bmp.Scale( rcTBB.Width(), rcTBB.Height(), _f );
                        if( bDwmMode && bRTL )
                        {
                                    dwOldRTF = _bmp.RunTimeFlagsGet();
                                    _bmp.RunTimeFlagsSet( dwOldRTF | __EXT_BMP_FLAG_NO_RTL_DETECTION );
                        }
                        _bmp.AlphaBlendSkinParts(
                                    dc.m_hDC,
                                    rcTBB,
                                    _rcSrc,
                                    rcPadding,
                                    CExtBitmap::__EDM_STRETCH,
                                    true,
                                    true
                                    );
                        if( bDwmMode && bRTL )
                        {
                                    _bmp.RunTimeFlagsSet( dwOldRTF );
                        }
            } // if( (!bTextOverTabMode) && rcSrc.Size() != rcTBB.Size() )
            else
            {
                        if( bDwmMode && bRTL )
                        {
                                    dwOldRTF = m_bmpArrRibbonFileButton.RunTimeFlagsGet();
                                    m_bmpArrRibbonFileButton.RunTimeFlagsSet( dwOldRTF | __EXT_BMP_FLAG_NO_RTL_DETECTION );
                        }
                        m_bmpArrRibbonFileButton.AlphaBlendSkinParts(
                                    dc.m_hDC,
                                    rcTBB,
                                    rcSrc,
                                    rcPadding,
                                    CExtBitmap::__EDM_STRETCH,
                                    true,
                                    true
                                    );
                        if( bDwmMode && bRTL )
                        {
                                    m_bmpArrRibbonFileButton.RunTimeFlagsSet( dwOldRTF );
                        }
                        if( bTextOverTabMode )
                        {
                                    CExtSafeString sText = pFileTBB->GetText();
                                    if( ! sText.IsEmpty() )
                                    {
                                                CFont * pFont = pRibbonBar->OnGetToolbarFont( false, false, pFileTBB );
                                                ASSERT( pFont->GetSafeHandle() != NULL );
                                                CFont * pOldFont = dc.SelectObject( pFont );
                                                INT nOldBkMode = dc.SetBkMode( TRANSPARENT );
                                                COLORREF clrText = RGB(0x0FF,0x0FF,0x0FF);
                                                COLORREF clrOldTextColor = dc.SetTextColor( clrText );
                                                rcTBB.DeflateRect( &rcPadding );
                                                if( g_PaintManager.m_bIsWinVistaOrLater )
                                                {
                                                            CExtUxTheme::__EXT_UX_DTTOPTS dto = { sizeof(CExtUxTheme::__EXT_UX_DTTOPTS) };
                                                            dto.dwFlags = __EXT_UX_DTT_COMPOSITED | __EXT_UX_DTT_TEXTCOLOR;
                                                            dto.crText = clrText;
                                                            CExtRichContentLayout::stat_DrawText(
                                                                        dc.m_hDC, LPCTSTR(sText), &rcTBB,
                                                                        DT_SINGLELINE|DT_CENTER|DT_VCENTER|DT_NOPREFIX|DT_END_ELLIPSIS /*| ( bRTL ? DT_RTLREADING : 0 )*/, 0,
                                                                        pRibbonBar->m_hWnd, VSCLASS_WINDOW, /*__EXT_UX_OTD_NONCLIENT*/ 0, 0, 0, &dto
                                                                        );
                                                }
                                                else
                                                            CExtRichContentLayout::stat_DrawText(
                                                                        dc.m_hDC, LPCTSTR(sText), &rcTBB,
                                                                        DT_SINGLELINE|DT_CENTER|DT_VCENTER|DT_NOPREFIX|DT_END_ELLIPSIS /*| ( bRTL ? DT_RTLREADING : 0 )*/, 0
                                                                        );
                                                dc.SelectObject( pOldFont );
                                                dc.SetTextColor( clrOldTextColor );
                                                dc.SetBkMode( nOldBkMode );
                                                dc.SelectObject( pOldFont );
                                    } // if( ! sText.IsEmpty() )
                        }
            } // else from if( (!bTextOverTabMode) && rcSrc.Size() != rcTBB.Size() );

            if( ( ! bTextOverTabMode ) && ( ! pFileTBB->m_iconForLargeMode.IsEmpty() ) )
            {
                        CRect rc( rcTBB.TopLeft(), pFileTBB->m_iconForLargeMode.GetSize() );
                        rc.OffsetRect(
                                    ( rcTBB.Width() - rc.Width() ) / 2,
                                    ( rcTBB.Height() - rc.Height() ) / 2
                                    );
                        CExtBitmap & _bmp = pFileTBB->m_iconForLargeMode.GetBitmap( ePT, this );
                        if( bDwmMode && bRTL )
                        {
                                    dwOldRTF = _bmp.RunTimeFlagsGet();
                                    _bmp.RunTimeFlagsSet( dwOldRTF | __EXT_BMP_FLAG_NO_RTL_DETECTION );
                        }
                        if( bRTL )
                        {
                                    CExtBitmap _bmp2 = _bmp;
                                    _bmp2.FlipHorizontal();
                                    if( ! _bmp2.IsEmpty() )
                                    {
                                                CSize _size = _bmp2.GetSize();
                                                _bmp2.AlphaBlend(
                                                            dc.m_hDC,
                                                            rc.left,
                                                            rc.top,
                                                            rc.Width(),
                                                            rc.Height(),
                                                            0,
                                                            0,
                                                            rc.Width(),
                                                            rc.Height()
                                                            );
                                    }
                        }
                        else
                        {
                                    pFileTBB->m_iconForLargeMode.Paint(
                                                this,
                                                dc.m_hDC,
                                                rc,
                                                ePT
                                                );
                        }
                        if( bDwmMode && bRTL )
                        {
                                    _bmp.RunTimeFlagsSet( dwOldRTF );
                        }
            } // if( ( ! bTextOverTabMode ) && ( ! pFileTBB->m_iconForLargeMode.IsEmpty() ) )
            return true;
}

Robert Webb Aug 1, 2010 - 7:26 PM

Thanks, looks great.


Rob.

Technical Support Jul 28, 2010 - 9:54 AM

Implemented. Please drop us an e-mail and we will provide you with the source code update.

Technical Support Jul 28, 2010 - 3:00 AM

Please let us remind you, we already discussed implementation of different size icons in the ribbon file button here:
http://www.prof-uis.com/prof-uis/tech-support/support-forum/main-icon-in-2010-themes-67320.aspx#67332
We had to use the 32x32 icons in Office 2007 themes because the ribbon file button is big and round. We had to use the 16x16 icons in Office 2010 themes because the ribbon file button is small and looks like tab item. You can use the same 16x16 icon in the Office 2007 themes but they will not have a good visual appearance. Besides the round file button in styles 2007 is light when the ribbon file buttons’ tab item in Office 2010 themes is dark. We can add support for the File text instead of small 16x16 icon. This will let you avoid painting small 16x16 icon for your app. Please give us 1..2 days.