[SOLVED]Office 2013 Theme's DrawSplitButtonFrame |
Post Reply |
Author | |
mrmathis
Senior Member Joined: 17 May 2007 Location: United States Status: Offline Points: 105 |
Post Options
Thanks(0)
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
|
|
agontarenko
Admin Group Joined: 25 March 2016 Status: Offline Points: 299 |
Post Options
Thanks(0)
|
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 |
|
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 |