![]() |
How to set statusbar theme? |
Post Reply
|
| Author | |
prashant
Senior Member
Joined: 19 February 2007 Location: India Status: Offline Points: 165 |
Post Options
Thanks(0)
Quote Reply
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. |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 10 October 2007 at 1:58pm |
|
Hi,
Did you replace CStatusBar to CXTPStausBar in members of CMainFrame ?
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
MacW
Senior Member
Joined: 26 June 2007 Status: Offline Points: 253 |
Post Options
Thanks(0)
Quote Reply
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? |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 11 October 2007 at 12:34am |
|
See code on top.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
prashant
Senior Member
Joined: 19 February 2007 Location: India Status: Offline Points: 165 |
Post Options
Thanks(0)
Quote Reply
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. |
|
![]() |
|
MacW
Senior Member
Joined: 26 June 2007 Status: Offline Points: 253 |
Post Options
Thanks(0)
Quote Reply
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... |
|
![]() |
|
prashant
Senior Member
Joined: 19 February 2007 Location: India Status: Offline Points: 165 |
Post Options
Thanks(0)
Quote Reply
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; |
|
![]() |
|
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 |