/** * @file XTPColorSelectorCtrl.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(__XTPCOLORSELECTORCTRL_H__) # define __XTPCOLORSELECTORCTRL_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPColorDialog; class CXTPColorSelectorCtrlTheme; /** * @brief * XTP_PICK_BUTTON structure is used by the CXTPColorSelectorCtrl * class to support a user-defined color list. * @see * CXTPColorSelectorCtrl */ struct _XTP_EXT_CLASS XTP_PICK_BUTTON { COLORREF clrButton; /**< An RGB value representing the button color. */ UINT toolTipID; /**< Resource ID for the tooltip for the color button. */ TCHAR szTip[256]; /**< Tooltip string for the color button. If defined, toolTipID must be 0. */ }; /** * @brief * CXTPPickBtnArray is used to manage a collection of XTP_PICK_BUTTON * objects. */ typedef CArray CXTPPickBtnArray; /** * @brief * CXTPColorSelectorCtrl is a CWnd derived class. It is used to create a * CXTPColorSelectorCtrl control that will allow a user to select colors. */ class _XTP_EXT_CLASS CXTPColorSelectorCtrl : public CWnd { public: /** * @brief * COLOR_CELL structure is used by the CXTPColorSelectorCtrl * class to maintain information about a particular color cell. * @see * CXTPColorSelectorCtrl */ struct _XTP_EXT_CLASS COLOR_CELL { UINT nID; /**< Command ID of the color cell. */ UINT nIndex; /**< Index of the color cell. */ bool bChecked; /**< true if the cell is checked. */ CRect rect; /**< Size of the color cell. */ CRect rcBorder; /**< Determines what borders are drawn. */ DWORD dwStyle; /**< Color picker style for the cell. */ TCHAR szText[256]; /**< Tooltip text displayed for the color cell. */ COLORREF clr; /**< An RGB value that represents the color of the cell. */ }; protected: /** * @brief * List for maintaining COLOR_CELL structures. * @details * CList definition used by the CXTPColorSelectorCtrl class to maintain * a list of COLOR_CELL structures representing each color item in * the color selector control. * @see * CXTPColorSelectorCtrl, COLOR_CELL */ typedef CList CColorCellList; /** * @brief * Array of listener windows to send notifications to. * @details * CArray definition used by the CXTPColorSelectorCtrl class to * maintain a list of window handles that receive notification * messages that are sent when an event occurs in the control. * @see * CXTPColorSelectorCtrl */ typedef CArray CListenerArray; public: /** * @brief * Constructs a CXTPColorSelectorCtrl object. */ CXTPColorSelectorCtrl(); /** * @brief * Destroys a CXTPColorSelectorCtrl object, handles cleanup and * deallocation. */ virtual ~CXTPColorSelectorCtrl(); /** * @brief * Call this member function to initialize the recently used * color list for the color selector. * @param arRecentColors Reference to a CUIntArray object that * contains an array of COLORREF values. * @param lpszTitle Title used for the recent colors caption. * @return */ static void AFX_CDECL SetRecentColors(const CUIntArray& arRecentColors, LPCTSTR lpszTitle = NULL); /** * @brief * Call this member function to retrieve a reference to the recently * used color array. * @return * A reference to a CUIintArray object that represents an array * of recently used COLORREF values. */ static CUIntArray& AFX_CDECL GetRecentColors(); /** * @brief * This member function will add a color to the user-defined * color list. * @param clrRecent An RGB value that represents the recently used * color to be added to the recent color list. * @return */ static void AFX_CDECL AddRecentColor(COLORREF clrRecent); /** * @brief * Resets the recently used color list. * @details * Call this member function to remove all colors from the * recently used color list. * @return */ static void AFX_CDECL ResetRecentColors(); /** @cond */ _XTP_DEPRECATED_IN_FAVOR(SetRecentColors) static void AFX_CDECL SetUserColors(const CUIntArray& arUserDefColors) { SetRecentColors(arUserDefColors); } _XTP_DEPRECATED_IN_FAVOR(GetRecentColors) static CUIntArray& AFX_CDECL GetUserColors() { return GetRecentColors(); } /** @endcond */ /** * @brief * Called to create a tooltip for a theme color using the specified string * resource ID and shading that were originally passed into SetThemeColors. * @param lpszColor Name of the color. * @param lpszDesc Description of the color. * @param nShade Percentage that the color has been lightened or darkened. * @return * A string representing the tooltip for the theme color. */ CString GetThemeTip(LPCTSTR lpszColor, LPCTSTR lpszDesc, int nShade); /** * @brief * Called to initialize the theme colors for the color selector. * The colors passed in must be an array of 10 colors. Additional * values can be passed in such as an array of 10 string resource * IDs and a 6 x 10 shading matrix used to adjust each of the 10 * theme colors passed in. * @param pColors Array of colors and tooltips. * @param nCount Number of colors in the array. * @param lpszTitle Title used for theme colors caption. * @param pStringIDs Array of resource IDs representing each color's * description. If NULL, then default values are * used. Array size must match nCount. * @param ppShadeMatrix 6 x 10 matrix array that specifies 6 rows of * shading by 10 colums. If NULL, then default * values are used. * @return * TRUE if successful, otherwise FALSE. * Example: * Here is an example of how to use SetThemeColors: *
	 * XTP_PICK_BUTTON _ThemeColors[] =
	 * {
	 *    { RGB(255, 255, 255), XTP_IDS_CLR_WHITE    },
	 *    { RGB(  0,   0,   0), XTP_IDS_CLR_BLACK    },
	 *    { RGB(231, 230, 230), XTP_IDS_CLR_GRAY25   },
	 *    { RGB( 68,  84, 106), XTP_IDS_CLR_BLUEGRAY },
	 *    { RGB( 91, 155, 213), XTP_IDS_CLR_BLUE     },
	 *    { RGB(237, 125,  49), XTP_IDS_CLR_ORANGE   },
	 *    { RGB(165, 165, 165), XTP_IDS_CLR_GRAY50   },
	 *    { RGB(255, 192,   0), XTP_IDS_CLR_GOLD     },
	 *    { RGB( 68, 114, 196), XTP_IDS_CLR_BLUE     },
	 *    { RGB(112, 173,  71), XTP_IDS_CLR_GREEN    },
	 * };
	 *
	 * UINT _StringIDs[10] =
	 * {
	 *    XTP_IDS_BACKGROUND1,
	 *    XTP_IDS_TEXT1,
	 *    XTP_IDS_BACKGROUND2,
	 *    XTP_IDS_TEXT2,
	 *    XTP_IDS_ACCENT1,
	 *    XTP_IDS_ACCENT2,
	 *    XTP_IDS_ACCENT3,
	 *    XTP_IDS_ACCENT4,
	 *    XTP_IDS_ACCENT5,
	 *    XTP_IDS_ACCENT6,
	 * };
	 *
	 * int _Shade[6][10] =
	 * {
	 *    {   0,   0,   0,   0,   0,   0,   0,   0,   0,   0 },
	 *    {  -5, +50, -10, +80, +80, +80, +80, +80, +80, +80 },
	 *    { -15, +35, -25, +60, +60, +60, +60, +60, +60, +60 },
	 *    { -25, +25, -50, +40, +40, +40, +40, +40, +40, +40 },
	 *    { -35, +15, -75, -25, -25, -25, -25, -25, -25, -25 },
	 *    { -50, + 5, -90, -50, -50, -50, -50, -50, -50, -50 },
	 * };
	 *
	 * SetThemeColors(_ThemeColors, _countof(_ThemeColors), _StringIDs, _Shade);
	 * 
*/ BOOL SetThemeColors(XTP_PICK_BUTTON* pColors = NULL, int nCount = 10, LPCTSTR lpszTitle = NULL, UINT* pStringIDs = NULL, int ppShadeMatrix[6][10] = NULL); /** * @brief * Called to initialize the theme colors for the color selector. * The colors passed in must be an array of 10 colors. Additional * values can be passed in such as an array of 10 string resource * IDs and a 6 x 10 shading matrix used to adjust each of the 10 * theme colors passed in. * @param pColors Array of colors and tooltips. * @param nCount Number of colors in the array. * @param lpszTitle Title used for theme colors caption. * @param ppszStrings Array of strings representing each color's * description. Values cannot be NULL. Array * size must match nCount. * @param ppShadeMatrix 6 x 10 matrix array that specifies 6 rows of * shading by 10 colums. If NULL, then default * values are used. * @return * TRUE if successful, otherwise FALSE. * Example: * Here is an example of how to use SetThemeColors: *
	 * XTP_PICK_BUTTON _ThemeColors[] =
	 * {
	 *    { RGB(255, 255, 255), XTP_IDS_CLR_WHITE    },
	 *    { RGB(  0,   0,   0), XTP_IDS_CLR_BLACK    },
	 *    { RGB(231, 230, 230), XTP_IDS_CLR_GRAY25   },
	 *    { RGB( 68,  84, 106), XTP_IDS_CLR_BLUEGRAY },
	 *    { RGB( 91, 155, 213), XTP_IDS_CLR_BLUE     },
	 *    { RGB(237, 125,  49), XTP_IDS_CLR_ORANGE   },
	 *    { RGB(165, 165, 165), XTP_IDS_CLR_GRAY50   },
	 *    { RGB(255, 192,   0), XTP_IDS_CLR_GOLD     },
	 *    { RGB( 68, 114, 196), XTP_IDS_CLR_BLUE     },
	 *    { RGB(112, 173,  71), XTP_IDS_CLR_GREEN    },
	 * };
	 *
	 * UINT _StringIDs[10] =
	 * {
	 *    XTP_IDS_BACKGROUND1,
	 *    XTP_IDS_TEXT1,
	 *    XTP_IDS_BACKGROUND2,
	 *    XTP_IDS_TEXT2,
	 *    XTP_IDS_ACCENT1,
	 *    XTP_IDS_ACCENT2,
	 *    XTP_IDS_ACCENT3,
	 *    XTP_IDS_ACCENT4,
	 *    XTP_IDS_ACCENT5,
	 *    XTP_IDS_ACCENT6,
	 * };
	 *
	 * int _Shade[6][10] =
	 * {
	 *    {   0,   0,   0,   0,   0,   0,   0,   0,   0,   0 },
	 *    {  -5, +50, -10, +80, +80, +80, +80, +80, +80, +80 },
	 *    { -15, +35, -25, +60, +60, +60, +60, +60, +60, +60 },
	 *    { -25, +25, -50, +40, +40, +40, +40, +40, +40, +40 },
	 *    { -35, +15, -75, -25, -25, -25, -25, -25, -25, -25 },
	 *    { -50, + 5, -90, -50, -50, -50, -50, -50, -50, -50 },
	 * };
	 *
	 * SetThemeColors(_ThemeColors, _countof(_ThemeColors), _StringIDs, _Shade);
	 * 
*/ BOOL SetThemeColors(XTP_PICK_BUTTON* pColors, int nCount, LPCTSTR lpszTitle, LPCTSTR* ppszStrings, int ppShadeMatrix[6][10]); /** * @brief * Called to initialize the theme colors for the color selector. * The colors passed in must be an array of 10 colors. Additional * values can be passed in such as an array of 10 string resource * IDs and a 6 x 10 shading matrix used to adjust each of the 10 * theme colors passed in. * @param arColors Array of colors used to initialize the theme * @param nCols Number of columns displayed. * @param lpszTitle Title used for theme colors caption. * colors. * @return * TRUE if successful, otherwise FALSE. * Example: * Here is an example of how to use SetThemeColors: *
	 * XTP_PICK_BUTTON _ThemeColors[] =
	 * {
	 *    { RGB(255, 255, 255), XTP_IDS_CLR_WHITE    },
	 *    { RGB(  0,   0,   0), XTP_IDS_CLR_BLACK    },
	 *    { RGB(231, 230, 230), XTP_IDS_CLR_GRAY25   },
	 *    { RGB( 68,  84, 106), XTP_IDS_CLR_BLUEGRAY },
	 *    { RGB( 91, 155, 213), XTP_IDS_CLR_BLUE     },
	 *    { RGB(237, 125,  49), XTP_IDS_CLR_ORANGE   },
	 *    { RGB(165, 165, 165), XTP_IDS_CLR_GRAY50   },
	 *    { RGB(255, 192,   0), XTP_IDS_CLR_GOLD     },
	 *    { RGB( 68, 114, 196), XTP_IDS_CLR_BLUE     },
	 *    { RGB(112, 173,  71), XTP_IDS_CLR_GREEN    },
	 * };
	 *
	 * UINT _StringIDs[10] =
	 * {
	 *    XTP_IDS_BACKGROUND1,
	 *    XTP_IDS_TEXT1,
	 *    XTP_IDS_BACKGROUND2,
	 *    XTP_IDS_TEXT2,
	 *    XTP_IDS_ACCENT1,
	 *    XTP_IDS_ACCENT2,
	 *    XTP_IDS_ACCENT3,
	 *    XTP_IDS_ACCENT4,
	 *    XTP_IDS_ACCENT5,
	 *    XTP_IDS_ACCENT6,
	 * };
	 *
	 * int _Shade[6][10] =
	 * {
	 *    {   0,   0,   0,   0,   0,   0,   0,   0,   0,   0 },
	 *    {  -5, +50, -10, +80, +80, +80, +80, +80, +80, +80 },
	 *    { -15, +35, -25, +60, +60, +60, +60, +60, +60, +60 },
	 *    { -25, +25, -50, +40, +40, +40, +40, +40, +40, +40 },
	 *    { -35, +15, -75, -25, -25, -25, -25, -25, -25, -25 },
	 *    { -50, + 5, -90, -50, -50, -50, -50, -50, -50, -50 },
	 * };
	 *
	 * SetThemeColors(_ThemeColors, _countof(_ThemeColors), _StringIDs, _Shade);
	 * 
*/ BOOL SetThemeColors(CXTPPickBtnArray& arColors, int nCols = 10, LPCTSTR lpszTitle = NULL); /** * @brief * Called to initialize the standard colors for the color selector. * @param pColors Array of colors and tooltips. * @param nCount Number of colors in the array. * @param nCols Number of columns to show. * @param lpszTitle Title used for theme colors caption. * @return * TRUE if successful, otherwise FALSE. * Example: * Here is an example of how to use SetThemeColors: *
	 * XTP_PICK_BUTTON _StdColors[] =
	 * {
	 *    { RGB(192,   0,   0), XTP_IDS_CLR_DARK_RED    },
	 *    { RGB(255,   0,   0), XTP_IDS_CLR_RED         },
	 *    { RGB(255, 192,   0), XTP_IDS_CLR_ORANGE      },
	 *    { RGB(255, 255,   0), XTP_IDS_CLR_YELLOW      },
	 *    { RGB(146, 208,  80), XTP_IDS_CLR_LIGHT_GREEN },
	 *    { RGB(  0, 176,  80), XTP_IDS_CLR_GREEN       },
	 *    { RGB(  0, 176, 240), XTP_IDS_CLR_LIGHT_BLUE  },
	 *    { RGB(  0, 112, 192), XTP_IDS_CLR_BLUE        },
	 *    { RGB(  0,  32,  96), XTP_IDS_CLR_DARK_BLUE   },
	 *    { RGB(112,  48, 160), XTP_IDS_CLR_PURPLE      },
	 * };
	 *
	 * SetStandardColors(_StdColors, _countof(_StdColors));
	 * 
*/ BOOL SetStandardColors(XTP_PICK_BUTTON* pColors = NULL, int nCount = 10, int nCols = 10, LPCTSTR lpszTitle = NULL); /** * @brief * Called to initialize the standard colors for the color selector. * @param arColors Array of colors used to initialize the standard * @param nCols Number of columns to show. * @param lpszTitle Title used for theme colors caption. * colors. * @return * TRUE if successful, otherwise FALSE. * Example: * Here is an example of how to use SetThemeColors: *
	 * XTP_PICK_BUTTON _StdColors[] =
	 * {
	 *    { RGB(192,   0,   0), XTP_IDS_CLR_DARK_RED    },
	 *    { RGB(255,   0,   0), XTP_IDS_CLR_RED         },
	 *    { RGB(255, 192,   0), XTP_IDS_CLR_ORANGE      },
	 *    { RGB(255, 255,   0), XTP_IDS_CLR_YELLOW      },
	 *    { RGB(146, 208,  80), XTP_IDS_CLR_LIGHT_GREEN },
	 *    { RGB(  0, 176,  80), XTP_IDS_CLR_GREEN       },
	 *    { RGB(  0, 176, 240), XTP_IDS_CLR_LIGHT_BLUE  },
	 *    { RGB(  0, 112, 192), XTP_IDS_CLR_BLUE        },
	 *    { RGB(  0,  32,  96), XTP_IDS_CLR_DARK_BLUE   },
	 *    { RGB(112,  48, 160), XTP_IDS_CLR_PURPLE      },
	 * };
	 *
	 * SetStandardColors(_StdColors, _countof(_StdColors));
	 * 
*/ BOOL SetStandardColors(CXTPPickBtnArray& arColors, int nCols = 10, LPCTSTR lpszTitle = NULL); /** * @brief * Call this method to set custom colors for the color picker. * @param pColors Static array of colors and tooltips. * @param nCount Number of colors. * @param nCols Number of columns to show. * @param lpszTitle Custom title for colors displayed. */ void SetColors(XTP_PICK_BUTTON* pColors, int nCount, int nCols = 8, LPCTSTR lpszTitle = NULL); /** * @brief * Called to retrieve a reference to the theme color button array. * @return * Reference to a CXTPPickBtnArray object representing the theme * color array for the color selector control. */ CXTPPickBtnArray& GetThemeColors(); /** * @brief * Called to retrieve a reference to the standard color button array. * @return * Reference to a CXTPPickBtnArray object representing the standard * color array for the color selector control. */ CXTPPickBtnArray& GetStandardColors(); /** * @brief * This member function will return the index of the currently selected * color and will initialize 'pColorCell' struct. * @param pColorCell Receives a pointer to the currently selected button. * @return * The zero (0) based index of the currently selected button. */ int GetCurSel(COLOR_CELL* pColorCell); /** * @brief * This member function will select a button based upon its index. * @param nIndex An integer value that represents the zero (0) based * index of the button to be selected. */ void SetCurSel(int nIndex); /** * @brief * This member function handles the creation of the color pop-up window. * @param rect A reference to a CRect object that represents the * size of the color pop-up window. * @param pParentWnd Pointer to the parent window for the color pop-up. * @param dwPopup Style for the pop-up window. See the Remarks section for a * complete list of available styles. * @param clrColor An RGB value that represents the currently selected * color for the pop-up window. * @param clrDefault Specifies the default color for the color pop-up. If the * current style includes CPS_NOFILL, then this parameter * is ignored. * @details * Styles to be added or removed can be combined by using the bitwise * OR (|) operator. It can be one or more of the following: * CPS_XTP_NOFILL: Displays a "No Fill" button rather than the * default Automatic Color button. * CPS_XTP_EXTENDED: Displays 40 extended colors rather than the * default 16 colors. * CPS_XTP_MORECOLORS: Displays a "More Colors" button which will * display a CXTPColorDialog. * CPS_XTP_NOAUTOMATIC: Do not display an "Automatic Color" button. * CPS_XTP_RECENTCOLORS: Displays a recently used color list for * the control. * CPS_XTP_RIGHTALIGN: The pop-up window is displayed right aligned. * CPS_XTP_COLORBORDERS: The pop-up window displays color boxes * with color borders. * @return * TRUE if successful, otherwise FALSE. * @see * CXTPColorPicker::ModifyCPStyle, CXTPColorPopup::Create */ BOOL Create(CRect rect, CWnd* pParentWnd, DWORD dwPopup, COLORREF clrColor, COLORREF clrDefault = CLR_DEFAULT); /** * @brief * This member function adds a window to send color picker notifications to. * @param hwndListener A handle to the listener window. Messages will * be sent to it. */ void AddListener(HWND hwndListener); /** * @brief * This member function removes a window from the notification list. * @param hwndListener A handle to the listener window to remove. */ void RemoveListener(HWND hwndListener); /** * @brief * This member function is called to select a color cell. * @param pColorCell Pointer to a COLOR_CELL object. */ virtual void SelectColorCell(COLOR_CELL* pColorCell); /** * @brief * This member function is called to select a color cell. * @param clr Color of the selected cell. */ void SelectColor(COLORREF clr); /** * @brief * This member function is called to retrieve a COLOR_CELL struct * from the color cell array. * @param iIndex Index into the color cell array. * @return * A pointer to a COLOR_CELL object. */ COLOR_CELL* GetCellFromIndex(int iIndex); /** * @brief * This member function is called to set the size of the borders * for the control. * @param l Specifies the left position. * @param t Specifies the top position. * @param r Specifies the right position. * @param b Specifies the bottom position. */ void SetBorders(int l = 0, int t = 0, int r = 0, int b = 0); /** * @brief * Call this member function to determine if the color selection dialog * is visible. * @return * true if the color selection dialog is visible, otherwise false. */ bool IsColorDlgVisible(); /** * @brief * Call this member function to determine if the ColorSelector control is * used in a dialog or used in a toolbar. * @param pDC Device context of the control. * @return * TRUE if the ColorSelector control is used in a dialog, or * FALSE if the ColorSelector control is used in a toolbar. */ BOOL IsColorStatic(CDC* pDC) const; /** * @brief * Call this member function to switch the visual theme of the control. * @param eTheme New window theme. Can be any of the values listed in the * Remarks section. * @details * eTheme can be one of the following values: * xtpControlThemeDefault: Use default theme. * xtpControlThemeOfficeXP: Use Office XP theme. * xtpControlThemeOffice2003: Use Office 2003 theme. * xtpControlThemeResource: Use Office 2007 theme. * @return * TRUE if successful, otherwise FALSE. */ BOOL SetTheme(XTPControlTheme eTheme); /** * @brief * Call this member function to switch the visual theme of the control. * @param pTheme Pointer to the new control theme. * @details * eTheme can be one of the following values: * xtpControlThemeDefault: Use default theme. * xtpControlThemeOfficeXP: Use Office XP theme. * xtpControlThemeOffice2003: Use Office 2003 theme. * xtpControlThemeResource: Use Office 2007 theme. * @return * TRUE if successful, otherwise FALSE. */ BOOL SetTheme(CXTPColorSelectorCtrlTheme* pTheme); /** * @brief * Call this member function to retrieve a pointer to the currently * selected theme. * @return * A pointer to a CXTPColorSelectorCtrlTheme object representing * the currently selected theme. */ CXTPColorSelectorCtrlTheme* GetTheme(); /** * @brief * Call this member function to retrieve the size of a single * color button. * @return * A CSize object representing the size of a single color button. */ CSize GetButtonSize() const; /** * @brief * Call this member function to retrieve the number of columns * displayed. * @return * An integer value representing the number of columns. */ int GetNumCols() const; /** * @brief * Call this member function to retrieve the size of the control * border. * @return * A CRect representing the size of the control border. */ CRect GetBorderRect() const; /** * @brief * Call this member function to retrieve the pop-up style for the * color selector control. * @return * A DWORD value representing the pop-up style set for the control. * Can be one or more of the following values: * CPS_XTP_NOFILL: Displays a "No Fill" button rather than the * default Automatic Color button. * CPS_XTP_EXTENDED: Displays 40 extended colors rather than the * default 16 colors. * CPS_XTP_MORECOLORS: Displays a "More Colors" button which will * display a CXTPColorDialog. * CPS_XTP_NOAUTOMATIC: Do not display an "Automatic Color" button. * CPS_XTP_RECENTCOLORS: Displays a recently used color list for * the control. * CPS_XTP_RIGHTALIGN: The pop-up window is displayed right aligned. * CPS_XTP_COLORBORDERS: The pop-up window displays color boxes * with color borders. */ DWORD GetPopupStyle() const; /** * @brief * Call this member function to modify the color selector style. Styles * to be added or removed can be combined by using the bitwise OR (|) * operator. Can be one or more of the following values: * CPS_XTP_NOFILL: Displays a "No Fill" button rather than the * default Automatic Color button. * CPS_XTP_EXTENDED: Displays 40 extended colors rather than the * default 16 colors. * CPS_XTP_MORECOLORS: Displays a "More Colors" button which will * display a CXTPColorDialog. * CPS_XTP_NOAUTOMATIC: Do not display an "Automatic Color" button. * CPS_XTP_RECENTCOLORS: Displays a recently used color list for * the control. * CPS_XTP_RIGHTALIGN: The pop-up window is displayed right aligned. * CPS_XTP_COLORBORDERS: The pop-up window displays color boxes * with color borders. * @param dwRemove Specifies styles to be removed during style modification. * @param dwAdd Specifies styles to be added during style modification. * @return * Nonzero if style was successfully modified, otherwise 0. */ BOOL ModifyPopupStyle(DWORD dwRemove, DWORD dwAdd); /** * @brief * Call this member function to retrieve the array of custom colors * defined for the color selector control. * @return * A pointer to an XTP_PICK_BUTTON* array representing custom * colors defined for the control. */ XTP_PICK_BUTTON* GetExtendedColors(); /** * @brief * Call this member function to retrieve the number of items in the * custom color array. * @return * An integer representing the number of items in the color array. */ int GetExtendedCount() const; /** * @brief * Call this member function to retrieve the index of the currently * selected color. * @return * An integer representing the currently selected color. */ int GetCurSel() const; /** * @brief * Call this member function to retrieve the the index of the currently * pressed color. * @return * An integer representing the currently pressed color. */ int GetPressed() const; /** * @brief * Call this member function to retrieve the default color defined * for the control. * @return * An RGB value representing the default color. */ COLORREF GetDefColor() const; /** * @brief * Call this member function to retrieve the currently selected color * for the control. * @return * An RGB value representing the currently selected color. */ COLORREF GetCurColor() const; /** * @brief * Call this member function to retrieve a reference to the tooltip * for the control. * @return * A reference to a CToolTipCtl obbject. */ CToolTipCtrl& GetToolTipCtrl(); /** * @brief * Call this member function to retrieve a reference to the cell * list array for the control. * @return * A reference to a CColorCellList object. */ CColorCellList& GetColorCellList(); /** * @brief * Call this member function to retrieve the string set for the * theme caption. * @return * A string representing the theme caption. */ CString GetThemeTitle(); /** * @brief * Call this member function to retrieve the string set for the * standard caption. * @return * A string representing the standard caption. */ CString GetStandardTitle(); /** * @brief * Call this member function to retrieve the string set for the * custom caption. * @return * A string representing the custom caption. */ CString GetCustomTitle(); /** * @brief * Call this member function to determine if captions are used * for the color selector. * @return * TRUE if themes are used, otherwise FALSE. */ BOOL HasCaptions() const; /** * @brief * Call this member function to show/hide captions for the * color selector. * @param bShow TRUE to show captions, FALSE to hide. */ void ShowCaptions(BOOL bShow); protected: /** * @brief * Called to initialize the object specified by arColors using * the data contained in the array specified by pColors. * @param arColors Reference to an array to be initalized. * @param pColors Array of XTP_PICK_BUTTON structures. * @param nCount Number of items contained in pColors. * @return * TRUE if the array specified by arColors has been successfully * initialized, otherwise FALSE. */ BOOL SetColors(CXTPPickBtnArray& arColors, const XTP_PICK_BUTTON* pColors, const int nCount); /** * @brief * This member function is called to draw the color selector. * @param pDC A CDC pointer that represents the current device context. */ void DrawColorSelector(CDC* pDC); /** * @brief * This member function will finish the selection process for the * color box or button in the color pop-up window. * @param nCurSel Current index of the selected color box or button * in the color pop-up window. */ virtual void EndSelection(int nCurSel); /** * @brief * This member function is called to determine if the specified * color is already in the ColorDialog's MRU list or in the * standard colors list. * @param crFind A const COLORREF value. * * @return TRUE if the color is found, otherwise FALSE. */ BOOL LookUpColor(const COLORREF crFind); /** * @brief * This member function is called to finish the selection process for * the color box or button in the color pop-up window. * @param nCurSel Current index of the selected color box or button in * the color pop-up window. * @param callerParam User-defined value to be passed to listeners. * @details * Override this method to pass user-defined data to the listener * windows that receive notification messages. */ virtual void OnEndSelection(int nCurSel, LPARAM callerParam); /** * @brief * This method is called to calculate the size of the Selector * to fit all buttons. * @return * Size of the Selector to fit all buttons. */ virtual CSize CalcSize(); /** * @brief * Call this member function to refresh theme colors and redraw * the control. */ virtual void RefreshMetrics(); /** @cond */ protected: DECLARE_MESSAGE_MAP() //{{AFX_VIRTUAL(CXTPColorSelectorCtrl) virtual BOOL PreTranslateMessage(MSG* pMsg); virtual BOOL OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult); //}}AFX_VIRTUAL //{{AFX_MSG(CXTPColorSelectorCtrl) afx_msg int OnCreate(LPCREATESTRUCT lpCS); afx_msg void OnPaint(); afx_msg void OnMouseMove(UINT nFlags, CPoint point); afx_msg int OnMouseActivate(CWnd* /*pDesktopWnd*/, UINT /*nHitTest*/, UINT /*message*/); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg void OnLButtonUp(UINT nFlags, CPoint point); afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg BOOL OnEraseBkgnd(CDC* pDC); afx_msg void OnMouseLeave(); afx_msg LRESULT OnNcHitTest(CPoint point); afx_msg void OnSetFocus(CWnd* pOldWnd); //}}AFX_MSG afx_msg LRESULT OnSetTheme(WPARAM wParam, LPARAM lParam); private: BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL); BOOL SetThemeColors(XTP_PICK_BUTTON* pColors, int nCount, LPCTSTR lpszTitle, CStringArray& arStrings, int ppShadeMatrix[6][10]); friend class CXTPopupColorTearOff; /** @endcond */ public: static CUIntArray m_arRecentColors; /**< Array of recently used colors. */ static CString m_strTitleRecent; /**< Represents the title for the recent colors caption. */ protected: int m_nCols; /**< Number of columns in the color pop-up window. */ int m_nCurSel; /**< Currently selected index. */ int m_nPressed; /**< Pressed button. */ BOOL m_bCaptions; /**< TRUE to display color captions. */ CWnd* m_pParentWnd; /**< Pointer to the parent window for the pop-up window. */ CRect m_rcWnd; /**< Rect for the pop-up window. */ CRect m_rcBorders; /**< Control borders. */ DWORD m_dwPopup; /**< Color pop-up window style. */ CPoint m_point; /**< Last known cursor position. */ CString m_strTitleTheme; /**< Represents the title for the theme colors caption. */ CString m_strTitleStandard; /**< Represents the title for the standard colors caption. */ CString m_strTitleCustom; /**< Custom colors title. */ COLORREF m_clrColor; /**< An RGB value that represents the currently selected color. */ COLORREF m_clrDefault; /**< An RGB value that represents the default color for the pop-up window. */ CToolTipCtrl m_tooltip; /**< Tooltip control. */ CListenerArray m_listeners; /**< Array of listener windows to be sent notifications. */ CColorCellList m_arCells; /**< Array of color items. */ CXTPColorDialog* m_pColorDlg; /**< Pointer to the color selection dialog when visible. */ CXTPColorSelectorCtrlTheme* m_pTheme; /**< Pointer to the current theme. */ XTP_PICK_BUTTON* m_pExtendedColors; /**< Custom colors. */ int m_nExtendedColors; /**< Custom colors count. */ CXTPPickBtnArray m_arThemeColors; /**< Theme color array. */ CXTPPickBtnArray m_arStandardColors; /**< Standard color array. */ }; /** * @brief * CXTPColorSelectorCtrlTheme is derived from CXTPControlThemeManagerStyle to * handle theme specific visualizations for the CXTPColorSelectorCtrl class. */ class _XTP_EXT_CLASS CXTPColorSelectorCtrlTheme : public CXTPControlTheme { public: /** * @brief * Constructs a CXTPColorSelectorCtrlTheme object. */ CXTPColorSelectorCtrlTheme(); /** * @brief * This member function is called by the theme manager to refresh * the visual styles used by each component's theme. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. */ virtual void RefreshMetrics(CXTPColorSelectorCtrl* pOwner); /** * @brief * Call this member function to draw the background of the * ColorSelector control. * @param pDC A pointer to a valid device context. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. * @param rect A CRect object that contains the dimensions of the area to fill. */ virtual void FillBackground(CDC* pDC, CXTPColorSelectorCtrl* pOwner, const CRect& rect); /** * @brief * This member function is called to draw the cell specified * by 'pColorCell'. * @param pDC A CDC pointer that represents the current device context. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. * @param pColorCell A COLOR_CELL object. * @param bHighlight TRUE if the mouse is over the cell. * @param bPressed TRUE if the cell is pressed. */ virtual void DrawColorCell(CDC* pDC, CXTPColorSelectorCtrl* pOwner, CXTPColorSelectorCtrl::COLOR_CELL* pColorCell, BOOL bHighlight, BOOL bPressed); /** * @brief * This member function is called to draw the color selector. * @param pDC A CDC pointer that represents the current device context. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. */ virtual void DrawColorSelector(CDC* pDC, CXTPColorSelectorCtrl* pOwner); /** * @brief * Called to determine the size of the color selector window. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. * @return * A CSize object containing the width and height for the control. */ virtual CSize CalcSize(CXTPColorSelectorCtrl* pOwner); /** * @brief * Called to add the 'Automatic Color' button to the color selector * control. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. * @param nIndex Reference to an integer representing the next available * index in the color cell array. * @param x Specifies the starting coordinates for the left edge. * @param y Specifies the starting coordinates for the top edge. * @param cx Specifies the width of the client area. * @param bChecked TRUE when a color button has been checked. * @return * TRUE if the 'Automatic Color' button was successfully created, * otherwise FALSE. */ virtual BOOL CreateAutoButton(CXTPColorSelectorCtrl* pOwner, int& nIndex, const int x, int& y, const int cx, bool& bChecked); /** * @brief * Called to add default color buttons to the color selector control. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. * @param nIndex Reference to an integer representing the next available * index in the color cell array. * @param x Specifies starting coordinates for the left edge. * @param y Specifies starting coordinates for the top edge. * @param cx Specifies the width of the client area. * @param bChecked TRUE when a color button has been checked. * @return * TRUE if successful, otherwise FALSE. */ virtual BOOL CreateExtendedButtons(CXTPColorSelectorCtrl* pOwner, int& nIndex, const int x, int& y, const int cx, bool& bChecked); /** * @brief * Called to add theme and standard buttons to the color selector control. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. * @param nIndex Reference to an integer representing the next available * index in the color cell array. * @param x Specifies starting coordinates for the left edge. * @param y Specifies starting coordinates for the top edge. * @param cx Specifies the width of the client area. * @param bChecked TRUE when a color button has been checked. * @return * TRUE if successful, otherwise FALSE. */ virtual BOOL CreateThemeButtons(CXTPColorSelectorCtrl* pOwner, int& nIndex, const int x, int& y, const int cx, bool& bChecked); /** * @brief * Called to determine if theme or default color buttons should be added. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. * @param nIndex Reference to an integer representing the next available * index in the color cell array. * @param x Specifies starting coordinates for the left edge. * @param y Specifies starting coordinates for the top edge. * @param cx Specifies the width of the client area. * @param bChecked TRUE when a color button has been checked. * @return * TRUE if successful, otherwise FALSE. */ virtual BOOL CreateColorButtons(CXTPColorSelectorCtrl* pOwner, int& nIndex, const int x, int& y, const int cx, bool& bChecked); /** * @brief * Called to add recent colors to the color selector control. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. * @param nIndex Reference to an integer representing the next available * index in the color cell array. * @param x Specifies starting coordinates for the left edge. * @param y Specifies starting coordinates for the top edge. * @param cx Specifies the width of the client area. * @param bChecked TRUE when a color button has been checked. * @return * TRUE if successful, otherwise FALSE. */ virtual BOOL CreateRecentColorButtons(CXTPColorSelectorCtrl* pOwner, int& nIndex, const int x, int& y, const int cx, bool& bChecked); /** * @brief * Called to add a 'More Colors' button to the color selector control. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. * @param nIndex Reference to an integer representing the next available * index in the color cell array. * @param x Specifies starting coordinates for the left edge. * @param y Specifies starting coordinates for the top edge. * @param cx Specifies the width of the client area. * @param bChecked TRUE when a color button has been checked. * @return * TRUE if successful, otherwise FALSE. */ virtual BOOL CreateMoreButton(CXTPColorSelectorCtrl* pOwner, int& nIndex, const int x, int& y, const int cx, bool& bChecked); /** * @brief * Call to retrieve the size of a single color button. * @return * A CSize object representing the size of a single color button. */ virtual CSize GetButtonSize() const; public: int m_nAutoButton; /**< Height of the Automatic/More Colors buttons. */ int m_nCaption; /**< Height of a caption that is displayed in the control. */ int m_nMargin; /**< Size for default margin spacing. */ CRect m_rcThemeText; /**< Size and location of the 'Theme Colors' caption area text. */ CRect m_rcRecentText; /**< Size and location of the 'Recent Colors' caption area text. */ CRect m_rcStandardText; /**< Size and location of the 'Standard Colors' caption area text. */ CSize m_sizeButton; /**< cx and cy size for a color picker button. */ BOOL m_bThinBorder; /**< TRUE to use thin borders. */ COLORREF m_crBorder; /**< An RGB value representing the border color. */ COLORREF m_crBorderHilight; /**< An RGB value for border highlight color. */ COLORREF m_crBorderPressed; /**< An RGB value for border pressed color. */ COLORREF m_crBack; /**< An RGB value for background color. */ COLORREF m_crBackPressed; /**< An RGB value for pressed background color. */ COLORREF m_crBackHilight; /**< An RGB value for background highlight color. */ COLORREF m_crBackChecked; /**< An RGB value for checked background color. */ COLORREF m_crText; /**< An RGB value for text color. */ COLORREF m_crTextPressed; /**< An RGB value for text pressed color. */ COLORREF m_crPopupBorder; /**< An RGB value for the pop-up border. */ }; /** * @brief * CXTPColorSelectorCtrlThemeOfficeXP is derived from CXTPColorSelectorCtrlTheme * to handle theme specific visualizations for the CXTPColorSelectorCtrl class. */ class _XTP_EXT_CLASS CXTPColorSelectorCtrlThemeOfficeXP : public CXTPColorSelectorCtrlTheme { public: /** * @brief * Constructs a CXTPColorSelectorCtrlThemeOfficeXP object. */ CXTPColorSelectorCtrlThemeOfficeXP(); /** * @brief * This member function is called by the theme manager to refresh * the visual styles used by each component's theme. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. */ virtual void RefreshMetrics(CXTPColorSelectorCtrl* pOwner); }; /** * @brief * CXTPColorSelectorCtrlThemeOffice2003 is derived from * CXTPColorSelectorCtrlThemeOfficeXP to handle theme specific * visualizations for the CXTPColorSelectorCtrl class. */ class _XTP_EXT_CLASS CXTPColorSelectorCtrlThemeOffice2003 : public CXTPColorSelectorCtrlThemeOfficeXP { public: /** * @brief * Constructs a CXTPColorSelectorCtrlThemeOffice2003 object. */ CXTPColorSelectorCtrlThemeOffice2003(); /** * @brief * This member function is called by the theme manager to refresh * the visual styles used by each component's theme. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. */ virtual void RefreshMetrics(CXTPColorSelectorCtrl* pOwner); }; /** * @brief * CXTPColorSelectorCtrlThemeResource is derived from * CXTPColorSelectorCtrlThemeOfficeXP to handle theme specific * visualizations for the CXTPColorSelectorCtrl class. */ class _XTP_EXT_CLASS CXTPColorSelectorCtrlThemeResource : public CXTPColorSelectorCtrlThemeOfficeXP { public: /** * @brief * Constructs a CXTPColorSelectorCtrlThemeResource object. */ CXTPColorSelectorCtrlThemeResource(); /** * @brief * This member function is called by the theme manager to refresh * the visual styles used by each component's theme. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. */ virtual void RefreshMetrics(CXTPColorSelectorCtrl* pOwner); }; /** * @brief * CXTPColorSelectorCtrlThemeOffice2013 is derived from CXTPColorSelectorCtrlTheme * to handle theme specific visualizations for the CXTPColorSelectorCtrl class. */ class _XTP_EXT_CLASS CXTPColorSelectorCtrlThemeOffice2013 : public CXTPColorSelectorCtrlTheme { public: /** * @brief * Default constructor. */ CXTPColorSelectorCtrlThemeOffice2013(); /** * @brief * This member function is called by the theme manager to refresh * the visual styles used by each component's theme. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. */ virtual void RefreshMetrics(CXTPColorSelectorCtrl* pOwner); /** * @brief * This member function is called to draw the cell specified * by 'pColorCell'. * @param pDC A CDC pointer that represents the current device context. * @param rcItem Specifies the size of the border to draw. * @param rcBorder Specifies left, top, right and bottom borders. * 1 = draw border, 0 = do not draw border. * @param crBorder An RGB value specifying the border color to draw. */ virtual void DrawBorder(CDC* pDC, CRect rcItem, CRect rcBorder, COLORREF crBorder); /** * @brief * Called to draw a color cell for the color selector control. * @param pDC A CDC pointer that represents the current device context. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. * @param pColorCell A COLOR_CELL object. * @param rcItem Size and location of the color cell to draw. * @param bHighlight TRUE if the color should be drawn highlighted. * @param bChecked TRUE if the color should be drawn checked. * @param bPressed TRUE if the color should be drawn pressed. */ virtual void DrawColor(CDC* pDC, CXTPColorSelectorCtrl* pOwner, CXTPColorSelectorCtrl::COLOR_CELL* pColorCell, CRect rcItem, BOOL bChecked, BOOL bHighlight, BOOL bPressed); /** * @brief * This member function is called to draw the cell specified * by 'pColorCell'. * @param pDC A CDC pointer that represents the current device context. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. * @param pColorCell A COLOR_CELL object. * @param bHighlight TRUE if the mouse is over the cell. * @param bPressed TRUE if the cell is pressed. */ virtual void DrawColorCell(CDC* pDC, CXTPColorSelectorCtrl* pOwner, CXTPColorSelectorCtrl::COLOR_CELL* pColorCell, BOOL bHighlight, BOOL bPressed); /** * @brief * This member function is called to draw the color selector. * @param pDC A CDC pointer that represents the current device context. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. */ virtual void DrawColorSelector(CDC* pDC, CXTPColorSelectorCtrl* pOwner); /** * @brief * Called to determine the size of the color selector window. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. * @return * A CSize object containing the width and height for the control. */ virtual CSize CalcSize(CXTPColorSelectorCtrl* pOwner); /** * @brief * Called to add the 'Automatic Color' button to the color selector control. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. * @param nIndex Reference to an integer representing the next available * index in the color cell array. * @param x Specifies starting coordinates for the left edge. * @param y Specifies starting coordinates for the top edge. * @param cx Specifies the width of the client area. * @param bChecked TRUE when a color button has been checked. * @return * TRUE if the 'Automatic Color' button was successfully created, * otherwise FALSE. */ virtual BOOL CreateAutoButton(CXTPColorSelectorCtrl* pOwner, int& nIndex, const int x, int& y, const int cx, bool& bChecked); /** * @brief * Called to add default color buttons to the color selector control. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. * @param nIndex Reference to an integer representing the next available * index in the color cell array. * @param x Specifies starting coordinates for the left edge. * @param y Specifies starting coordinates for the top edge. * @param cx Specifies the width of the client area. * @param bChecked TRUE when a color button has been checked. * @return * TRUE if successful, otherwise FALSE. */ virtual BOOL CreateExtendedButtons(CXTPColorSelectorCtrl* pOwner, int& nIndex, const int x, int& y, const int cx, bool& bChecked); /** * @brief * Called to add theme and standard buttons to the color selector control. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. * @param nIndex Reference to an integer representing the next available * index in the color cell array. * @param x Specifies starting coordinates for the left edge. * @param y Specifies starting coordinates for the top edge. * @param cx Specifies the width of the client area. * @param bChecked TRUE when a color button has been checked. * @return * TRUE if successful, otherwise FALSE. */ virtual BOOL CreateThemeButtons(CXTPColorSelectorCtrl* pOwner, int& nIndex, const int x, int& y, const int cx, bool& bChecked); /** * @brief * Called to add recent colors to the color selector control. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. * @param nIndex Reference to an integer representing the next available * index in the color cell array. * @param x Specifies starting coordinates for the left edge. * @param y Specifies starting coordinates for the top edge. * @param cx Specifies the width of the client area. * @param bChecked TRUE when a color button has been checked. * @return * TRUE if successful, otherwise FALSE. */ virtual BOOL CreateRecentColorButtons(CXTPColorSelectorCtrl* pOwner, int& nIndex, const int x, int& y, const int cx, bool& bChecked); /** * @brief * Called to add a 'More Colors' button to the color selector control. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. * @param nIndex Reference to an integer representing the next available * index in the color cell array. * @param x Specifies starting coordinates for the left edge. * @param y Specifies starting coordinates for the top edge. * @param cx Specifies the width of the client area. * @param bChecked TRUE when a color button has been checked. * @return * TRUE if successful, otherwise FALSE. */ virtual BOOL CreateMoreButton(CXTPColorSelectorCtrl* pOwner, int& nIndex, const int x, int& y, const int cx, bool& bChecked); protected: COLORREF m_crTitleText; /**< An RGB value representing the title text color. */ COLORREF m_crTitleBack; /**< An RGB value representing the title background color. */ COLORREF m_crBorderInside; /**< An RGB value representing the inside border highlight color. */ }; /** * @brief * CXTPColorSelectorCtrlThemeVisualStudio2015 is derived from * CXTPColorSelectorCtrlThemeOffice2013 to handle theme specific * visualizations for the CXTPColorSelectorCtrl class. */ class _XTP_EXT_CLASS CXTPColorSelectorCtrlThemeVisualStudio2015 : public CXTPColorSelectorCtrlThemeOffice2013 { public: /** * @brief * Default constructor. */ CXTPColorSelectorCtrlThemeVisualStudio2015(); /** * @brief * Called by the theme manager to refresh the visual styles * used by each component's theme. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. */ virtual void RefreshMetrics(CXTPColorSelectorCtrl* pOwner); /** * @brief * This member function is called to draw the cell specified * by 'pColorCell'. * @param pDC A CDC pointer that represents the current device context. * @param pOwner A pointer to the parent CXTPColorSelectorCtrl object. * @param pColorCell A COLOR_CELL object. * @param bHighlight TRUE if the mouse is over the cell. * @param bPressed TRUE if the cell is pressed. */ virtual void DrawColorCell(CDC* pDC, CXTPColorSelectorCtrl* pOwner, CXTPColorSelectorCtrl::COLOR_CELL* pColorCell, BOOL bHighlight, BOOL bPressed); }; /** * @brief * CXTPColorSelectorCtrlThemeVisualStudio2017 is derived from * CXTPColorSelectorCtrlThemeVisualStudio2015 to handle theme specific * visualizations for the CXTPColorSelectorCtrl class. */ class _XTP_EXT_CLASS CXTPColorSelectorCtrlThemeVisualStudio2017 : public CXTPColorSelectorCtrlThemeVisualStudio2015 { public: /** * @brief * Default constructor. */ CXTPColorSelectorCtrlThemeVisualStudio2017(); }; /** * @brief * CXTPColorSelectorCtrlThemeVisualStudio2019 is derived from * CXTPColorSelectorCtrlThemeVisualStudio2015 to handle theme specific * visualizations for the CXTPColorSelectorCtrl class. */ class _XTP_EXT_CLASS CXTPColorSelectorCtrlThemeVisualStudio2019 : public CXTPColorSelectorCtrlThemeVisualStudio2015 { public: /** * @brief * Default constructor. */ CXTPColorSelectorCtrlThemeVisualStudio2019(); }; /** * @brief * CXTPColorSelectorCtrlThemeVisualStudio2022 is derived from * CXTPColorSelectorCtrlThemeVisualStudio2015 to handle theme specific * visualizations for the CXTPColorSelectorCtrl class. */ class _XTP_EXT_CLASS CXTPColorSelectorCtrlThemeVisualStudio2022 : public CXTPColorSelectorCtrlThemeVisualStudio2015 { public: /** * @brief * Default constructor. */ CXTPColorSelectorCtrlThemeVisualStudio2022(); }; /** * @brief * CXTPColorSelectorCtrlThemeNativeWindows10 is derived from * CXTPColorSelectorCtrlThemeVisualStudio2015 to handle theme specific * visualizations for the CXTPColorSelectorCtrl class. */ class _XTP_EXT_CLASS CXTPColorSelectorCtrlThemeNativeWindows10 : public CXTPColorSelectorCtrlThemeVisualStudio2015 { public: /** * @brief * Default constructor. */ CXTPColorSelectorCtrlThemeNativeWindows10(); }; /** * @brief * CXTPColorSelectorCtrlThemeNativeWindows11 is derived from * CXTPColorSelectorCtrlThemeVisualStudio2015 to handle theme specific * visualizations for the CXTPColorSelectorCtrl class. */ class _XTP_EXT_CLASS CXTPColorSelectorCtrlThemeNativeWindows11 : public CXTPColorSelectorCtrlThemeVisualStudio2015 { public: /** * @brief * Default constructor. */ CXTPColorSelectorCtrlThemeNativeWindows11(); }; ///////////////////////////////////////////////////////////////////////////// /** @cond */ AFX_INLINE void CXTPColorSelectorCtrl::SetBorders(int l, int t, int r, int b) { m_rcBorders.left = l; m_rcBorders.top = t; m_rcBorders.right = r; m_rcBorders.bottom = b; } AFX_INLINE BOOL CXTPColorSelectorCtrl::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) { return CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext); } AFX_INLINE void CXTPColorSelectorCtrl::SetColors(XTP_PICK_BUTTON* pColors, int nCount, int nCols /*=8*/, LPCTSTR lpszTitle /*=NULL*/) { m_pExtendedColors = pColors; m_nExtendedColors = nCount; m_nCols = nCols; m_strTitleCustom = lpszTitle; } AFX_INLINE CXTPColorSelectorCtrlTheme* CXTPColorSelectorCtrl::GetTheme() { return m_pTheme; } AFX_INLINE void CXTPColorSelectorCtrl::AddRecentColor(COLORREF clrRecent) { m_arRecentColors.Add(clrRecent); } AFX_INLINE void CXTPColorSelectorCtrl::ResetRecentColors() { m_arRecentColors.RemoveAll(); } AFX_INLINE CUIntArray& CXTPColorSelectorCtrl::GetRecentColors() { return m_arRecentColors; } AFX_INLINE CXTPPickBtnArray& CXTPColorSelectorCtrl::GetThemeColors() { return m_arThemeColors; } AFX_INLINE CXTPPickBtnArray& CXTPColorSelectorCtrl::GetStandardColors() { return m_arStandardColors; } AFX_INLINE CSize CXTPColorSelectorCtrl::GetButtonSize() const { _ASSERTE(m_pTheme != NULL); return m_pTheme->GetButtonSize(); } AFX_INLINE int CXTPColorSelectorCtrl::GetNumCols() const { return m_nCols; } AFX_INLINE CRect CXTPColorSelectorCtrl::GetBorderRect() const { return m_rcBorders; } AFX_INLINE DWORD CXTPColorSelectorCtrl::GetPopupStyle() const { return m_dwPopup; } AFX_INLINE XTP_PICK_BUTTON* CXTPColorSelectorCtrl::GetExtendedColors() { return m_pExtendedColors; } AFX_INLINE int CXTPColorSelectorCtrl::GetExtendedCount() const { return m_nExtendedColors; } AFX_INLINE int CXTPColorSelectorCtrl::GetCurSel() const { return m_nCurSel; } AFX_INLINE int CXTPColorSelectorCtrl::GetPressed() const { return m_nPressed; } AFX_INLINE COLORREF CXTPColorSelectorCtrl::GetDefColor() const { return m_clrDefault; } AFX_INLINE COLORREF CXTPColorSelectorCtrl::GetCurColor() const { return m_clrColor; } AFX_INLINE CToolTipCtrl& CXTPColorSelectorCtrl::GetToolTipCtrl() { return m_tooltip; } AFX_INLINE CXTPColorSelectorCtrl::CColorCellList& CXTPColorSelectorCtrl::GetColorCellList() { return m_arCells; } AFX_INLINE CString CXTPColorSelectorCtrl::GetThemeTitle() { return m_strTitleTheme; } AFX_INLINE CString CXTPColorSelectorCtrl::GetStandardTitle() { return m_strTitleStandard; } AFX_INLINE CString CXTPColorSelectorCtrl::GetCustomTitle() { return m_strTitleCustom; } AFX_INLINE BOOL CXTPColorSelectorCtrl::HasCaptions() const { return m_bCaptions; } AFX_INLINE void CXTPColorSelectorCtrl::ShowCaptions(BOOL bShow) { m_bCaptions = bShow; } /** @endcond */ ///////////////////////////////////////////////////////////////////////////// # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif //__XTPCOLORSELECTORCTRL_H__ /** @endcond */