/** * @file XTPFrameThemeNativeWindows11.h * * @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 * */ /** @cond */ #if !defined(__XTPFRAMETHEMENATIVEWINDOWS11_H__) # define __XTPFRAMETHEMENATIVEWINDOWS11_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPPaintManager; class CXTPCommandBarsFrameHook; class CXTPRibbonBar; class _XTP_EXT_CLASS CXTPFrameThemeNativeWindows11 : public CXTPFrameThemeOffice2013 , public IXTPApplicationEvents , private IXTPPaintManagerCustomAccentColorProvider { public: CXTPFrameThemeNativeWindows11(CXTPPaintManager* pPaintManager); virtual ~CXTPFrameThemeNativeWindows11(); public: /** * @brief * This method is called to refresh the visual metrics of the manager. */ virtual void RefreshMetrics(); /** * @brief * This method is called to draw the caption button. * * @param pDC Pointer to device context. * @param rc Bounding rectangle of the button. * @param nId Identifier of the button. * @param bSelected TRUE if the button is highlighted. * @param bPressed TRUE if the button is pressed. * @param bActive TRUE if frame is active. */ virtual void DrawFrameCaptionButton(CDC* pDC, CRect rc, int nId, BOOL bSelected, BOOL bPressed, BOOL bActive); /** * @brief * This method is called to draw the caption button. * * @param pDC Pointer to device context. * @param rc Bounding rectangle of the button. * @param nId Identifier of the button. * @param bSelected TRUE if the button is highlighted. * @param bPressed TRUE if the button is pressed. * @param bActive TRUE if frame is active. * @param pRibbonBar Ribbon bar pointer. */ virtual void DrawFrameCaptionButton(CDC* pDC, CRect rc, int nId, BOOL bSelected, BOOL bPressed, BOOL bActive, CXTPRibbonBar* pRibbonBar); /** * @brief * Call this member function to sets the application state color for the * frame border. * * @param clrState RGB value representing the application state color. Use * COLORREF_NULL to reset back to default value. */ virtual void SetStateColor(COLORREF clrState); /** * @brief * Call this member function to gets the application state color for the * frame border. * * @return * RGB value representing the application state color. */ virtual COLORREF GetStateColor() const; virtual CXTPFrameShadow* CreateShadow(CWnd* pFrame); virtual void OnShadowedFrameActiveStateChanged(BOOL bActive, CWnd* pFrame, CXTPFrameShadow* pShadow); /** * @brief * Loads markup parts from the specified ZIP source. * * @param hZip ZIP source to load markup parts from. * @param pMarkupContext Associated markup context. */ virtual void LoadParts(HZIP hZip, CXTPMarkupContext* pMarkupContext); /** * @brief * Loads markup parts. * * @param bReload Re-loads previously loaded parts if TRUE. */ virtual void LoadParts(BOOL bReload = FALSE); virtual CRect CalcFrameBorder(const CXTPCommandBarsFrameHook* pFrameHook) const; protected: virtual HRGN CalcFrameRegion(CXTPCommandBarsFrameHook* pFrameHook, CSize sz) const; /** * @brief * This method is called to draw the frame if the Ribbon was found. * * @param pDC Pointer to a valid device context. * @param pFrameHook Pointer to a CXTPCommandBarsFrameHook hook object. */ virtual void DrawFrame(CDC* pDC, CXTPCommandBarsFrameHook* pFrameHook); /** * @brief * This method is called to draw the frame border. * * @param pDC Pointer to a valid device context. * @param pFrameHook Pointer to a CXTPCommandBarsFrameHook hook object. */ virtual void DrawFrameBorder(CDC* pDC, CXTPCommandBarsFrameHook* pFrameHook); /** * @todo Add comments */ virtual COLORREF GetFrameCaptionAccentTextColor(BOOL bActive) const; private: void DrawCaptionBarRegion(CDC* pDC, CRect rcCaptionBar, CRgn& rgnCaptionBar, CWnd* pSite, BOOL bActive); virtual void OnAmbientPropertyChanged(CXTPApplication* pApplication, XTPApplicationAmbientProperty nProperty); void UpdateSystemAccentDependentColors(); private: // IXTPPaintManagerCustomAccentColorProvider overrides virtual COLORREF GetCustomAccentColor(XTPPaintManagerAccentColor nColor); protected: COLORREF m_clrShadowColorActive; COLORREF m_clrShadowColorInactive; COLORREF m_clrFrameCaptionBorderActive; COLORREF m_clrFrameCaptionBorderInactive; CXTPModernUIFrameCaptionButton* m_pButtonRestoreActive; CXTPModernUIFrameCaptionButton* m_pButtonRestoreInactive; CXTPModernUIFrameCaptionButton* m_pButtonRestorePressed; CXTPModernUIFrameCaptionButton* m_pButtonRestoreHot; CXTPColorSetCaptionButton m_csFrameSytemAccentCloseButtonActive; CXTPColorSetCaptionButton m_csFrameSytemAccentCloseButtonHot; CXTPColorSetCaptionButton m_csFrameSytemAccentCloseButtonPressed; CXTPColorSetCaptionButton m_csFrameSytemAccentCaptionButtonActive; CXTPColorSetCaptionButton m_csFrameSytemAccentCaptionButtonHot; CXTPColorSetCaptionButton m_csFrameSytemAccentCaptionButtonPressed; COLORREF m_clrFrameCaptionAccentTextActive; CSize m_szWindowCorner; }; /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(__XTPFRAMETHEMENATIVEWINDOWS11_H__) /** @endcond */