Print Page | Close Window

CXTPTabClientWnd Client Margin Color

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=23432
Printed Date: 25 April 2024 at 4:05pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPTabClientWnd Client Margin Color
Posted By: cpede
Subject: CXTPTabClientWnd Client Margin Color
Date Posted: 30 August 2017 at 6:01am
When specifying a client margin using
m_MTIClientWnd.GetPaintManager()->m_rcClientMargin
How do I control the color of the margin in the Office theme?

-cpede



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



Replies:
Posted By: cpede
Date Posted: 04 September 2017 at 2:00am
Any comments from CJ?

-cpede


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


Posted By: olebed
Date Posted: 05 September 2017 at 9:17am
Hello cpede,

This color is defined in method GetItemColor() (for Office2013  it is CXTPTabColorSetVisualStudio2012::GetItemColor())   it is taken from CXTPTabPaintManagerColorSet::m_clrButtonSelected.

If you need other color than tab background then you can redefine or change method CXTPTabPaintManagerColorSet::FillClient()

Regards,
 Oleksandr Lebed


Posted By: cpede
Date Posted: 05 September 2017 at 11:09am
Hi,

Sorry not being totally clear here.

The color I'm looking to change is the color appearing when you set a margin to the CXTPTabClientWnd using:
CXTPTabClientWnd m_MTIClientWnd;
m_MTIClientWnd.GetPaintManager()->m_rcClientMargin.SetRect(0,7,0,0);

In this example the white'ish RGB(240, 240, 240) in all themes under the tab:



-cpede


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


Posted By: olebed
Date Posted: 05 September 2017 at 3:38pm
in RibbonMDISample
//    Source\CommandBars\XTPTabClientWnd.cpp

void CXTPTabClientWnd::CheckCommandBarsTheme()
{
.......
    m_pPaintManager->m_rcClientMargin.SetRect(0, 7, 0, 0);    //hardcoded for all cases
.......
}


//    Source\TabManager\XTPTabPaintManagerColorSet.cpp

COLORREF CXTPTabPaintManagerColorSet::FillClient(CDC* pDC, CRect rc, CXTPTabManager* pTabManager)
{
    CXTPTabManagerItem* pItem = pTabManager->GetSelectedItem();

    COLORREF clrClient = RGB(0, 255, 255);    //hardcoded light blue color
    //COLORREF clrClient = pItem ? GetItemColor(pItem) : m_clrButtonSelected;

    pDC->FillSolidRect(rc, clrClient);

    return clrClient;
}


// Office2013Word.ini   hardcoded red color for back of TabClient  CXTPTabPaintManagerTheme::GetColorSet()->m_clrTabClientBack

[TabClient]
Back = 255 0 0




Posted By: cpede
Date Posted: 06 September 2017 at 10:10am
OK, this seems to work when the m_clientFrame is not xtpTabFrameNone.

But I don't want the border, so what if the following is set?
m_MTIClientWnd.GetPaintManager()->m_clientFrame = xtpTabFrameNone;
m_MTIClientWnd.GetPaintManager()->m_bStaticFrame = FALSE;
In this case CXTPTabPaintManagerColorSet::FillClient is never called?

-cpede


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


Posted By: cpede
Date Posted: 18 September 2017 at 2:29am
Any comments from CJ?

-cpede


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


Posted By: cpede
Date Posted: 22 November 2017 at 3:39am
Still a problem in v18.2.0.

-cpede


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


Posted By: adamg
Date Posted: 30 December 2018 at 10:29am
and in 18.6 as well, how to get gap free MDI Tabs?

Adam



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