Print Page | Close Window

How to set statusbar theme?

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=8381
Printed Date: 13 November 2025 at 9:12pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to set statusbar theme?
Posted By: prashant
Subject: How to set statusbar theme?
Date Posted: 10 October 2007 at 7:44am
Hi Oleg,

I have gone through the steps mentioned in following discussion forum to set statusbar theme.

StatusBar Theme?

https://forum.codejock.com/forum_posts.asp?TID=7361&KW=CXTPOffice2003Theme

My Code: (In .CPP file)

class CStatusBarTheme : public CXTPOffice2003Theme
{
   void FillStatusBar(CDC* pDC,CXTPStatusBar* pBar)
   {
      COLORREF m_clrPopupBarGripperShadow; //m_clrPopupBarBorder
      m_clrPopupBarGripperShadow = NULL;
      switch (XTPColorManager()->GetCurrentSystemTheme())
      {   
      case xtpSystemThemeBlue:
         //m_clrPopupBarBorder = RGB(64, 134, 228);
         m_clrPopupBarGripperShadow = RGB(136, 181, 237);
         break;
      case xtpSystemThemeOlive:
         //m_clrPopupBarBorder = RGB(142, 152, 102);
         m_clrPopupBarGripperShadow = RGB(181, 187, 159);
        
         break;
      case xtpSystemThemeSilver:
         //m_clrPopupBarBorder = RGB(166, 167, 193);
         m_clrPopupBarGripperShadow = RGB(226, 226, 225);
         break;
      default:
         m_clrPopupBarGripperShadow =      XTPColorManager()->grcDockBar.clrDark;
         break;
      }     
      pDC->FillSolidRect(CXTPClientRect(pBar), m_clrPopupBarGripperShadow /*grcDockBar.clrDark*/);
   }
};

Call from my function after creating statusbar is as follows:

XTPPaintManager()->SetCustomTheme(new CStatusBarTheme());

But FillStatusBar Never gets called :(

What is the solution for this problem?

Thanks in advance.





Replies:
Posted By: Oleg
Date Posted: 10 October 2007 at 1:58pm
Hi,
 
Did you replace CStatusBar to CXTPStausBar in members of CMainFrame ?


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: MacW
Date Posted: 10 October 2007 at 2:52pm
incidentally...I use a custom type of status bar in my application for some controls.

If I want to match the colors used in these components to the colors used by the XTP status bar, how could I do that. Is there a way to get the colors XTP uses to draw the status bar, even if themes are used?


Posted By: Oleg
Date Posted: 11 October 2007 at 12:34am
See code on top.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: prashant
Date Posted: 11 October 2007 at 1:16am
Hi Oleg,

My class CMyStatusBar is derived from CXTPStatusBar.
Previously I am deriving it from CXTStatusBar.

What might be the problem?

Thanks in advance.


Posted By: MacW
Date Posted: 11 October 2007 at 6:32am
Hi, Oleg

I take that this means that there is no way to "officially" get the status bar colors, except using the hard coded RGB values in the source code? And when CJ later changes the theme, I need to adjust and recompile my application...


Posted By: prashant
Date Posted: 11 October 2007 at 6:50am
Hi,

For getting color of the control you can use:

COLORREF m_clrPopupBarGripperShadow;
m_clrPopupBarGripperShadow = NULL;
m_clrPopupBarGripperShadow = XTPColorManager()->grcDockBar.clrDark;



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net