/** * @file XTPTaskPanelExplorerThemePlain.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/XTPColorManager.h" #include "TaskPanel/XTPTaskPanelDefines.h" #include "TaskPanel/XTPTaskPanelItem.h" #include "TaskPanel/XTPTaskPanelGroup.h" #include "TaskPanel/XTPTaskPanelPaintManager.h" #include "TaskPanel/Themes/XTPTaskPanelPaintManagerPlain.h" #include "TaskPanel/Themes/XTPTaskPanelExplorerThemePlain.h" #include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" #ifdef _DEBUG # undef THIS_FILE static char THIS_FILE[] = __FILE__; # define new DEBUG_NEW #endif ////////////////////////////////////////////////////////////////////////// /// CXTPTaskPanelExplorerThemePlain CXTPTaskPanelExplorerThemePlain::CXTPTaskPanelExplorerThemePlain() { m_bOfficeHighlight = XTP_TASKPANEL_HIGHLIGHT_OFFICE2003; m_eGripper = xtpTaskPanelGripperBitmap; } CRect CXTPTaskPanelExplorerThemePlain::DrawCaptionGripper(CDC* pDC, CXTPTaskPanelGroup* pGroup, CRect rc) { if (!m_bExplorerTheme) return DrawCaptionGripper(pDC, pGroup, rc); if (!pGroup->IsExpandable()) return rc; if (rc.Width() < XTP_DPI_X(20) + XTP_DPI_X(6)) return rc; return DrawCaptionGripperBitmap(pDC, pGroup, pGroup->IsExpanded(), pGroup->IsItemHot(), rc); } void CXTPTaskPanelExplorerThemePlain::RefreshMetrics() { CXTPTaskPanelPaintManagerPlain::RefreshMetrics(); XTPCurrentSystemTheme systemTheme = XTPColorManager()->GetCurrentSystemTheme(); m_bExplorerTheme = FALSE; if (!m_bEmulateEplorerTheme && (systemTheme == xtpSystemThemeUnknown)) { m_eGripper = xtpTaskPanelGripperPlain; return; } m_bExplorerTheme = TRUE; m_groupNormal.clrClientBorder.SetStandardValue(GetXtremeColor(COLOR_WINDOW)); m_groupSpecial.clrClientBorder.SetStandardValue(GetXtremeColor(COLOR_WINDOW)); switch (systemTheme) { case xtpSystemThemeBlue: { m_clrBackground.SetStandardValue(RGB(123, 162, 231), RGB(99, 117, 214)); m_groupNormal.clrClient.SetStandardValue(RGB(214, 223, 247)); m_groupNormal.clrClientLink.SetStandardValue(RGB(33, 93, 198)); m_groupNormal.clrClientLinkHot.SetStandardValue(RGB(66, 142, 255)); break; } case xtpSystemThemeOlive: { m_clrBackground.SetStandardValue(RGB(204, 217, 173), RGB(165, 189, 132)); m_groupNormal.clrClient.SetStandardValue(RGB(246, 246, 236)); m_groupNormal.clrClientLink.SetStandardValue(RGB(86, 102, 45)); m_groupNormal.clrClientLinkHot.SetStandardValue(RGB(114, 146, 29)); break; } case xtpSystemThemeSilver: { m_clrBackground.SetStandardValue(RGB(196, 200, 212), RGB(177, 179, 200)); m_groupNormal.clrClient.SetStandardValue(RGB(240, 241, 245)); m_groupNormal.clrClientLink.SetStandardValue(RGB(63, 61, 61)); m_groupNormal.clrClientLinkHot.SetStandardValue(RGB(126, 124, 124)); break; } default: { m_clrBackground.SetStandardValue(BlendColor(GetXtremeColor(COLOR_INACTIVECAPTION), GetXtremeColor(COLOR_WINDOW), 128), BlendColor(GetXtremeColor(COLOR_ACTIVECAPTION), GetXtremeColor(COLOR_WINDOW), 192)); COLORREF clrClient = BlendColor(GetXtremeColor(COLOR_3DFACE), GetXtremeColor(COLOR_WINDOW), 24); m_groupNormal.clrClient.SetStandardValue( BlendColor(clrClient, GetXtremeColor(COLOR_ACTIVECAPTION), 230)); m_groupNormal.clrClientLink.SetStandardValue(GetXtremeColor(COLOR_BTNTEXT)); m_groupNormal.clrClientLinkHot.SetStandardValue(GetXtremeColor(COLOR_HIGHLIGHT)); } } m_groupSpecial = m_groupNormal; CreateGripperBitmaps(); }