Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPTabClientWnd Client Margin Color
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPTabClientWnd Client Margin Color

 Post Reply Post Reply
Author
Message
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 668
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Topic: CXTPTabClientWnd Client Margin Color
    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 (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 668
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Posted: 04 September 2017 at 2:00am
Any comments from CJ?

-cpede
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
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: 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
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 668
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post 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 (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
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: 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


Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 668
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post 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 (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 668
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Posted: 18 September 2017 at 2:29am
Any comments from CJ?

-cpede
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 668
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Posted: 22 November 2017 at 3:39am
Still a problem in v18.2.0.

-cpede
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
adamg View Drop Down
Groupie
Groupie


Joined: 16 July 2018
Status: Offline
Points: 32
Post Options Post Options   Thanks (0) Thanks(0)   Quote adamg Quote  Post ReplyReply Direct Link To This Post Posted: 30 December 2018 at 10:29am
and in 18.6 as well, how to get gap free MDI Tabs?

Adam
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.188 seconds.