Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - How to set statusbar theme?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to set statusbar theme?

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

Joined: 19 February 2007
Location: India
Status: Offline
Points: 165
Post Options Post Options   Thanks (0) Thanks(0)   Quote prashant Quote  Post ReplyReply Direct Link To This Post Topic: How to set statusbar theme?
    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.


Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 10 October 2007 at 1:58pm
Hi,
 
Did you replace CStatusBar to CXTPStausBar in members of CMainFrame ?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 11 October 2007 at 12:34am
See code on top.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
prashant View Drop Down
Senior Member
Senior Member
Avatar

Joined: 19 February 2007
Location: India
Status: Offline
Points: 165
Post Options Post Options   Thanks (0) Thanks(0)   Quote prashant Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
MacW View Drop Down
Senior Member
Senior Member


Joined: 26 June 2007
Status: Offline
Points: 253
Post Options Post Options   Thanks (0) Thanks(0)   Quote MacW Quote  Post ReplyReply Direct Link To This Post 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...
Back to Top
prashant View Drop Down
Senior Member
Senior Member
Avatar

Joined: 19 February 2007
Location: India
Status: Offline
Points: 165
Post Options Post Options   Thanks (0) Thanks(0)   Quote prashant Quote  Post ReplyReply Direct Link To This Post 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;
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.063 seconds.