Print Page | Close Window

How to change theme in menu from Designer

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=931
Printed Date: 25 June 2024 at 1:41am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to change theme in menu from Designer
Posted By: rvoith
Subject: How to change theme in menu from Designer
Date Posted: 13 July 2004 at 2:30am

I am struggeling with theme-switching in command bars loaded from Designer created XCB files. I know I can set the theme with Command Bar Designer in Command Bars - > Settings -> Paint Manager. This works and change the theme. However, I would also be able to switch the theme at runtime, much like other samples in the toolkit. Unfortunately I can't get my test app. to repaint the command bar .

Let say I set the initial theme to Office2003 (xtpThemeOffice2000) in XCB file, and recompile. The app. start up with the correct theme. In my test app. I have added a menu handler method for one of the default themes, such as;

void CMainFrame::OnThemeDefault()

{

m_paneManager.SetTheme(xtpPaneThemeDefault);

CXTPPaintManager::SetTheme(xtpThemeOffice2000);

// GetCommandBars()->GetPaintManager()->SetTheme(xtpTheme Office2000);

RecalcLayout(FALSE);

GetCommandBars()->RedrawCommandBars();

RedrawWindow();

}

As you see I have tested a few approaches. None of them repaint the command bar properly. I suspect I have to connect the default paint manager to the command bar, but haven't succeeded. Any ideas ?



-------------
Best regards,
Bob
Proud Programmer!



Replies:
Posted By: rvoith
Date Posted: 15 July 2004 at 1:37am

I received an answer from Oleg C.:

GetCommandBars()->SetPaintManager(CXTPPaintManager::Creat eTheme(xtpThemeOffice2000));



-------------
Best regards,
Bob
Proud Programmer!


Posted By: rberlin
Date Posted: 18 July 2004 at 5:33pm

I tried this and it seems to work except for the disabled icons.  The quality of the disabled icons gets really bad.  Is this happening in your code.  If you add this command to the designer example, you will see what I mean.

I tried setting use "Disable Icons" and it did not seem to help.  Not sure what this actually does (I believe it may use the icons from the designer versus on the fly). 

Do you have a solution to make them look better or use the disabled icons from the designer after setting a new theme?

 



Posted By: rvoith
Date Posted: 26 July 2004 at 1:41am
Sorry for late answer! Been on a summer holiday! Yep, I noticed the same!

-------------
Best regards,
Bob
Proud Programmer!


Posted By: Maye Johnson
Date Posted: 19 January 2005 at 3:01am
I just came across the same problem.  Did you find a solution?

Originally posted by rberlin rberlin wrote:

I tried this and it seems to work except for the disabled icons.  The quality of the disabled icons gets really bad.  Is this happening in your code.  If you add this command to the designer example, you will see what I mean.

I tried setting use "Disable Icons" and it did not seem to help.  Not sure what this actually does (I believe it may use the icons from the designer versus on the fly). 

Do you have a solution to make them look better or use the disabled icons from the designer after setting a new theme?

 



Posted By: Maye Johnson
Date Posted: 19 January 2005 at 12:37pm
I'm using v9.51, Windows XP, and Visual Studio v6.0.


Posted By: Oleg
Date Posted: 20 January 2005 at 1:15am
GetCommandBars()->GetPaintManager()->GetIconsInfo()-&g t;bUseDisabledIcons = TRUE;

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


Posted By: Maye Johnson
Date Posted: 20 January 2005 at 7:30am
That fixed it!  I was already doing that, but in OnCreate(), so I moved that code to my routine that sets the paint theme.  So obvious to me now ... thanks for the awesome and fast help!



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