Print Page | Close Window

[solved] Problem with ribbon bar background

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=23527
Printed Date: 14 August 2018 at 3:55pm


Topic: [solved] Problem with ribbon bar background
Posted By: Sergio
Subject: [solved] Problem with ribbon bar background
Date Posted: 19 December 2017 at 6:28am
Hello,

We just installed the MFC Toolkit Pro version 18.2.0 and we now have a strange background in our ribbon bar used inside of a MDI child window:



We would like to remove the 2 extra bands colors (black and dark gray) from the background which should be flat, as we have no tabs.

We currently initialize it using the following lines of code (not in the mainframe but in the MDI child frame):

m_pRibbonBar = (CXTPRibbonBar*)pChild->GetCommandBars()->Add(_T("The Ribbon"), xtpBarTop, RUNTIME_CLASS(CXTPRibbonBar));
m_pRibbonBar->EnableFrameTheme(FALSE);
m_pRibbonBar->EnableDocking(0);
m_pRibbonBar->ShowQuickAccess(FALSE);
m_pRibbonBar->SetShowGripper(FALSE);
m_pRibbonBar->ShowExpandButton(FALSE);
m_pRibbonBar->SetTabsVisible(FALSE);
m_pRibbonBar->ShowCaptionAlways(FALSE);
m_pRibbonBar->SetOwner(pWndToReceiveButtonClickEvents);

How can we have two different ribbon bars? Because the following line of code will affect all the ribbon bars, and we just want to remove the background image from the MDI document window, not both of them:

XTPSetOfficeSetBackImage(pChild->GetCommandBars(), XTPNone);

Please help us, thanks.

Regards


-------------
Sergio



Replies:
Posted By: athix
Date Posted: 08 January 2018 at 4:37pm
I am having a similar issue with MDI window and quick access menu when RibbonBar.ShowCaptionAlways=FALSE. 

It only happens in version 18 when using office2013 and office2016 themes.



Posted By: fleg
Date Posted: 16 April 2018 at 5:57am
Hi,

I'm facing the same issue.
Actually it seems the problem was partially fixed by updgrading to version 18.3.

In version 18.2, I had something like this

with version 18.3 it is better, but the top of ribbon is still darker


I realized this problem happen when there is no tab in ribbon bar.
When tab is visible, the color are correct.

the darker gray seems to be the color used for the tab zone.

This happen with Office 2015/2016 theme. Using Old Office 2007 theme, there is no such problem.

I'm not expecting to have a new version 18.4, but if you can provide some code fix, so I could patch my own version, it would be great.

Fabien


Posted By: olebed
Date Posted: 07 May 2018 at 2:25pm
Hello,

Thank you for bringing this to our attention.
I found reason of problems with using pRibbonBar->SetTabsVisible(FALSE)
in file Source\Ribbon\Themes\XTPRibbonThemeOffice2013.cpp
void CXTPRibbonOffice2013Theme::FillRibbonBar(CDC *pDC, CXTPRibbonBar *pRibbonBar)
{
.......
    else
    {
        if (pRibbonBar->IsTabsVisible())
        {
            pDC->FillSolidRect(rcTabs, pRibbonBar->IsActive() ? m_clrRibbonInactiveFace : m_clrRibbonInactiveFaceState);
        }
        else
        {
            rcTabs.bottom -= m_nTabsHeight + XTP_DPI_Y(1);
        }
    }
.......
}

void CXTPRibbonOffice2013Theme::DrawBackImage(CDC *pDC, CXTPRibbonBar *pRibbonBar)
{
.......        
        if (pRibbonBar->IsTabsVisible())
        {
            rcClient.bottom += m_nTabsHeight + XTP_DPI_Y(1);
        }
.......
}

Regards,
 Oleksandr Lebed


Posted By: olebed
Date Posted: 08 May 2018 at 2:11pm
Bugs with  ShowCaptionAlways(FALSE) also have been fixed.
Fix will be available soon in v18.4



Print Page | Close Window