Print Page | Close Window

[solved] BackStage label controls ignore theme

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=22936
Printed Date: 05 October 2024 at 5:20am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [solved] BackStage label controls ignore theme
Posted By: SvenC
Subject: [solved] BackStage label controls ignore theme
Date Posted: 23 February 2016 at 4:52am
When I use the Office 2013 theme the background color gets set to light grey for the large right backstage area and the command area on the left has a dark blue background.

But label controls on the right side get a white background (tried transparent style, didn't help).

If the label height is higher than the text height, the bottom background of the label area is dark blue.

This is a regression compared to 16.3 and 17.0



I tried SetTheme on the labels, but looking at the impl that does nothing.

The backstage theme was set by calling SetTheme on the CXTPRibbonBackstageView.

Any workarounds?


-------------
--
SvenC

Toolkit Pro 15.3.1, 16.2.4, 16.3.1, 16.4.0, 17.2.0, 17.3.0, 18.0.1, 18.2 with VC++ 2010, 2012, 2013, 2015, 2017



Replies:
Posted By: SvenC
Date Posted: 23 February 2016 at 5:20am
One more note: making the window smaller and larger again leaves the dark blue areas of the labels black. So redraw makes it even worse.

-------------
--
SvenC

Toolkit Pro 15.3.1, 16.2.4, 16.3.1, 16.4.0, 17.2.0, 17.3.0, 18.0.1, 18.2 with VC++ 2010, 2012, 2013, 2015, 2017


Posted By: olebed
Date Posted: 24 February 2016 at 2:48am
Hello SvenC,

What version of ToolKitPro do you use to get this issues ?

Did you try to use last v17.1?  It has fixed backstage for themes office2013 and VS2015.

Regards,
 Oleksandr Lebed


Posted By: SvenC
Date Posted: 24 February 2016 at 3:42am
This is new to 17.1

Worked correctly with 17.0


-------------
--
SvenC

Toolkit Pro 15.3.1, 16.2.4, 16.3.1, 16.4.0, 17.2.0, 17.3.0, 18.0.1, 18.2 with VC++ 2010, 2012, 2013, 2015, 2017


Posted By: olebed
Date Posted: 24 February 2016 at 3:52am
There are some changes in setting theme for backstage and its elements.
You can use RibbonSample as example.

See next methods:
void CMainFrame::SetBackstageTheme()
{
XTPPaintTheme nPaintTheme = GetCommandBars()->GetPaintManager()->GetCurrentTheme();
XTPControlTheme nTheme = xtpControlThemeResource;
switch (nPaintTheme)
{
case xtpThemeOffice2013: nTheme = xtpControlThemeOffice2013; break;
case xtpThemeVisualStudio2015: nTheme = xtpControlThemeVisualStudio2015; break;
default: nTheme = xtpControlThemeResource;
}

CXTPRibbonBar *pRibbonBar = (CXTPRibbonBar*)GetCommandBars()->GetMenuBar();
CXTPRibbonBackstageView *pView = DYNAMIC_DOWNCAST(CXTPRibbonBackstageView, pRibbonBar->GetSystemButton()->GetCommandBar());

if (pView)
pView->SetTheme(nPaintTheme);

if (m_pageInfo.GetSafeHwnd())
{
m_pageInfo.SetTheme(nTheme);
...


CMainFrame::OnOptionsStyleOffice2013, CBackstagePageInfo::SetTheme



Posted By: SvenC
Date Posted: 24 February 2016 at 10:28am
That got me into the right direction: I overwrote CXTPRibbonBackstagePage::SetTheme and missed to call the base implementation. After adding this line in my override all is well again:

  CXTPRibbonBackstagePage::SetTheme(nTheme);

Thumbs Up


-------------
--
SvenC

Toolkit Pro 15.3.1, 16.2.4, 16.3.1, 16.4.0, 17.2.0, 17.3.0, 18.0.1, 18.2 with VC++ 2010, 2012, 2013, 2015, 2017



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