Print Page | Close Window

[SOLVED] XTPRibbonControlSystemButton Theme Change

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=23102
Printed Date: 21 November 2024 at 10:51pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [SOLVED] XTPRibbonControlSystemButton Theme Change
Posted By: cpede
Subject: [SOLVED] XTPRibbonControlSystemButton Theme Change
Date Posted: 19 August 2016 at 5:32am
I can't find a way to update the XTPRibbonControlSystemButton theme.

The XTPRibbonControlSystemButton is the first Ribbon button, typically called "File", with the fancy color following the Office themes. E.g. when changing the Office2013 theme from Word to PowerPoint, the color of the XTPRibbonControlSystemButton is not changed. The only way to fix this is to delete and recreate the entire Ribbon. There must be an easier way?

-cpede


-------------
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)



Replies:
Posted By: olebed
Date Posted: 19 August 2016 at 3:45pm
Hello cpede,

I can't reproduce this behavior. Even with v16.4 when backstage doesn't change color, but system button change it.
Please explore RibbonSample for theme changing. It works as expected.

Regards,
 Oleksandr Lebed


Posted By: cpede
Date Posted: 19 August 2016 at 5:48pm
When I e.g. select Office2013 PowerPoint Theme, and switches between Dark and Light Gray sub-theme the sample crashes :-(

But it seems that the sample also recreates the backstage (testing and reusing the individual backstage pages). What exactly generates the repaint of the system button?


-------------
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)


Posted By: olebed
Date Posted: 20 August 2016 at 12:17pm
Originally posted by cpede cpede wrote:

When I e.g. select Office2013 PowerPoint Theme, and switches between Dark and Light Gray sub-theme the sample crashes :-(

Are you sure that use v17.2 of library ?  I fixed this issue on 1st of February 2016 :-)
in RibbonSample
in CMainFrame::OnOptionsStyleOffice2013LtGray() and CMainFrame::OnOptionsStyleOffice2013DkGray()
replace  SetTheme() with SetStyle().

Originally posted by cpede cpede wrote:

But it seems that the sample also recreates the backstage (testing and reusing the individual backstage pages). What exactly generates the repaint of the system button?

SystemButton is drawn with other ribbon controls in cycle in CXTPRibbonBar::DrawCommandBar()

> ToolkitPro1720UD.dll!CXTPRibbonMarkupTheme::DrawRibbonFrameSystemButton(CDC * pDC, CXTPRibbonControlSystemButton * pControl, CRect rc) Line 842 C++
  ToolkitPro1720UD.dll!CXTPRibbonControlSystemButton::Draw(CDC * pDC) Line 101 C++
  ToolkitPro1720UD.dll!CXTPRibbonBar::DrawCommandBar(CDC * pDC, CRect rcClipBox) Line 1631 C++
  ToolkitPro1720UD.dll!CXTPCommandBarAnimation::OnPaint(CPaintDC & paintDC) Line 348 C++
  ToolkitPro1720UD.dll!CXTPCommandBar::OnPaint() Line 1557 C++



Posted By: cpede
Date Posted: 22 August 2016 at 1:55am
Super, thanks I got it to work :-)

-cpede


-------------
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)



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