/** * @file XTPDockingPaneTabThemeNativeWindows11.cpp * * @copyright * (c) 1998-2025 Codejock Software, All Rights Reserved. * * This source file is the property of Codejock Software and must not be * redistributed by any means without the explicit written permission of * Codejock Software. * * The use of this source code is governed by the terms and conditions specified * in the Toolkit Pro license agreement. Codejock Software grants you, as a * single software developer, the limited right to use this software on one * computer only. * * Contact Information: * support@codejock.com * http://www.codejock.com * */ #include "StdAfx.h" #include "Common/XTPTypeId.h" #include "Common/XTPFramework.h" #include "Common/XTPSystemHelpers.h" #include "Common/XTPSynchro.h" #include "Common/XTPApplication.h" #include "Common/XTPSingleton.h" #include "Common/XTPGdiObjects.h" #include "Common/XTPColorManager.h" #include "Common/XTPDrawHelpers.h" #include "TabManager/Includes.h" #include "DockingPane/TabThemes/XTPDockingPaneTabTheme2012.h" #include "DockingPane/TabThemes/XTPDockingPaneTabThemeNativeWindows11.h" #include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" #ifdef _DEBUG # define new DEBUG_NEW # undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif CXTPDockingPaneTabThemeNativeWindows11::CXTPDockingPaneTabThemeNativeWindows11() : CXTPDockingPaneTabTheme2012() { } void CXTPDockingPaneTabThemeNativeWindows11::DrawSingleButton(CDC* pDC, CXTPTabManagerItem* pItem) { CXTPTabPaintManagerColorSet* pColorSet = GetColorSet(); CRect rcItem(pItem->GetRect()); pDC->FillSolidRect(rcItem, pColorSet->GetItemColor(pItem)); switch (pItem->GetTabManager()->GetPosition()) { case xtpTabPositionTop: if (pItem->IsSelected()) { pDC->FillSolidRect(rcItem.left, rcItem.top, XTP_DPI_X(1), rcItem.Height(), pColorSet->m_clrButtonBorder); pDC->FillSolidRect(rcItem.right - XTP_DPI_X(1), rcItem.top, XTP_DPI_X(1), rcItem.Height(), pColorSet->m_clrButtonBorder); pDC->FillSolidRect(rcItem.left, rcItem.top, rcItem.Width(), XTP_DPI_Y(1), pColorSet->m_clrButtonBorder); } else { pDC->FillSolidRect(rcItem.left, rcItem.bottom - XTP_DPI_Y(1), rcItem.Width(), XTP_DPI_Y(1), pColorSet->m_clrButtonBorder); } break; case xtpTabPositionBottom: if (pItem->IsSelected()) { pDC->FillSolidRect(rcItem.left, rcItem.top, XTP_DPI_X(1), rcItem.Height(), pColorSet->m_clrButtonBorder); pDC->FillSolidRect(rcItem.right - XTP_DPI_X(1), rcItem.top, XTP_DPI_X(1), rcItem.Height(), pColorSet->m_clrButtonBorder); pDC->FillSolidRect(rcItem.left, rcItem.bottom - XTP_DPI_Y(1), rcItem.Width(), XTP_DPI_Y(1), pColorSet->m_clrButtonBorder); } else { pDC->FillSolidRect(rcItem.left, rcItem.top + XTP_DPI_Y(1), rcItem.Width(), XTP_DPI_Y(1), pColorSet->m_clrButtonBorder); } break; case xtpTabPositionLeft: if (pItem->IsSelected()) { pDC->FillSolidRect(rcItem.left, rcItem.top, rcItem.Width(), XTP_DPI_Y(1), pColorSet->m_clrButtonBorder); pDC->FillSolidRect(rcItem.left, rcItem.bottom - XTP_DPI_Y(1), rcItem.Width(), XTP_DPI_X(1), pColorSet->m_clrButtonBorder); pDC->FillSolidRect(rcItem.left, rcItem.top, XTP_DPI_X(1), rcItem.Height(), pColorSet->m_clrButtonBorder); } else { pDC->FillSolidRect(rcItem.right - XTP_DPI_X(1), rcItem.top, XTP_DPI_X(1), rcItem.Height(), pColorSet->m_clrButtonBorder); } break; case xtpTabPositionRight: if (pItem->IsSelected()) { pDC->FillSolidRect(rcItem.left, rcItem.top, rcItem.Width(), XTP_DPI_X(1), pColorSet->m_clrButtonBorder); pDC->FillSolidRect(rcItem.left, rcItem.bottom - XTP_DPI_Y(1), rcItem.Width(), XTP_DPI_Y(1), pColorSet->m_clrButtonBorder); pDC->FillSolidRect(rcItem.right - XTP_DPI_X(1), rcItem.top, XTP_DPI_X(1), rcItem.Height(), pColorSet->m_clrButtonBorder); } else { pDC->FillSolidRect(rcItem.left, rcItem.top, XTP_DPI_X(1), rcItem.Height(), pColorSet->m_clrButtonBorder); } break; } m_pPaintManager->DrawSingleButtonIconAndText(pDC, pItem, rcItem, TRUE); }