/** * @file XTPTreeTheme.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(__XTPTREETHEME_H__) # define __XTPTREETHEME_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPTreeBase; /** * @brief * CXTPTreeTheme is a class used to perform tree control theme * drawing tasks. This is the base class for all tree themes. */ class _XTP_EXT_CLASS CXTPTreeTheme : public CXTPControlTheme { public: /** * @brief * Constructs a CXTPTreeTheme object. */ CXTPTreeTheme(); /** * @brief * Destroys a CXTPTreeTheme object, handles cleanup and deallocation. */ virtual ~CXTPTreeTheme(); /** * @brief * This member function performs initialization for the tree theme. * @param pTreeBase Pointer to a valid CXTPTreeBase object. * @details * Initializes all drawing defaults such as colors. */ virtual void RefreshMetrics(CXTPTreeBase* pTreeBase); /** * @brief * This member function is used to retrieve the tree background color. * @return * An RGB value representing the tree background color. */ virtual COLORREF GetTreeBackColor() const; /** * @brief * This member function is used to retrieve the tree text color. * @return * An RGB value representing the tree text color. */ virtual COLORREF GetTreeTextColor() const; /** * @brief * This member function is used to retrieve the tree text color * depending on the tree item state. * @param uState TVIS state flags. * @param bTreeHasFocus TRUE if the tree has input focus. * @param dwStyle TVS style flags. * @param crBackDef Default background color to be returned. * @param pTreeBase Pointer to a valid CXTPTreeBase object. * @return * An RGB value representing the tree item state text color. */ virtual COLORREF GetItemTextColor(UINT uState, bool bTreeHasFocus, DWORD dwStyle, COLORREF crBackDef, CTreeCtrl* pTreeBase) const; /** * @brief * This member function is used to retrieve the tree back color * depending on the tree item state. * @param uState TVIS state flags. * @param bTreeHasFocus TRUE if the tree has input focus. * @param dwStyle TVS style flags. * @param crTextDef Default text color to be returned. * @param pTreeBase Pointer to a valid CXTPTreeBase object. * @return * An RGB value representing the tree item state back color. */ virtual COLORREF GetItemBackColor(UINT uState, bool bTreeHasFocus, DWORD dwStyle, COLORREF crTextDef, CTreeCtrl* pTreeBase) const; /** * @brief * This member function is used to determine if a focus rectangle * should be drawn around tree items that have input focus. * @return * TRUE if a focus rectangle should be drawn, otherwise FALSE. */ BOOL IsDrawFocusRect() const { return m_bDrawFocusRect; } /** * @brief * This member function is used to determine if a dark theme is used. * @return * TRUE when using a darker background theme, * FALSE when using a lighter background theme. */ virtual BOOL IsThemeDark() const { return m_bDarkTheme; } protected: COLORREF m_crText; /**< Tree item text color. */ COLORREF m_crTextDisabled; /**< Tree item disabled text color. */ COLORREF m_crTextSelected; /**< Tree item selected text color. */ COLORREF m_crTextSelectedInactive; /**< Tree item selected inactive text color when TVS_SHOWSELALWAYS is used. */ COLORREF m_crTextSelectedDisabled; /**< Tree item selected disabled text color when TVS_SHOWSELALWAYS is used. */ COLORREF m_crBack; /**< Tree item background color. */ COLORREF m_crBackDisabled; /**< Tree item disabled background color. */ COLORREF m_crBackSelected; /**< Tree item selected background color. */ COLORREF m_crBackSelectedInactive; /**< Tree item selected inactive background color when TVS_SHOWSELALWAYS is used. */ COLORREF m_crBackSelectedDisabled; /**< Tree item selected disabled background color when TVS_SHOWSELALWAYS is used. */ BOOL m_bDrawFocusRect; /**< TRUE to draw a focus rectangle when a tree item has input focus. */ BOOL m_bDarkTheme; /**< TRUE when using a darker background theme, FALSE when using a lighter background theme. */ }; /** * @brief * CXTPTreeVisualStudio2012Theme is a CXTPTreeTheme derived class used to * render a Visual Studio 2012 style tree. */ class _XTP_EXT_CLASS CXTPTreeVisualStudio2012Theme : public CXTPTreeTheme { public: /** * @brief * Constructs a CXTPTreeVisualStudio2012Theme object. * @param bLight TRUE to use Light theme, FALSE to use Dark theme. */ CXTPTreeVisualStudio2012Theme(BOOL bLight = TRUE); /** * @brief * This member function performs initialization for the tree theme. * @param pTreeBase Pointer to a valid CXTPTreeBase object. * @details * Initializes all drawing defaults such as colors. */ virtual void RefreshMetrics(CXTPTreeBase* pTreeBase); }; /** * @brief * CXTPTreeOffice2013Theme is a CXTPTreeTheme derived class used to * render a Office 2013 style tree. */ class _XTP_EXT_CLASS CXTPTreeOffice2013Theme : public CXTPTreeTheme { public: /** * @brief * Constructs a CXTPTreeOffice2013Theme object. */ CXTPTreeOffice2013Theme(); /** * @brief * This member function performs initialization for the tree theme. * @param pTreeBase Pointer to a valid CXTPTreeBase object. * @details * Initializes all drawing defaults such as colors. */ virtual void RefreshMetrics(CXTPTreeBase* pTreeBase); }; /** * @brief * CXTPTreeVisualStudio2015Theme is a CXTPTreeTheme derived class used to * render a Visual Studio 2015 style tree. */ class _XTP_EXT_CLASS CXTPTreeVisualStudio2015Theme : public CXTPTreeOffice2013Theme { public: /** * @brief * Constructs a CXTPTreeVisualStudio2015Theme object. */ CXTPTreeVisualStudio2015Theme(); }; /** * @brief * CXTPTreeVisualStudio2017Theme is a CXTPTreeTheme derived class used to * render a Visual Studio 2017 style tree. */ class _XTP_EXT_CLASS CXTPTreeVisualStudio2017Theme : public CXTPTreeOffice2013Theme { public: /** * @brief * Constructs a CXTPTreeVisualStudio2017Theme object. */ CXTPTreeVisualStudio2017Theme(); }; /** * @brief * CXTPTreeVisualStudio2019Theme is a CXTPTreeTheme derived class used to * render a Visual Studio 2019 style tree. */ class _XTP_EXT_CLASS CXTPTreeVisualStudio2019Theme : public CXTPTreeOffice2013Theme { public: /** * @brief * Constructs a CXTPTreeVisualStudio2019Theme object. */ CXTPTreeVisualStudio2019Theme(); }; /** * @brief * CXTPTreeVisualStudio2022Theme is a CXTPTreeTheme derived class used to * render a Visual Studio 2022 style tree. */ class _XTP_EXT_CLASS CXTPTreeVisualStudio2022Theme : public CXTPTreeOffice2013Theme { public: /** * @brief * Constructs a CXTPTreeVisualStudio2022Theme object. */ CXTPTreeVisualStudio2022Theme(); }; /** * @brief * CXTPTreeNativeWindows10Theme is a CXTPTreeTheme derived class used to * render a Native Windows 10 style tree. */ class _XTP_EXT_CLASS CXTPTreeNativeWindows10Theme : public CXTPTreeOffice2013Theme { public: /** * @brief * Constructs a CXTPTreeNativeWindows10Theme object. */ CXTPTreeNativeWindows10Theme(); }; /** * @brief * CXTPTreeNativeWindows11Theme is a CXTPTreeTheme derived class used to * render a Native Windows 11 style tree. */ class _XTP_EXT_CLASS CXTPTreeNativeWindows11Theme : public CXTPTreeOffice2013Theme { public: /** * @brief * Constructs a CXTPTreeNativeWindows11Theme object. */ CXTPTreeNativeWindows11Theme(); }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPTREETHEME_H__) /** @endcond */