How to change theme in menu from Designer |
Post Reply |
Author | |
rvoith
Groupie Joined: 03 July 2003 Location: Norway Status: Offline Points: 40 |
Post Options
Thanks(0)
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! |
|
rvoith
Groupie Joined: 03 July 2003 Location: Norway Status: Offline Points: 40 |
Post Options
Thanks(0)
|
I received an answer from Oleg C.: GetCommandBars()->SetPaintManager(CXTPPaintManager::Creat eTheme(xtpThemeOffice2000)); |
|
Best regards,
Bob Proud Programmer! |
|
rberlin
Newbie Joined: 17 July 2004 Status: Offline Points: 1 |
Post Options
Thanks(0)
|
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?
|
|
rvoith
Groupie Joined: 03 July 2003 Location: Norway Status: Offline Points: 40 |
Post Options
Thanks(0)
|
Sorry for late answer! Been on a summer holiday! Yep, I noticed the same!
|
|
Best regards,
Bob Proud Programmer! |
|
Maye Johnson
Groupie Joined: 16 October 2004 Status: Offline Points: 40 |
Post Options
Thanks(0)
|
I just came across the same problem. Did you find a solution?
|
|
Maye Johnson
Groupie Joined: 16 October 2004 Status: Offline Points: 40 |
Post Options
Thanks(0)
|
I'm using v9.51, Windows XP, and Visual Studio v6.0.
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
GetCommandBars()->GetPaintManager()->GetIconsInfo()-&g t;bUseDisabledIcons = TRUE;
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Maye Johnson
Groupie Joined: 16 October 2004 Status: Offline Points: 40 |
Post Options
Thanks(0)
|
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!
|
|
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 |