/** * @file XTPShortcutListBoxTheme.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(__XTPSHORTCUTLISTBOXTHEME_H__) # define __XTPSHORTCUTLISTBOXTHEME_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPShortcutListBox; class CXTPImageManagerIcon; /** * @brief * CXTPShortcutListBoxTheme is used to draw the CXTPShortcutListBox object. * All themes used for CXTPButton should inherit from this base class. * Note: * A Menu List box is similar in appearance to an Outlook bar. */ class _XTP_EXT_CLASS CXTPShortcutListBoxTheme : public CXTPControlTheme { public: /** * @brief * Constructs a CXTPShortcutListBoxTheme object. */ CXTPShortcutListBoxTheme(); /** * @brief * Destroys a CXTPShortcutListBoxTheme object, handles cleanup and deallocation. */ virtual ~CXTPShortcutListBoxTheme(); public: /** * @brief * Call this function to refresh the colors for the list box control. * Also, this function gets the system default size for icons, and the * default dimensions of a 3D border. Lastly, this function sets the * default color values for the different parts of buttons. i.e button * pressed style, button highlight, button top left color, and button * bottom right color. * @param pList Pointer to the CXTPShortcutListBox object. */ virtual void RefreshMetrics(CXTPShortcutListBox* pList); /** * @brief * Call this function to draw an item in the menu list box. * @param pMenuListBox A pointer to a CXTPShortcutListBox object. * @param lpDIS A LPDRAWITEMSTRUCT struct that contains information * about how the list box should be drawn. */ virtual void DrawItem(CXTPShortcutListBox* pMenuListBox, LPDRAWITEMSTRUCT lpDIS); /** * @brief * Call this function to get the background color of the menu list box. * @return * A COLORREF value corresponding to the background color. */ COLORREF GetBackColor(); /** * @brief * Call this function to get the color of the text used in the menu list box. * @return * A COLORREF value corresponding to the text color. */ COLORREF GetTextColor(); public: CXTPPaintManagerColor m_crItemText; /**< Item text color. */ CXTPPaintManagerColor m_crItemTextDisabled; /**< Disabled item text color. */ CXTPPaintManagerColorGradient m_crgBack; /**< Background color. */ CXTPPaintManagerColorGradient m_crgItemBorder; /**< Item border color. */ CXTPPaintManagerColorGradient m_crgItemBackHot; /**< Selected Item color. */ CXTPPaintManagerColorGradient m_crgItemBackPressed; /**< Pressed Item color. */ public: int m_cyEdge; /**< Height in pixels of the space between the icon and text. */ int m_cxIcon; /**< Width of the menu icon. */ int m_cyIcon; /**< Height of the menu icon. */ protected: /** * @brief * This method is called to draw an image of the item * @param pDC Pointer to a valid device context. * @param rcIcon Bounding rectangle. * @param pImage Pointer to the image to draw. * @param bEnabled TRUE to draw the enabled state of the image. * @param bSelected TRUE to draw the selected state of the image. * @param bPressed TRUE to draw the pressed state of the image. */ virtual void DrawImage(CDC* pDC, CRect& rcIcon, CXTPImageManagerIcon* pImage, BOOL bEnabled, BOOL bSelected, BOOL bPressed); /** * @brief * This method is called to draw the text of the item. * @param pDC Pointer to a valid device context. * @param rcText Bounding rectangle. * @param pCI Pointer to the CONTENT_ITEM to draw. */ virtual void DrawText(CDC* pDC, CRect& rcText, CXTPShortcutListBox::CONTENT_ITEM* pCI); }; /** * @brief * Class CXTPShortcutListBoxThemeOfficeXP is derived from CXTPShortcutListBoxTheme. * This class is used to implement the Office XP theme for Menu List Boxes. */ class _XTP_EXT_CLASS CXTPShortcutListBoxThemeOfficeXP : public CXTPShortcutListBoxTheme { public: /** * @brief * Constructs a CXTPShortcutListBoxThemeOfficeXP object. */ CXTPShortcutListBoxThemeOfficeXP(); /** * @brief * Call this function to refresh the colors for the list box control. * Also, this function gets the system default size for icons, and the * default dimensions of a 3D border. Lastly, this function sets the * default color values for the different parts of buttons. i.e button * pressed style, button highlight, button top left color, and button * bottom right color. * @param pList Pointer to the CXTPShortcutListBox object. */ void RefreshMetrics(CXTPShortcutListBox* pList); protected: /** * @brief * This method is called to draw an image of the item. * @param pDC Pointer to a valid device context. * @param rcIcon Bounding rectangle. * @param pImage Pointer to the image to draw. * @param bEnabled TRUE to draw the enabled state of the image. * @param bSelected TRUE to draw the selected state of the image. * @param bPressed TRUE to draw the pressed state of the image. */ virtual void DrawImage(CDC* pDC, CRect& rcIcon, CXTPImageManagerIcon* pImage, BOOL bEnabled, BOOL bSelected, BOOL bPressed); /** * @brief * This method is called to draw the text of the item. * @param pDC Pointer to a valid device context. * @param rcText Bounding rectangle. * @param pCI Pointer to the CONTENT_ITEM to draw. */ virtual void DrawText(CDC* pDC, CRect& rcText, CXTPShortcutListBox::CONTENT_ITEM* pCI); }; /** * @brief * Class CXTPShortcutListBoxThemeOffice2003 is derived from CXTPShortcutListBoxThemeXP. * This class is used to implement the Office 2003 theme for Menu List Boxes. */ class _XTP_EXT_CLASS CXTPShortcutListBoxThemeOffice2003 : public CXTPShortcutListBoxThemeOfficeXP { public: /** * @brief * Constructs a CXTPShortcutListBoxThemeOffice2003 object. */ CXTPShortcutListBoxThemeOffice2003(); /** * @brief * Call this function to refresh the colors for the list box control. * Also, this function gets the system default size for icons, and the * default dimensions of a 3D border. Lastly, this function sets the * default color values for the different parts of buttons. i.e button * pressed style, button highlight, button top left color, and button * bottom right color. * @param pList Pointer to the CXTPShortcutListBox object. */ void RefreshMetrics(CXTPShortcutListBox* pList); protected: /** * @brief * This method is called to draw an image of the item. * @param pDC Pointer to a valid device context. * @param rcIcon Bounding rectangle. * @param pImage Pointer to the image to draw. * @param bEnabled TRUE to draw the enabled state of the image. * @param bSelected TRUE to draw the selected state of the image. * @param bPressed TRUE to draw the pressed state of the image. */ virtual void DrawImage(CDC* pDC, CRect& rcIcon, CXTPImageManagerIcon* pImage, BOOL bEnabled, BOOL bSelected, BOOL bPressed); }; ///////////////////////////////////////////////////////////////////////////// # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPSHORTCUTLISTBOXTHEME_H__) /** @endcond */