![]() |
Catching the minimize event for the ribbon |
Post Reply ![]() |
Author | |
TheMcCann ![]() Newbie ![]() Joined: 27 March 2008 Location: United States Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() 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 |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
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 |
|
![]() |
|
TheMcCann ![]() Newbie ![]() Joined: 27 March 2008 Location: United States Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
This worked great! Thanks.
I implemented the fix, but I hope to see it in the next Codejock release too. |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |