[SOLVED]Office 2013 Theme's DrawSplitButtonFrame
Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=23024
Printed Date: 23 December 2024 at 10:18pm Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: [SOLVED]Office 2013 Theme's DrawSplitButtonFrame
Posted By: mrmathis
Subject: [SOLVED]Office 2013 Theme's DrawSplitButtonFrame
Date Posted: 14 May 2016 at 9:55am
Has anyone else noticed that in the Office 2013 themes, a split button on the ribbon does not stay "depressed" like in older themes when the command behind it is running? For example, in 2010 Black, here's what my default "Select" command looks like:
However, in any of the Office 2013 themes, I get no highlight color on the Select button.
I traced into the DrawSplitButtonFrame methods on CXTPRibbonTheme and CXTPCommandBarsOffice2013Theme. The latter does not seem to have the former's concessions to the "checked" state. I tweaked the code in a couple of ways to get these images:
I think I'm going with the second version, since it's more consistent with 2010. My changes are show below. Any comments or cautions on them?
void CXTPCommandBarsOffice2013Theme::DrawSplitButtonFrame(CDC* pDC, CXTPControl* pButton, CRect rcButton) { ... BOOL bEnabled = pButton->GetEnabled(); BOOL bSelected = pButton->GetSelected(); BOOL bPopuped = pButton->GetPopuped(); BOOL bPressed = pButton->GetPressed(); BOOL bChecked = pButton->GetChecked(); // in spirit with CXTPRibbonTheme::DrawSplitButtonFrame ...
if (!bEnabled) { DrawRectangle(pDC, pButton); } else if (bPopuped) { pDC->FillSolidRect(rcButton, pColorSet->clrBackChecked); } else if (bSelected || bChecked) // added bChecked { CPoint pt; ::GetCursorPos(&pt); pCmdBar->ScreenToClient(&pt);
if (rcPartB.PtInRect(pt)) { pDC->FillSolidRect(rcPartB, pColorSet->clrBackHighlight); } else { // hilite just the top part of the button // pDC->FillSolidRect(rcPartA, (bPressed || bChecked) ? pColorSet->clrBackPushed : pColorSet->clrBackHighlight);
// hilite the entire button if (bChecked) { pDC->FillSolidRect(rcButton, pColorSet->clrBackPushed); } else // default Codejock behavior { pDC->FillSolidRect(rcPartA, bPressed ? pColorSet->clrBackPushed : pColorSet->clrBackHighlight); } } pDC->Draw3dRect(rcButton, pColorSet->clrBorderHighlight, pColorSet->clrBorderHighlight); }
------------- --Mike
|
Replies:
Posted By: agontarenko
Date Posted: 13 July 2016 at 9:35am
Hello
mrmathis,
I'm glad to inform you that the issue has already fixed.
The fix will be available in the next beta or final release.
Regards, Artem Gontarenko
|
|