/** * @file XTPCaptionTheme.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(__XTPCAPTIONTHEME_H__) # define __XTPCAPTIONTHEME_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPCaption; class CXTPButtonTheme; /** * @brief * CXTPCaptionTheme is a CXTPControlTheme derived class used to control * caption themes. Custom themes may be derived from this class. */ class _XTP_EXT_CLASS CXTPCaptionTheme : public CXTPControlTheme { public: /** * @brief * Constructs a CXTPCaptionTheme object. */ CXTPCaptionTheme(); /** * @brief * This function is called to set the edges of a caption to the * system default colors for edge shadow and edge light. * * @param pCaption Pointer to the CXTPCaption object. */ virtual void RefreshMetrics(CXTPCaption* pCaption); /** * @brief * Call this function to draw the background of the caption at the * location specified in the rcItem rect. * @param pDC A CDC pointer that represents the current device * context. * @param pCaption A pointer to a CXTPCaption object. * @param rcItem Location where the caption is drawn. */ virtual void DrawCaptionBack(CDC* pDC, CXTPCaption* pCaption, CRect& rcItem); /** * @brief * Called by CXTPCaption to draw the caption text. * @param pDC A CDC pointer that represents the current device * context. * @param pCaption A pointer to a CXTPCaption object. */ virtual void DrawCaptionText(CDC* pDC, CXTPCaption* pCaption); /** * @brief * Called by CXTPCaption to draw the caption icon. * @param pDC A CDC pointer that represents the current device * context. * @param pCaption A pointer to a CXTPCaption object. * @param rcItem Location where the caption is drawn. * @details * Call this function to draw the icon on the caption. Only draws the * icon if there is enough space between the caption borders. */ virtual void DrawCaptionIcon(CDC* pDC, CXTPCaption* pCaption, CRect& rcItem); public: CXTPPaintManagerColor m_clrEdgeShadow; /**< The color of the edge shadow for the current theme. */ CXTPPaintManagerColor m_clrEdgeLight; /**< The color of the edge light for the current theme. */ }; /** * @brief * CXTPCaptionThemeOfficeXP is derived from CXTPCaptionTheme. * It is used to set the caption to an Office XP theme. */ class _XTP_EXT_CLASS CXTPCaptionThemeOfficeXP : public CXTPCaptionTheme { public: /** * @brief * Constructs a CXTPCaptionThemeOfficeXP object. */ CXTPCaptionThemeOfficeXP(); protected: /** * @brief * Call this function to draw the background of the caption. * @param pDC A CDC pointer that represents the current device * context. * @param pCaption A pointer to a CXTPCaption object. * @param rcItem CRect object with the size and location where the * caption is drawn. */ virtual void DrawCaptionBack(CDC* pDC, CXTPCaption* pCaption, CRect& rcItem); }; /** * @brief * CXTPCaptionThemeOffice2003 is derived from CXTPCaptionTheme. * It is used to set the caption to an Office 2003 theme. */ class _XTP_EXT_CLASS CXTPCaptionThemeOffice2003 : public CXTPCaptionTheme { public: /** * @brief * Constructs a CXTPCaptionThemeOffice2003 object. */ CXTPCaptionThemeOffice2003(); /** @cond */ CXTPCaptionThemeOffice2003(BOOL bPrimaryCaption); /**< deprecated. */ /** @endcond */ protected: /** * @brief * Call this function to draw the background of the caption. * @param pDC A CDC pointer that represents the current device * context. * @param pCaption A pointer to a CXTPCaption object. * @param rcItem CRect object with the size and location where the * caption is drawn. */ virtual void DrawCaptionBack(CDC* pDC, CXTPCaption* pCaption, CRect& rcItem); }; /** * @brief * CXTPCaptionButtonTheme is derived from CXTPButtonTheme. * This class is used to set the caption for buttons. */ class _XTP_EXT_CLASS CXTPCaptionButtonTheme : public CXTPButtonTheme { public: /** * @brief * Default class constructor. */ CXTPCaptionButtonTheme(); protected: /** * @brief * Call this member function to draw the button caption text. * @param pDC A pointer to a valid device context. * @param pButton A pointer to a valid CXTPButton object. */ virtual void DrawButtonText(CDC* pDC, CXTPButton* pButton); /** * @brief * Call this member function to get the text color of the button caption. * @param pButton A pointer to a valid CXTPButton object. * @return * An RGB value specifying the text color. */ virtual COLORREF GetTextColor(CXTPButton* pButton); /** * @brief * This member function is called to draw the background for the button. * @param pDC A pointer to the target device context. * @param pButton A pointer to a CXTPButton object. */ virtual void DrawButtonBackground(CDC* pDC, CXTPButton* pButton); }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPCAPTIONTHEME_H__) /** @endcond */