Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Catching the minimize event for the ribbon
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Catching the minimize event for the ribbon

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


Joined: 27 March 2008
Location: United States
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote TheMcCann Quote  Post ReplyReply Direct Link To This Post Topic: Catching the minimize event for the ribbon
    Posted: 12 May 2008 at 1:45pm
What is the best way to catch a minimize event for the ribbon?  I'm using the Office 2007 Black theme for the ribbon and when the ribbon is minimized, the currently selected tab maintains the same black text color, which is hard to see on the dark gray background.  I would like to deselect all tabs when the ribbon is minimized so the tab's captions appear with the default unselected tab's white text color.

Thanks,
Jason
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 13 May 2008 at 1:40am
Hello,
 
Yes, thanks, we agree this problem with 12.0 release.
 
You can replace CRibbonColorSet  class to fix it:
 
class CXTPRibbonTheme::CRibbonColorSet : public CXTPTabPaintManager::CColorSetOffice2003
{
protected:
 void RefreshMetrics()
 {
  CColorSetOffice2003::RefreshMetrics();
 }
 void SetTextColor(CDC* pDC, CXTPTabManagerItem* pItem)
 {
  CXTPRibbonBar* pRibbonBar = ((CXTPRibbonTab*)pItem)->GetRibbonBar();
  
  BOOL bSelected = pItem->IsSelected();
  BOOL bHighlighted = pItem->IsHighlighted();
  BOOL bFocused = pItem->IsFocused();
  if (bSelected && pRibbonBar->IsRibbonMinimized())
  {
   CXTPRibbonControlTab* pControlTab =  (CXTPRibbonControlTab*)pItem->GetTabManager();
   if (pControlTab->GetCommandBar() && pControlTab->GetCommandBar()->IsTrackingMode())
   {
    bFocused = bHighlighted = FALSE;
   }
   else if (pControlTab->GetSelected() && bFocused)
   {
    bFocused = bSelected = FALSE;
    bHighlighted = TRUE;
   }
   else
   {
    bFocused = bSelected = FALSE;
   }
  }
  pDC->SetTextColor(!pItem->IsEnabled() ? m_clrDisabledText: bSelected ? m_clrSelectedText: bHighlighted ? m_clrHighlightText : m_clrNormalText);
 }
};
 
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
TheMcCann View Drop Down
Newbie
Newbie


Joined: 27 March 2008
Location: United States
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote TheMcCann Quote  Post ReplyReply Direct Link To This Post Posted: 13 May 2008 at 2:51pm
This worked great!  Thanks.

I implemented the fix, but I hope to see it in the next Codejock release too.
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.234 seconds.