/** * @file XTPPopupPaintManager.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(_XTPPOPUPPAINTMANAGER_H__) # define _XTPPOPUPPAINTMANAGER_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPPopupItem; class CXTPPopupItemText; class CXTPPopupItemIcon; class CXTPPopupControl; /** * @brief * CXTPPopupPaintManager is a class used to perform specialized * drawing tasks. */ class _XTP_EXT_CLASS CXTPPopupPaintManager { public: /** * @brief * Constructs a CXTPPopupPaintManager object. */ CXTPPopupPaintManager(); /** * @brief * Destroys a CXTPPopupPaintManager object. */ virtual ~CXTPPopupPaintManager(); public: /** * @brief * Call this member function to draw the background of a pop-up window. * @param pDC Pointer to the device context. * @param rcClient Size of the area to fill. * @param pControl Pop-up control to draw. */ virtual void DrawBackground(CDC* pDC, CXTPPopupControl* pControl, CRect rcClient); /** * @brief * Call this member function to draw the controlled item object * of a pop-up window. * @param pDC Pointer to the device context. * @param pItem Pointer to a CXTPPopupItem object. */ void DrawItem(CDC* pDC, CXTPPopupItem* pItem); /** * @brief * Call this method to draw the rectangle of a button. * @param pDC Pointer to the device context. * @param pItem Pointer to a CXTPPopupItem object. */ virtual void DrawButton(CDC* pDC, CXTPPopupItem* pItem); /** * @brief * Call this method to draw the icon of a button. * @param pDC Pointer to the device context. * @param pItem Pointer to a CXTPPopupItem object. */ virtual void DrawItemIcon(CDC* pDC, CXTPPopupItem* pItem); /** * @brief * Sets the font for text used in a pop-up control. * @param hFont Font handle to use. */ void SetFont(HFONT hFont); /** * @brief * Call this member function to refresh draw metrics. */ virtual void RefreshMetrics(); public: CXTPPaintManagerColorGradient m_clrBackground; /**< Gradient background color. */ CXTPPaintManagerColorGradient m_clrFrame; /**< 3D frame color. */ CXTPFont m_xtpFontText; /**< Default font of text. */ XTP_SUBSTITUTE_GDI_MEMBER_WITH_CACHED(CFont, m_fntText, m_xtpFontText, GetTextFontHandle); COLORREF m_clrText; /**< Default color of text. */ int m_iButtonBorderInflate; COLORREF m_clrButtonSelected; /**< Color of selected button. */ COLORREF m_clrButtonPressed; /**< Color of pressed button. */ CXTPPaintManagerColorGradient m_clrButtonSelectedBorder; /**< 3D border color of selected button. */ CXTPPaintManagerColorGradient m_clrButtonPressedBorder; /**< 3D border color of pressed button. */ }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(_XTPPOPUPPAINTMANAGER_H__) /** @endcond */