/** * @file XTPButtonTheme.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(__XTPBUTTONTHEME_H__) # define __XTPBUTTONTHEME_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPButton; class CXTPWinThemeWrapper; # define CBR_CLIENTRECT 0 # define CBR_CHECKBOX 1 # define CBR_RADIOBOX 2 # define CBR_CHECKTEXT 3 # define CBR_RADIOTEXT 4 # define CBR_GROUPTEXT 5 # define CBR_GROUPFRAME 6 # define CBR_PUSHBUTTON 7 /** * @brief * CXTPButtonTheme is a class used to perform Button Theme drawing tasks. * This is the base class for all button themes. */ class _XTP_EXT_CLASS CXTPButtonTheme : public CXTPControlTheme { public: /** * @brief * Constructs a CXTPButtonTheme object. */ CXTPButtonTheme(); /** * @brief * Destroys a CXTPButtonTheme object, handles cleanup and deallocation. */ virtual ~CXTPButtonTheme(); /** * @brief * This member function is called to draw the background for the button. * @param pDC A CDC pointer that represents the current device context. * @param pButton Pointer to a CXTPButton object. */ virtual void DrawButtonBackground(CDC* pDC, CXTPButton* pButton); /** * @brief * This member function is called to draw the focus rectangle for the button. * @param pDC A CDC pointer that represents the current device context. * @param pButton Pointer to a CXTPButton object. */ virtual void DrawFocusRect(CDC* pDC, CXTPButton* pButton); /** * @brief * This member function is called to the button. * @param pDC A CDC pointer that represents the current device context. * @param pButton Pointer to a CXTPButton object. */ virtual void DrawButton(CDC* pDC, CXTPButton* pButton); /** * @brief * This member function is called to draw the styled background for the button. * @param pDC A CDC pointer that represents the current device context. * @param pButton Pointer to a CXTPButton object. */ virtual void DrawButtonVisualStyleBackground(CDC* pDC, CXTPButton* pButton); /** * @brief * This member function is called by the theme manager to refresh * the visual styles used by each component's theme. * @param pButton Pointer to a CXTPButton object. */ virtual void RefreshMetrics(CXTPButton* pButton); /** * @brief * This member function is called to draw the text for the button. * @param pDC A CDC pointer that represents the current device context. * @param pButton Pointer to a CXTPButton object. */ virtual void DrawPushButtonText(CDC* pDC, CXTPButton* pButton); /** * @brief * This member function draws the icon for the button, if one has been defined. * @param pDC A CDC pointer that represents the current device context. * @param pButton Pointer to a CXTPButton object. */ virtual void DrawPushButtonIcon(CDC* pDC, CXTPButton* pButton); /** * @brief * This member function draws the dropdown for the button, if one has been defined. * @param pDC A CDC pointer that represents the current device context. * @param pButton Pointer to a CXTPButton object. */ virtual void DrawPushButtonDropDown(CDC* pDC, CXTPButton* pButton); /** * @brief * Call this member function to return the color used to draw the button text. * @param pButton Pointer to a CXTPButton object. * @return * An RGB value that represents the button text color. */ virtual COLORREF GetTextColor(CXTPButton* pButton); /** * @brief * This member function draws the check box mark for the button, if one has been defined. * @param pDC A CDC pointer that represents the current device context. * @param pButton Pointer to a CXTPButton object. */ virtual void DrawCheckBoxMark(CDC* pDC, CXTPButton* pButton); /** * @brief * This member function draws the radio button mark for the button, if one has been defined. * @param pDC A CDC pointer that represents the current device context. * @param pButton Pointer to a CXTPButton object. */ virtual void DrawRadioButtonMark(CDC* pDC, CXTPButton* pButton); /** * @brief * This member function is called to draw the text for the button. * @param pDC A CDC pointer that represents the current device context. * @param pButton Pointer to a CXTPButton object. */ void DrawButtonText(CDC* pDC, CXTPButton* pButton); /** * @brief * This member function draws the group box for the button, if one has been defined. * @param pDC A CDC pointer that represents the current device context. * @param pButton Pointer to a CXTPButton object. */ virtual void DrawGroupBox(CDC* pDC, CXTPButton* pButton); void CalcRects(CDC* pDC, CXTPButton* pButton, CRect* pButtonText, UINT* pDrawFlags, CRect* pButtonIcon); void CalcRect(CDC* pDC, CXTPButton* pButton, LPRECT lprc, int code); BOOL IsVisualThemeUsed(CXTPButton* pButton); void AlphaEllipse(CDC* pDC, CRect rc, COLORREF clrBorder, COLORREF clrFace); void EnableToolbarStyle(BOOL bEnable) { m_bToolbarStyle = bEnable; } CXTPPaintManagerColor m_crTextDisabled; /**< RGB value for disabled text color. */ CXTPPaintManagerColor m_crBorderHilite; /**< RGB value for border highlight color. */ CXTPPaintManagerColor m_crBorderShadow; /**< RGB value for border shadow color. */ CXTPPaintManagerColor m_crBorder3DHilite; /**< RGB value for 3D border highlight color. */ CXTPPaintManagerColor m_crBorder3DShadow; /**< RGB value for 3D border shadow color. */ CXTPPaintManagerColor m_crBack; /**< RGB value for background color. */ CXTPPaintManagerColor m_crText; /**< RGB value for text color. */ CXTPPaintManagerColor m_crTextCheck; /**< RGB value for checked text color. */ CXTPWinThemeWrapper* m_themeButton; BOOL m_bOffsetHiliteText; int m_nBorderWidth; BOOL m_bFlatGlyphs; BOOL m_bToolbarStyle; int m_cxBorder; int m_cyBorder; int m_cyEdge; int m_cxEdge; }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPBUTTONTHEME_H__) /** @endcond */