Print Page | Close Window

Catching the minimize event for the ribbon

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=10603
Printed Date: 06 October 2024 at 12:24pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Catching the minimize event for the ribbon
Posted By: TheMcCann
Subject: Catching the minimize event for the ribbon
Date 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



Replies:
Posted By: Oleg
Date 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


Posted By: TheMcCann
Date 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.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net