Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - [solved] BackStage label controls ignore theme
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[solved] BackStage label controls ignore theme

 Post Reply Post Reply
Author
Message
SvenC View Drop Down
Groupie
Groupie


Joined: 02 February 2007
Status: Offline
Points: 79
Post Options Post Options   Thanks (0) Thanks(0)   Quote SvenC Quote  Post ReplyReply Direct Link To This Post Topic: [solved] BackStage label controls ignore theme
    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
Back to Top
SvenC View Drop Down
Groupie
Groupie


Joined: 02 February 2007
Status: Offline
Points: 79
Post Options Post Options   Thanks (0) Thanks(0)   Quote SvenC Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
SvenC View Drop Down
Groupie
Groupie


Joined: 02 February 2007
Status: Offline
Points: 79
Post Options Post Options   Thanks (0) Thanks(0)   Quote SvenC Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
SvenC View Drop Down
Groupie
Groupie


Joined: 02 February 2007
Status: Offline
Points: 79
Post Options Post Options   Thanks (0) Thanks(0)   Quote SvenC Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.