Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Ribbon bar selection problem.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Ribbon bar selection problem.

 Post Reply Post Reply
Author
Message
jasondmichaelson View Drop Down
Newbie
Newbie


Joined: 11 January 2017
Location: Minnesota
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote jasondmichaelson Quote  Post ReplyReply Direct Link To This Post Topic: Ribbon bar selection problem.
    Posted: 11 January 2017 at 5:05pm
I've got a problem I'm trying to solve with a ribbon bar that contains a few tabs along with a System Button representing the File Menu which contains a backstage view. We've customized the colors in our theme, so that unselected tabs appear with a blue background. The problem I'm experiencing is that since the selected versus unselected tabs have different background colors, when I open up the backstage view under the file menu, CXTPRibbonTabColorSet::SetTextColor() appears to be treating the selected tab as unselected from this code:

if (bSelected && pRibbonBar->IsBackstageViewVisible())
bSelected = FALSE;

and my previously selected ribbon bar tab is being treated as unselected, and I'm getting white text on a white background for that tab.

Is there a better way to add the backstage view to the ribbon bar than with this:

CXTPControlPopup* pControlFile = (CXTPControlPopup*)m_pRibbonBar->AddSystemButton(ID_RBN_FILE);

CXTPRibbonBackstageView* pView = CXTPRibbonBackstageView::CreateBackstageView(GetCommandBars());
CXTPRibbonControlSystemButton* pButton = m_pRibbonBar->GetSystemButton();

if( !m_filePageInfo.GetSafeHwnd() ) {
m_filePageInfo.Create(CFilePageInfo::IDD, this);
}

if( !m_filePageOpen.GetSafeHwnd() ) {
m_filePageOpen.Create(CFilePageOpen::IDD, this);
}

if( !m_filePageOptions.GetSafeHwnd() ) {
m_filePageOptions.Create(CFilePageOptions::IDD, this);
}

if( !m_filePageActions.GetSafeHwnd() ) {
m_filePageActions.Create(CFilePageActions::IDD, this);
}

if( !m_filePagePrint.GetSafeHwnd() ) {
m_filePagePrint.Create(CFilePagePrint::IDD, this);
}

if( !m_filePageSave.GetSafeHwnd() ) {
m_filePageSave.Create(CFilePageSave::IDD, this);
}

CXTPRibbonBackstageTab* pTabDefault = AddBackstageTab(*pView, m_filePageInfo, ID_MENU_INFO, dTabFlags);
AddBackstageTab(*pView, m_filePageOpen, ID_MENU_OPEN, dTabFlags);
AddBackstageTab(*pView, m_filePageSave, ID_MENU_SAVE, dTabFlags);
AddBackstageTab(*pView, m_filePagePrint, ID_MENU_PRINT, dTabFlags);
AddBackstageTab(*pView, m_filePageOptions, ID_MENU_OPTIONS, dTabFlags);
AddBackstageTab(*pView, m_filePageActions, ID_MENU_ACTIONS, dTabFlags);


or is there similar code missing in the render path for the tab button background to treat that as unselected if the backstage view is visible?
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.141 seconds.