Print Page | Close Window

[RESOLVED]CXTPControlCustom and Office 2010 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=23156
Printed Date: 28 September 2024 at 11:40pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [RESOLVED]CXTPControlCustom and Office 2010 theme
Posted By: Dan
Subject: [RESOLVED]CXTPControlCustom and Office 2010 theme
Date Posted: 06 October 2016 at 6:28am
Hi,

I'm trying to add a custom-made class derived from the MFC CComboBox to our Ribbon Bar next to the Tab captions.  I'm using v16.3.1 of Codejock.

Here is the relevant code ...

m_pComboExt = new CComboBoxExt();
m_pComboExt->Create(CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_CHILD | WS_VISIBLE | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS, CRect(0,0,100,100), this, ID_CMD_SEARCH2);

CXTPControlCustom *pControl = CXTPControlCustom::CreateControlCustom(m_pComboExt);

m_pRibbonBar->GetControls()->Add(pControl, ID_CMD_SEARCH2, nullptr, -1);

The combo-box appears where and I want and is fully functional, BUT, when using any of the Office 2010 themes the text in the Edit box portion of the ComboBox is barely readable.  For some reason it is transparent and so it completely depends on what is behind my application whether you can read the text or not.  The non Office 2010 themes do not have this problem.  The top half of the image shows an Office 2010 theme, the bottom is the Windows 7 Scenic theme.



Please can you give me any ideas about to fix/work-around the problem?





Replies:
Posted By: agontarenko
Date Posted: 08 October 2016 at 7:48am
Hello Dan,

To disable frame transparent option for Office2010 style, you should be set
CXTPCommandBarsFrameHook::m_bAllowDwm = FALSE;

Regards,
Artem Gontarenko 


Posted By: Dan
Date Posted: 10 October 2016 at 9:49am
Hi Artem,

Thanks for the suggestion.  Unfortunately disabling DWM seemed to cause all sorts of problems with the re-drawing of our main application window (which is using OpenGL) so I couldn't do that.

Since all the Office 2007 themes were working - and they only make the very top part of the Window transparent (where the caption and Quick Access Toolbar live) - I decided to try and make the Office 2010 themes have the same behaviour (i.e to disable the transparency behind the Ribbon Bar tab captions).

After looking through the source code I discovered that I could do that by editing the 3 Office 2010 ini files (BlueTheme.ini, BlackTheme.ini and SilverTheme.ini) by changing 

FlatFrame = 1

to

FlatFrame = 0

and re-building the Office2010 style DLL.

It means our application will look a little different now but I think that change is acceptable.  The custom ComboBox now looks as expected.

Thanks,

Dan



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