/** * @file XTPExcelTabCtrlTheme.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(__XTPEXCELTABCTRLTHEME_H__) # define __XTPEXCELTABCTRLTHEME_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPTcbItem; class CXTPExcelTabCtrl; class CXTPExcelTabCtrlButtonState; /** * @brief * CXTPExcelTabCtrlTheme is used to draw the CXTPExcelTabCtrl object. All * themes used for CXTPExcelTabCtrl should inherit from this base class. */ class _XTP_EXT_CLASS CXTPExcelTabCtrlTheme : public CXTPControlTheme { public: /** * @brief * Constructs a CXTPExcelTabCtrlTheme object. */ CXTPExcelTabCtrlTheme(); /** * @brief * Destroys a CXTPExcelTabCtrlTheme object, handles cleanup and deallocation. */ ~CXTPExcelTabCtrlTheme(); public: /** * @brief * Call this function to refresh the flat tab control colors, position * any scroll bars to their default positions, and then reset * the control to the system defaults. * @param pTab Pointer to the CXTPExcelTabCtrl object. */ virtual void RefreshMetrics(CXTPExcelTabCtrl* pTab); public: /** * @brief * This member function will draw a tab to the device context specified * by 'pDC'. * @param pDC A CDC pointer that represents the current device * context. * @param pTabCtrl A pointer to a CXTPExcelTabCtrl object. * @param pt A CPoint object that specifies the position of the XY * location of the top left corner of the tab to draw. * @param bSelected true if the tab is currently selected. * @param pTcbItem Tab pointer to render. * @return * The x position of the next tab to be drawn if successful, otherwise -1. */ virtual int DrawTab(CDC* pDC, CXTPExcelTabCtrl* pTabCtrl, const CPoint& pt, bool bSelected, CXTPTcbItem* pTcbItem); /** * @brief * This member function is used by the flat tab control to draw an arrow * button to the device context specified by 'pDC'. * @param pDC A CDC pointer that represents the current device * context. * @param pTabCtrl A pointer to a CXTPExcelTabCtrl object. * @param state The XY location of the top left corner of the tab to draw. */ virtual void DrawButton(CDC* pDC, CXTPExcelTabCtrl* pTabCtrl, const CXTPExcelTabCtrlButtonState& state); /** * @brief * Call this member function to draw the background of the button. * @param pDC A pointer to a valid device context. * @param rect A CRect object that contains the location and dimensions * of the button. * @param state A CXTPExcelTabCtrlButtonState that contains the current * state of the button. */ virtual void DrawButtonBack(CDC* pDC, CRect& rect, const CXTPExcelTabCtrlButtonState& state); /** * @brief * This member function is called to fill the background area for the * tab control. * @param pDC A CDC pointer that represents the current device context. * @param rect A CRect object that contains the location and dimensions * of the tab control. * @param bBottom TRUE if the tab control is orientated at the bottom of * the screen. */ virtual void FillBackground(CDC* pDC, CRect& rect, BOOL bBottom); /** * @brief * This member function is called to fill the background area that is * occupied by the tab strip. * @param pDC A CDC pointer that represents the current device context. * @param cx Width in pixels of the tab background to fill. * @param cy Height in pixels of the tab background to fill. */ virtual void FillTabsBackground(CDC* pDC, int cx, int cy); /** * @brief * This member function will draw the horizontal sizing gripper at a * specified location. * @param pDC Pointer to the device context to draw the gripper to. * @param rect Location of the gripper. */ virtual void DrawGripper(CDC* pDC, CRect rect); /** * @brief * This member function gets an RGB value that represents the background * color of the tab. * @param pTcbItem The tab pointer to get the background color for. * @return * An RGB value that represents the tab background color if successful, * otherwise COLORREF_NULL. */ virtual COLORREF GetTabBackColor(CXTPTcbItem* pTcbItem) const; /** * @brief * This member function gets an RGB value that represents the text color * of the tab. * @param pTcbItem The tab pointer to get the text color for. * @return * An RGB value that represents the tab text color if successful, * otherwise COLORREF_NULL. */ virtual COLORREF GetTabTextColor(CXTPTcbItem* pTcbItem) const; /** * @brief * This member function gets an RGB value that represents the background * color for selected tabs. * @param pTcbItem The tab pointer to get the selected background color for. * @return * An RGB value that represents the selected tabs background color if * successful, otherwise COLORREF_NULL. */ virtual COLORREF GetSelTabBackColor(CXTPTcbItem* pTcbItem) const; /** * @brief * This member function gets an RGB value that represents the text color * for selected tabs. * @param pTcbItem The tab pointer to get the selected text color for. * @return * An RGB value that represents the selected tab text color if * successful, otherwise COLORREF_NULL. */ virtual COLORREF GetSelTabTextColor(CXTPTcbItem* pTcbItem) const; CXTPPaintManagerColor m_clr3DFace; /**< An RGB value that represents the normal tab face color. */ CXTPPaintManagerColor m_clr3DFacePushed; /**< An RGB value for pushed background color. */ CXTPPaintManagerColor m_clr3DFaceHilite; /**< An RGB value for highlighted background color. */ CXTPPaintManagerColor m_clrBtnText; /**< An RGB value that represents the tab outline color. */ CXTPPaintManagerColor m_clrBtnTextGray; /**< An RGB value for disabled text color. */ CXTPPaintManagerColor m_clrBtnTextPushed; /**< An RGB value for highlighted text color. */ CXTPPaintManagerColor m_clrBtnTextHilite; /**< An RGB value for pushed text color. */ CXTPPaintManagerColor m_clrWindow; /**< An RGB value that represents the selected tab face color. */ CXTPPaintManagerColor m_clrWindowText; /**< An RGB value that represents the tab text color. */ CXTPPaintManagerColor m_clr3DHilight; /**< An RGB value that represents the tab highlight color. */ CXTPPaintManagerColor m_clr3DShadow; /**< An RGB value that represents the tab shadow color. */ CXTPPaintManagerColor m_clrBorder3DHilite; /**< An RGB value for 3D border highlight color. */ CXTPPaintManagerColor m_clrBorder3DShadow; /**< An RGB value for 3D border shadow color. */ }; /** * @brief * This class is used to draw a CXTPTabCtrl object using Excel Office XP theme. */ class _XTP_EXT_CLASS CXTPExcelTabCtrlThemeOfficeXP : public CXTPExcelTabCtrlTheme { public: /** * @brief * Constructs a CXTPExcelTabCtrlThemeOfficeXP object. */ CXTPExcelTabCtrlThemeOfficeXP(); /** * @brief * This member function is called by the theme manager to refresh * the visual styles used by each component's theme. * @param pTab Pointer to the CXTPExcelTabCtrl object. */ virtual void RefreshMetrics(CXTPExcelTabCtrl* pTab); /** * @brief * Call this member function to draw the background of the button. * @param pDC A pointer to a valid device context. * @param rect A CRect object that contains the location and dimensions * of the button. * @param state A CXTPExcelTabCtrlButtonState that contains the current * state of the button. */ virtual void DrawButtonBack(CDC* pDC, CRect& rect, const CXTPExcelTabCtrlButtonState& state); }; /** * @brief * This class is used to draw a CXTPTabCtrl object using Excel Office 2003 theme. */ class _XTP_EXT_CLASS CXTPExcelTabCtrlThemeOffice2003 : public CXTPExcelTabCtrlThemeOfficeXP { public: /** * @brief * Constructs a CXTPExcelTabCtrlThemeOffice2003 object. */ CXTPExcelTabCtrlThemeOffice2003(); /** * @brief * This member function is called by the theme manager to refresh * the visual styles used by each component's theme. * @param pTab Pointer to the CXTPExcelTabCtrl object. */ virtual void RefreshMetrics(CXTPExcelTabCtrl* pTab); /** * @brief * Call this member function to draw the background of the button. * @param pDC A pointer to a valid device context. * @param rect A CRect object that contains the location and dimensions * of the button. * @param state A CXTPExcelTabCtrlButtonState that contains the current * state of the button. */ virtual void DrawButtonBack(CDC* pDC, CRect& rect, const CXTPExcelTabCtrlButtonState& state); }; /** * @brief * This class is used to draw a CXTPTabCtrl object using Excel Office 2013 theme. */ class _XTP_EXT_CLASS CXTPExcelTabCtrlThemeOffice2013 : public CXTPExcelTabCtrlTheme { public: /** * @brief * Constructs a CXTPExcelTabCtrlThemeOffice2013 object. */ CXTPExcelTabCtrlThemeOffice2013(); /** * @brief * This member function is called by the theme manager to refresh * the visual styles used by each component's theme. * * @param pTab Pointer to the CXTPExcelTabCtrl object. */ virtual void RefreshMetrics(CXTPExcelTabCtrl* pTab); /** * @brief * This member function will draw a tab to the device context specified * by 'pDC'. * @param pDC A CDC pointer that represents the current device * context. * @param pTabCtrl A pointer to a CXTPExcelTabCtrl object. * @param pt A CPoint object that specifies the position of the XY * location of the top left corner of the tab to draw. * @param bSelected true if the tab is currently selected. * @param pTcbItem Tab pointer to render. * @return * The x position of the next tab to be drawn if successful, otherwise -1. */ virtual int DrawTab(CDC* pDC, CXTPExcelTabCtrl* pTabCtrl, const CPoint& pt, bool bSelected, CXTPTcbItem* pTcbItem); /** * @brief * Call this member function to draw the background of the button. * @param pDC A pointer to a valid device context. * @param rect A CRect object that contains the location and dimensions * of the button. * @param state A CXTPExcelTabCtrlButtonState that contains the current * state of the button. */ virtual void DrawButtonBack(CDC* pDC, CRect& rect, const CXTPExcelTabCtrlButtonState& state); /** * @brief * This member function is used by the flat tab control to draw an arrow * button to the device context specified by 'pDC'. * @param pDC A CDC pointer that represents the current device * context. * @param pTabCtrl A pointer to a CXTPExcelTabCtrl object. * @param state The XY location of the top left corner of the tab to draw. */ virtual void DrawButton(CDC* pDC, CXTPExcelTabCtrl* pTabCtrl, const CXTPExcelTabCtrlButtonState& state); /** * @brief * This member function is called to fill the background area for the * tab control. * @param pDC A CDC pointer that represents the current device context. * @param rect A CRect object that contains the location and dimensions * of the tab control. * @param bBottom TRUE if the tab control is orientated at the bottom of * the screen. */ virtual void FillBackground(CDC* pDC, CRect& rect, BOOL bBottom); /** * @brief * This member function is called to fill the background area that is * occupied by the tab strip. * @param pDC A CDC pointer that represents the current device context. * @param cx Width in pixels of the tab background to fill. * @param cy Height in pixels of the tab background to fill. */ virtual void FillTabsBackground(CDC* pDC, int cx, int cy); /** * @brief * This member function will draw the horizontal sizing gripper at a * specified location. * @param pDC Pointer to the device context to draw the gripper to. * @param rect Location of the gripper. */ virtual void DrawGripper(CDC* pDC, CRect rect); }; /** * @brief * This class is used to draw a CXTPExcelTabCtrlThemeVisualStudio2015 object using Excel Visual * Studio 2015 theme. */ class _XTP_EXT_CLASS CXTPExcelTabCtrlThemeVisualStudio2015 : public CXTPExcelTabCtrlThemeOffice2013 { public: /** * @brief * Constructs a CXTPExcelTabCtrlThemeVisualStudio2015 object. */ CXTPExcelTabCtrlThemeVisualStudio2015(); }; /** * @brief * This class is used to draw a CXTPExcelTabCtrlThemeVisualStudio2017 object using Excel Visual * Studio 2017 theme. */ class _XTP_EXT_CLASS CXTPExcelTabCtrlThemeVisualStudio2017 : public CXTPExcelTabCtrlThemeOffice2013 { public: /** * @brief * Constructs a CXTPExcelTabCtrlThemeVisualStudio2017 object. */ CXTPExcelTabCtrlThemeVisualStudio2017(); }; /** * @brief * This class is used to draw a CXTPExcelTabCtrlThemeVisualStudio2019 object using Excel Visual * Studio 2019 theme. */ class _XTP_EXT_CLASS CXTPExcelTabCtrlThemeVisualStudio2019 : public CXTPExcelTabCtrlThemeOffice2013 { public: /** * @brief * Constructs a CXTPExcelTabCtrlThemeVisualStudio2019 object. */ CXTPExcelTabCtrlThemeVisualStudio2019(); }; /** * @brief * This class is used to draw a CXTPExcelTabCtrlThemeVisualStudio2022 object using Excel Visual * Studio 2022 theme. */ class _XTP_EXT_CLASS CXTPExcelTabCtrlThemeVisualStudio2022 : public CXTPExcelTabCtrlThemeOffice2013 { public: /** * @brief * Constructs a CXTPExcelTabCtrlThemeVisualStudio2022 object. */ CXTPExcelTabCtrlThemeVisualStudio2022(); }; /** * @brief * This class is used to draw a CXTPTabCtrl object using Excel Native Windows 10 theme. */ class _XTP_EXT_CLASS CXTPExcelTabCtrlThemeNativeWindows10 : public CXTPExcelTabCtrlThemeOffice2013 { public: /** * @brief * Constructs a CXTPExcelTabCtrlThemeNativeWindows10 object. */ CXTPExcelTabCtrlThemeNativeWindows10(); }; /** * @brief * This class is used to draw a CXTPTabCtrl object using Excel Native Windows 11 theme. */ class _XTP_EXT_CLASS CXTPExcelTabCtrlThemeNativeWindows11 : public CXTPExcelTabCtrlThemeOffice2013 { public: /** * @brief * Constructs a CXTPExcelTabCtrlThemeNativeWindows10 object. */ CXTPExcelTabCtrlThemeNativeWindows11(); }; ///////////////////////////////////////////////////////////////////////////// # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPEXCELTABCTRLTHEME_H__) /** @endcond */