/** * @file XTPRibbonBackstageLabel.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 "Controls/Util/XTPControlTheme.h" #include "Ribbon/Backstage/XTPRibbonBackstageLabel.h" #include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" #ifdef _DEBUG # define new DEBUG_NEW # undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CXTPRibbonBackstageLabel CXTPRibbonBackstageLabel::CXTPRibbonBackstageLabel() { RefreshMetrics(); } CXTPRibbonBackstageLabel::~CXTPRibbonBackstageLabel() { } BEGIN_MESSAGE_MAP(CXTPRibbonBackstageLabel, CStatic) //{{AFX_MSG_MAP(CXTPRibbonBackstageLabel) ON_WM_PAINT() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CXTPRibbonBackstageLabel message handlers void CXTPRibbonBackstageLabel::OnPaint() { CPaintDC dcPaint(this); // device context for painting CXTPClientRect rc(this); CXTPBufferDC dc(dcPaint); dc.FillSolidRect(rc, m_clrBack); CXTPFontDC font(&dc, GetFont()); CString strText; GetWindowText(strText); dc.SetTextColor(m_clrText); dc.DrawText(strText, rc, DT_LEFT | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX); } void CXTPRibbonBackstageLabel::SetTheme(XTPControlTheme /*nTheme*/) { RefreshMetrics(); } void CXTPRibbonBackstageLabel::RefreshMetrics() { m_clrText = XTPIniColor(_T("CommandBars.Ribbon.Backstage"), _T("PageText"), RGB(94, 94, 94)); m_clrBack = XTPIniColor(_T("CommandBars.Ribbon.Backstage"), _T("PageBackground"), RGB(255, 255, 255)); }