Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - [SOLVED]Office 2013 Theme's DrawSplitButtonFrame
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED]Office 2013 Theme's DrawSplitButtonFrame

 Post Reply Post Reply
Author
Message
mrmathis View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 May 2007
Location: United States
Status: Offline
Points: 105
Post Options Post Options   Thanks (0) Thanks(0)   Quote mrmathis Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED]Office 2013 Theme's DrawSplitButtonFrame
    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
Back to Top
agontarenko View Drop Down
Admin Group
Admin Group


Joined: 25 March 2016
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote agontarenko Quote  Post ReplyReply Direct Link To This Post 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
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.219 seconds.