/** * @file XTPFrameThemeModernUI.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(__XTPFRAMETHEMEMODERNUI_H__) # define __XTPFRAMETHEMEMODERNUI_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPRibbonBar; class CXTPPaintManager; class CXTPCommandBarsFrameHook; class CXTPColorSetCaptionButton; class _XTP_EXT_CLASS CXTPModernUIFrameBorder : public CXTPMarkupThemePart { public: /** * @brief * This method sets the border color of the caption button. */ void SetBorderColor(COLORREF clrBorder, COLORREF clrBackground); }; class _XTP_EXT_CLASS CXTPModernUIFrameCaptionButton : public CXTPMarkupThemePart { public: /** * @brief * This method sets the background, outline and fill color of the caption button. */ void SetColors(CXTPColorSetCaptionButton* pColorSet); /** * @brief * This method sets the background color of the caption button. */ void SetBackgroundColor(COLORREF clrBackground); /** * @brief * This method sets the outline color of the caption button. */ void SetOutlineColor(COLORREF clrOutline); /** * @brief * This method sets the stroke color of the caption button. */ void SetStrokeColor(COLORREF clrStroke); /** * @brief * This method sets the fill color of the caption button. */ void SetFillColor(COLORREF clrFill); }; class _XTP_EXT_CLASS CXTPFrameColorSet { public: COLORREF m_clrFrameCaptionActive; /**< Caption color (active)*/ COLORREF m_clrFrameCaptionInactive; /**< Caption color (inactive)*/ }; class _XTP_EXT_CLASS CXTPFrameThemeModernUI : public CXTPRibbonMarkupFrameTheme { DECLARE_DYNAMIC(CXTPFrameThemeModernUI); public: CXTPFrameThemeModernUI(CXTPPaintManager* pPaintManager); virtual ~CXTPFrameThemeModernUI(); public: virtual HRGN CalcFrameRegion(CXTPCommandBarsFrameHook* pFrameHook, CSize sz) const; virtual CRect CalcFrameBorder(const CXTPCommandBarsFrameHook* pFrameHook) const; virtual void DrawFrame(CDC* pDC, CXTPCommandBarsFrameHook* pFrameHook); /** * @brief * This method is called to draw frame caption text. * * @param pDC Pointer to device context. * @param rcCaptionText Bounding rectangle of the window text. * @param pSite Frame to draw. * @param bActive TRUE if the frame is active. */ virtual void DrawCaptionText(CDC* pDC, CRect rcCaptionText, CWnd* pSite, BOOL bActive); /** * @brief * This method is called to draw frame caption text. * * @param pDC Pointer to device context. * @param rcCaptionText Bounding rectangle of the window text. * @param pSite Frame to draw. * @param bActive TRUE if the frame is active. * @param pRibbonBar Ribbon bar pointer. */ virtual void DrawCaptionText(CDC* pDC, CRect rcCaptionText, CWnd* pSite, BOOL bActive, CXTPRibbonBar* pRibbonBar); /** * @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 the 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 the 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 * 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); protected: /** * @brief * This method is called to refresh the visual metrics of the manager. */ virtual void RefreshMetrics(); /** * @brief * Every derived class has to implement this method and return the * name of the STYLE resource that contains all style information. */ virtual LPCTSTR GetStyleResourceName() const = 0; virtual CXTPMarkupThemePart* GetFrameBorder(int nId, BOOL bActive); protected: /** @cond */ _XTP_DEPRECATED_IN_FAVOR(CXTPRibbonMarkupFrameTheme::m_bMarkupPartsLoaded) BOOL m_bLoaded; /** @endcond */ using CXTPRibbonMarkupFrameTheme::m_bMarkupPartsLoaded; CXTPPaintManagerColor m_clrFrameBorderActive; CXTPPaintManagerColor m_clrFrameBorderInactive; CXTPModernUIFrameBorder* m_pBorderLeft; CXTPModernUIFrameBorder* m_pBorderTop; CXTPModernUIFrameBorder* m_pBorderRight; CXTPModernUIFrameBorder* m_pBorderBottom; CXTPColorSetCaptionButton m_csFrameCaptionButtonInactive; CXTPColorSetCaptionButton m_csFrameCaptionButtonActive; CXTPColorSetCaptionButton m_csFrameCaptionButtonHot; CXTPColorSetCaptionButton m_csFrameCaptionButtonPressed; CXTPModernUIFrameCaptionButton* m_pButtonMinimize; CXTPModernUIFrameCaptionButton* m_pButtonMaximize; CXTPModernUIFrameCaptionButton* m_pButtonRestore; CXTPModernUIFrameCaptionButton* m_pButtonClose; }; /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(__XTPFRAMETHEMEMODERNUI_H__) /** @endcond */