Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - [solved] Problem with ribbon bar background
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[solved] Problem with ribbon bar background

 Post Reply Post Reply
Author
Message
Sergio View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 September 2006
Status: Offline
Points: 216
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sergio Quote  Post ReplyReply Direct Link To This Post Topic: [solved] Problem with ribbon bar background
    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
Back to Top
athix View Drop Down
Newbie
Newbie


Joined: 15 October 2014
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote athix Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
fleg View Drop Down
Groupie
Groupie


Joined: 11 July 2012
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote fleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2018 at 2:11pm
Bugs with  ShowCaptionAlways(FALSE) also have been fixed.
Fix will be available soon in v18.4
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.