/** * @file XTPRibbonBackstageButtonThemeVisualStudio2017.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/XTPDrawHelpers.h" #include "Common/XTPResourceImage.h" #include "Common/XTPColorManager.h" #include "Controls/Util/XTPControlTheme.h" #include "Controls/Button/XTPButton.h" #include "Controls/Button/XTPButtonTheme.h" #include "Controls/Button/Themes/XTPButtonThemeUltraFlat.h" #include "Controls/Button/Themes/XTPButtonThemeOffice2013.h" #include "Controls/Button/Themes/XTPButtonThemeVisualStudio2017.h" #include "Ribbon/Backstage/XTPRibbonBackstageButton.h" #include "Ribbon/Backstage/XTPRibbonBackstageSeparator.h" #include "Ribbon/Backstage/XTPRibbonBackstageButtonThemeVisualStudio2017.h" #include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" #ifndef _XTP_ACTIVEX_BUTTON # ifdef _DEBUG # define new DEBUG_NEW # undef THIS_FILE static char THIS_FILE[] = __FILE__; # endif #endif ////////////////////////////////////////////////////////////////////////// // CXTPRibbonBackstageButtonThemeVisualStudio2017 CXTPRibbonBackstageButtonThemeVisualStudio2017::CXTPRibbonBackstageButtonThemeVisualStudio2017() { m_bOffsetHiliteText = FALSE; } void CXTPRibbonBackstageButtonThemeVisualStudio2017::DrawButtonBackground(CDC* pDC, CXTPButton* pButton) { CXTPRibbonBackstageButton* pBackstageButton = (CXTPRibbonBackstageButton*)pButton; if (pBackstageButton->m_bTabStyle) { CWnd* pWndParent = pButton->GetParent(); COLORREF clrSeparator = XTPIniColor(_T("CommandBars.Ribbon.Backstage"), _T("PageSeparator"), RGB(225, 225, 225)); CXTPWindowRect rcButtonScreen(pButton); for (CWnd* pChildWnd = pWndParent->GetWindow(GW_CHILD); pChildWnd != NULL; pChildWnd = pChildWnd->GetWindow(GW_HWNDNEXT)) { #ifdef _XTP_ACTIVEX_BUTTON if (pChildWnd->IsKindOf(RUNTIME_CLASS(CBackstageSeparatorCtrl))) #else if (pChildWnd->IsKindOf(RUNTIME_CLASS(CXTPRibbonBackstageSeparator))) #endif { CXTPWindowRect rcSeparatorScreen(pChildWnd); CRect rcIntersect; if (rcIntersect.IntersectRect(rcButtonScreen, rcSeparatorScreen)) { pButton->ScreenToClient(rcSeparatorScreen); CRect rc(rcSeparatorScreen.right - XTP_DPI_X(1), rcSeparatorScreen.top, rcSeparatorScreen.right, rcSeparatorScreen.bottom); pDC->FillSolidRect(rc, clrSeparator); } } } } CXTPButtonThemeVisualStudio2017::DrawButtonBackground(pDC, pButton); } // This inclusion is necessary for ActiveX build #include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h"