Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Cannot set background color for status bar buttons
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Cannot set background color for status bar buttons

 Post Reply Post Reply
Author
Message
KarthickG View Drop Down
Newbie
Newbie
Avatar

Joined: 17 February 2019
Location: Belgium
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote KarthickG Quote  Post ReplyReply Direct Link To This Post Topic: Cannot set background color for status bar buttons
    Posted: 21 February 2019 at 3:57am

Hello,

We were using Xtremetoolkit 16.4 with OfficeTheme 2007 without any issue.

We recently upgraded to Xtremetoolkit 18.6 and also integrated OfficeTheme2013. Now we see our status bar buttons do not set the user provided custom background color. It uses the default Office2016 theme color.

To fix it I modified code as CXTPStatusBarThemeOffice2013::DrawStatusBarButtonFace below

void CXTPStatusBarThemeOffice2013::DrawStatusBarButtonFace(CDC *pDC, CRect rcItem, CXTPStatusBarPane *pPane)

{

if (pPane->IsPressed())     pDC->FillSolidRect(rcItem, m_clrButtonBackPushed);

else if (pPane->IsHighlighted()) pDC->FillSolidRect(rcItem, m_clrButtonBackHighlight);

else if (pPane->IsChecked())     pDC->FillSolidRect(rcItem, m_clrButtonBackChecked);


// Hack: Commenting the following line. This overrides the user set custom background color with the default.

//else                             pDC->FillSolidRect(rcItem, m_clrButtonBack);

}

Could you please let us know, if you would consider this as a bug and fix in your libraries? A same or a different fix..

To reproduce the problem, please replace Samples\CommandBars\StatusBar\MainFrm.cpp file with the attached file.

When this sample app. Starts, you can notice 100% in the status bar is with Red background. Change Theme to Office 2013, this button is not red anymore. With the above fix it will be Red.


Thanks & regards,

Karthick


uploads/9333/Sample.zip

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.156 seconds.