/** * @file XTPPropertyGridPaintManager.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(_XTPPROPERTYGRIDPAINTMANAGER_H__) # define _XTPPROPERTYGRIDPAINTMANAGER_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPPropertyGrid; class CXTPPropertyGridInplaceButton; class CXTPPropertyGridItem; class CXTPPropertyGridItemConstraint; class CXTPPropertyGridItemBool; class CXTPWinThemeWrapper; class CXTPButton; class CXTPComboBox; class CXTPPropertyGridPaintManager; /** * @brief * Standalone class used by CXTPPropertyGridPaintManager to store item metrics. */ class _XTP_EXT_CLASS CXTPPropertyGridItemMetrics : public CXTPCmdTarget { public: /** * @brief * Constructs a CXTPPropertyGridItemMetrics object. * @param pPaintManager Pointer to the parent CXTPPropertyGridPaintManager object. */ CXTPPropertyGridItemMetrics(CXTPPropertyGridPaintManager* pPaintManager); /** * @brief * Resets all color values to their default values. */ virtual void SetDefaultValues(); public: CXTPFont m_xtpFontNormal; /**< Normal font. */ CXTPFont m_xtpFontBold; /**< Bold font. */ CXTPFont m_xtpFontUnderline; /**< Underline Font. */ XTP_SUBSTITUTE_GDI_MEMBER_WITH_CACHED(CFont, m_fontNormal, m_xtpFontNormal, GetNormalFontHandle); XTP_SUBSTITUTE_GDI_MEMBER_WITH_CACHED(CFont, m_fontBold, m_xtpFontBold, GetBoldFontHandle); XTP_SUBSTITUTE_GDI_MEMBER_WITH_CACHED(CFont, m_fontUnderline, m_xtpFontUnderline, GetUnderlineFontHandle); int m_nImage; /**< Image index. */ CXTPPaintManagerColor m_clrHelpBack; /**< Color of the description background. */ CXTPPaintManagerColor m_clrHelpFore; /**< Color of the description text. */ CXTPPaintManagerColor m_clrLine; /**< Line color. */ CXTPPaintManagerColor m_clrFore; /**< Color of the item's text. */ CXTPPaintManagerColor m_clrCategoryFore; /**< Color of the category text. */ CXTPPaintManagerColor m_clrBack; /**< Background color. */ CXTPPaintManagerColor m_clrReadOnlyFore; /**< Color of read-only text. */ CXTPPaintManagerColor m_clrVerbFace; /**< Text color of verbs. */ UINT m_uDrawTextFormat; /**< Text formatting style for the property item. */ int m_nMaxLength; /**< Maximum number of characters that can be entered into an editable item (Edit limit). */ protected: CXTPPropertyGridPaintManager* m_pPaintManager; /**< Pointer to the paint manager used to draw the property grid. */ # ifdef _XTP_ACTIVEX /** @cond */ public: DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPPropertyGridItemMetrics) afx_msg COLORREF OleGetForeColor(); afx_msg void OleSetForeColor(COLORREF clr); afx_msg COLORREF OleGetBackColor(); afx_msg void OleSetBackColor(COLORREF clr); afx_msg void OleSetFont(LPFONTDISP pFontDisp); afx_msg LPFONTDISP OleGetFont(); /** @endcond */ # endif }; /** * @brief * Window identifier enumeration. * @see * CXTPPropertyGridPaintManager::DrawPropertyGridBorder */ enum XTPPropertyGridWindow { xtpPropertyGridVerbWindow, /**< Verb window. */ xtpPropertyGridGridWindow, /**< Grid window. */ xtpPropertyGridHelpWindow /**< Help window. */ }; /** * @brief * Standalone class used by CXTPPropertyGrid as the paint manager. */ class _XTP_EXT_CLASS CXTPPropertyGridPaintManager : public CXTPCmdTarget { public: /** * @brief * Constructs a CXTPPropertyGridPaintManager object. * @param pGrid Pointer to a CXTPPropertyGrid object. */ CXTPPropertyGridPaintManager(CXTPPropertyGrid* pGrid); /** * @brief * Destroys a CXTPPropertyGridPaintManager object, handles cleanup * and deallocation. */ virtual ~CXTPPropertyGridPaintManager(); public: /** * @brief * Retrieves the text color of a specified item. * @param pItem Pointer to the item whose text color must be retrieved. * @param bValuePart TRUE if the value part color is needed. * @return * The text color of the specified item. */ virtual COLORREF GetItemTextColor(CXTPPropertyGridItem* pItem, BOOL bValuePart); /** * @brief * Retrieves the back color of a specified item. * @param pItem Pointer to the item whose back color must be retrieved. * @param bValuePart TRUE if the value part color is needed. * @return * The back color of the specified item. */ virtual COLORREF GetItemBackColor(CXTPPropertyGridItem* pItem, BOOL bValuePart); /** * @brief * Retrieves the font of a specified item. * @param pItem Pointer to the item whose font must be retrieved. * @param bValuePart TRUE if the value part font is needed. * @return * A pointer to a CFont object containing the font of the specified item. */ virtual CFont* GetItemFont(CXTPPropertyGridItem* pItem, BOOL bValuePart); public: /** * @brief * Draws the background of the property grid. * @param pDC Pointer to a valid device context. */ virtual void FillPropertyGrid(CDC* pDC); /** * @brief * Draws the background of the view. * @param pDC Pointer to a valid device context. */ virtual void FillPropertyGridView(CDC* pDC); /** * @brief * Draws grid borders. * @param pDC Pointer to a valid device context. * @param rcBorder Reference to the size of the border to draw. * @param nWindow XTPPropertyGridWindow enumeration value that specifies * the window for which the border is to be drawn; possible * values are as follows: 1 = Grid, 2 = Help, 3 = Verb. * @see * FillPropertyGridView */ virtual void DrawPropertyGridBorder(CDC* pDC, RECT& rcBorder, XTPPropertyGridWindow nWindow); /** * @brief * Adjusts the bounding rectangle of the grid. * @param rc Reference to the bounding rectangle of the grid. */ virtual void OnNcCalcSize(RECT& rc); /** * @brief * Draws a single item of the grid. * @param lpDrawItemStruct Long pointer to a DRAWITEMSTRUCT structure containing * information about the type of drawing required. */ virtual void DrawItem(PDRAWITEMSTRUCT lpDrawItemStruct); /** * @brief * Draws a specified constraint in the in-place list. * @param pDC Pointer to a valid device context. * @param pConstraint Pointer to the constraint to draw. * @param rc Bounding rectangle of the constraint. * @param bSelected TRUE if the constraint is currently selected. */ virtual void DrawInplaceListItem(CDC* pDC, CXTPPropertyGridItemConstraint* pConstraint, CRect rc, BOOL bSelected); /** * @brief * Adjusts the rectangle of the value part of a specified item. * @param pItem Pointer to a property grid item. * @param rcValue Reference to the rectangle of the value part of the specified item. */ virtual void AdjustItemValueRect(CXTPPropertyGridItem* pItem, CRect& rcValue); /** * @brief * Adjusts the rectangle of the caption part of a specified item. * @param pItem Pointer to a property grid item. * @param rcCaption Reference to the rectangle of the caption part of the specified item. */ virtual void AdjustItemCaptionRect(CXTPPropertyGridItem* pItem, CRect& rcCaption); /** * @brief * Override this method and fill in a specified MEASUREITEMSTRUCT structure * to inform Windows of the list-box dimensions. * @param lpMeasureItemStruct Long pointer to a MEASUREITEMSTRUCT structure. */ virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct); void FillInplaceButtonThemed(CDC* pDC, CXTPPropertyGridInplaceButton* pButton); /** * @brief * Draws an in-place button for the grid. * @param pDC Pointer to a valid device context. * @param pButton Pointer to a CXTPPropertyGridInplaceButton object. */ virtual void FillInplaceButton(CDC* pDC, CXTPPropertyGridInplaceButton* pButton); /** * @brief * Refreshes the visual metrics of the paint manager. */ virtual void RefreshMetrics(); /** * @brief * Gets the indentifier of the scrollbar theme. * @return * The identifier of the scrollbar theme; one of the values * defined by the XTPScrollBarTheme enumeration. */ virtual XTPScrollBarTheme GetScrollBarTheme() const; /** * @brief * Determines the index of the verb within the verbs collection, if any, * at a specified point. * @param pDC Reference to a valid device context. * @param rcVerbs Bounding rectangle of all verbs. * @param pt Point to be tested. * @return * The index of the verb within the verbs collection, if any, * otherwise a value of -1. */ int HitTestVerbs(CDC* pDC, CRect rcVerbs, CPoint pt); /** * @brief * Gets the default item metrics. * @return * A pointer to the default item metrics. */ CXTPPropertyGridItemMetrics* GetItemMetrics() const; /** * @brief * This method is called by the property grid to retrieve the size of * either the help window splitter bar or the verbs splitter bar. * @param rc Size of the property grid client area. * @param bIsHelp TRUE to retrieve the height of the help window splitter bar, * FALSE to retrieve the height of the verbs splitter bar. * @return * If bIsHelp is set to TRUE, then the size of the help window splitter bar. * if bIsHelp is set to FALSE, then the size of the verbs splitter bar. */ CRect GetSplitterRect(CRect rc, BOOL bIsHelp); /** * @brief * Gets the height of the horizontal grid line between property grid items. * @return * The height, in pixels, of the horizontal grid line between property grid items. */ virtual int GetItemsBorderHeight() const; /** * @brief * Sets the height of the horizontal grid line between property grid items. * @param nHeight Height, in pixels, to be set. */ virtual void SetItemsBorderHeight(int nHeight); /** * @brief * Sets draw a bottom single line for the splitter bar * @param bThinSplitter TRUE to draw a single line for the splitter bar. */ virtual void SetThinSplitter(BOOL bThinSplitter); public: /** * @brief * Draws an expand button for the grid. * @param dc Reference to a valid device context. * @param pItem Pointer to a CXTPPropertyGridItem object. * @param rcCaption Caption button rectangle. */ virtual void DrawExpandButton(CDC& dc, CXTPPropertyGridItem* pItem, CRect rcCaption); /** * @brief * Draws the background for the bounding rectangle of a category caption. * @param pDC Pointer to a valid device context. * @param pItem Pointer to a CXTPPropertyGridItem object. * @param rc Bounding rectangle of the category caption. */ virtual void DrawCategoryCaptionBackground(CDC* pDC, CXTPPropertyGridItem* pItem, CRect rc); /** * @brief * Draws the value part of a property grid item. * @param pDC Pointer to a valid device context. * @param pItem Pointer to a CXTPPropertyGridItem object. * @param rcValue Bounding rectangle of the value part. */ virtual void DrawItemValue(CDC* pDC, CXTPPropertyGridItem* pItem, CRect rcValue); /** * @brief * Draws the caption part of a property grid item. * @param pDC Pointer to a valid device context. * @param pItem Pointer to a CXTPPropertyGridItem object. * @param rcCaption Bounding rectangle of the caption part. */ virtual void DrawItemCaption(CDC* pDC, CXTPPropertyGridItem* pItem, CRect rcCaption); /** * @brief * Draws the in-place buttons of a property grid item. * @param pDC Pointer to a valid device context. * @param lpDrawItemStruct Long pointer to a DRAWITEMSTRUCT structure containing * information about the item to be drawn and * the type of drawing required. * @param pItem Pointer to a CXTPPropertyGridItem object. * @param rcValue Bounding rectangle of the value part. */ virtual void DrawInplaceButtons(CDC* pDC, PDRAWITEMSTRUCT lpDrawItemStruct, CXTPPropertyGridItem* pItem, CRect rcValue); /** * @brief * Draws a checkbox for a CXTPPropertyGridItemOption item with * with the CheckBox style. * @param pDC Pointer to a valid device context. * @param pButton Pointer to a CXTPPropertyGridItemBool object. */ virtual void DrawCheckBox(CDC* pDC, CXTPPropertyGridItemBool* pButton); /** * @brief * Draws a check mark. * @param pDC Pointer to a valid device context. * @param rc Rectangle in logical units. * @param bEnabled TRUE to set to enabled, FALSE to set to disabled. * @param bChecked TRUE to set to checked, FALSE to set to unchecked. */ virtual void DrawCheckMark(CDC* pDC, CRect rc, BOOL bEnabled, BOOL bChecked); /** * @brief * Draws a radio button for a CXTPPropertyGridItemOption item * with the RadioButton (default) style. * @param pDC Pointer to a valid device context. * @param rc Rectangle in logical units. * @param bEnabled TRUE to set to enabled, FALSE to set to disabled. * @param bChecked TRUE to set to checked, FALSE to set to unchecked. */ virtual void DrawRadioMark(CDC* pDC, CRect rc, BOOL bEnabled, BOOL bChecked); virtual void DrawSplitter(CDC* pDC, BOOL bIsHelp); /** @cond */ void DrawInplaceButtons(CDC* pDC, CXTPPropertyGridItem* pItem, CRect rcValue); /**< Obsolete */ /** @endcond */ # ifdef _XTP_INCLUDE_CONTROLS void DrawCheckMarkThemed(CDC* pDC, CRect rc, BOOL bEnabled, BOOL bChecked); void DrawRadioMarkThemed(CDC* pDC, CRect rc, BOOL bEnabled, BOOL bChecked); void SetControlsTheme(int eTheme); /**< XTPControlTheme */ # endif public: XTPPropertyGridInplaceButtonsStyle m_buttonsStyle; /**< TRUE to use WinXP themes. */ CXTPWinThemeWrapper* m_themeTree; /**< Themes for tree controls. */ CXTPWinThemeWrapper* m_themeButton; /**< Themes for button controls */ CXTPWinThemeWrapper* m_themeCombo; /**< Themes for combo button. */ BOOL m_bTransparent; /**< TRUE to draw background with parent color. */ # ifdef _XTP_INCLUDE_CONTROLS CXTPButton* m_pButton; CXTPButton* m_pButtonCheck; CXTPComboBox* m_pCombo; BOOL m_bUseThemedControls; # else private: CXTPExcludedMemberPadding m_pButton; CXTPExcludedMemberPadding m_pButtonCheck; CXTPExcludedMemberPadding m_pCombo; CXTPExcludedMemberPadding m_bUseThemedControls; public: # endif public: CXTPPaintManagerColor m_clrFace; /**< Face color. */ CXTPPaintManagerColor m_clrShadow; /**< Shadow color. */ CXTPPaintManagerColor m_clrHighlight; /**< Highlight color. */ CXTPPaintManagerColor m_clrHighlightText; /**< Highlight text color. */ CXTPPaintManagerColor m_clrNonHighlightBack; /**< Non-highlight background color. */ CXTPPaintManagerColor m_clrNonHighlightText; /**< Non-highlight text color. */ CXTPPaintManagerColor m_clrCategorySeparator; /**< Face color. */ CXTPPaintManagerColor m_clrSplitter; /**< Splitter border color. */ protected: int m_nItemsBorderHeight; /**< Height, in pixels, of the horizontal border between property grid items. */ int m_nSplitterHeight; /**< Height, in pixels, of the splitter bar. */ int m_nHelpHeight; /**< Height, in pixels, of the description area (help pane). */ int m_nVerbsHeight; /**< Height, in pixels, of the verbs box. */ BOOL m_bThinSplitter; /**< TRUE to draw a single line for the splitter bar. */ CXTPPropertyGrid* m_pGrid; /**< Parent grid class. */ CXTPPropertyGridItemMetrics* m_pMetrics; /**< Default metrics of the item. */ friend class CXTPPropertyGrid; # ifdef _XTP_ACTIVEX /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPPropertyGridPaintManager) DECLARE_PROPERTY(HelpBackColor, COLORREF); DECLARE_PROPERTY(HelpForeColor, COLORREF); DECLARE_PROPERTY(ViewBackColor, COLORREF); DECLARE_PROPERTY(ViewForeColor, COLORREF); DECLARE_PROPERTY(LineColor, COLORREF); DECLARE_PROPERTY(ViewCategoryForeColor, COLORREF); DECLARE_PROPERTY(ViewReadOnlyForeColor, COLORREF); DECLARE_PROPERTY(BackgroundColor, COLORREF); DECLARE_PROPERTY(ShadowColor, COLORREF); DECLARE_PROPERTY(HighlightBackColor, COLORREF); DECLARE_PROPERTY(HighlightForeColor, COLORREF); DECLARE_PROPERTY(HyperlinkColor, COLORREF); DECLARE_PROPERTY(ItemsBorderHeight, long); /** @endcond */ # endif }; /** * @brief * CXTPPropertyGridOffice2003Theme is a CXTPPropertyGridPaintManager * derived class. It represents an Office 2003 style theme. */ class _XTP_EXT_CLASS CXTPPropertyGridOffice2003Theme : public CXTPPropertyGridPaintManager { public: /** * @brief * Constructs a CXTPPropertyGridOffice2003Theme object. * @param pGrid Pointer to a CXTPPropertyGrid object. */ CXTPPropertyGridOffice2003Theme(CXTPPropertyGrid* pGrid); /** * @brief * Refreshes the visual metrics of the property grid. */ virtual void RefreshMetrics(); /** * @brief * Gets the scrollbar theme identifier. * @return * The scrollbar theme identifier; one of the values * defined by the XTPScrollBarTheme enumeration. */ virtual XTPScrollBarTheme GetScrollBarTheme() const; protected: BOOL m_bLunaTheme; /**< TRUE to use luna colors, FALSE otherwise. */ }; /** * @brief * CXTPPropertyGridOffice2007Theme is a CXTPPropertyGridOffice2003Theme * derived class. It represents an Office 2007 style theme. */ class _XTP_EXT_CLASS CXTPPropertyGridOffice2007Theme : public CXTPPropertyGridOffice2003Theme { public: /** * @brief * Constructs a CXTPPropertyGridOffice2003Theme object. * @param pGrid Pointer to a CXTPPropertyGrid object. */ CXTPPropertyGridOffice2007Theme(CXTPPropertyGrid* pGrid); /** * @brief * Refreshes the visual metrics of the property grid. */ virtual void RefreshMetrics(); protected: /** * @brief * Draws an in-place button for the grid. * @param pDC Pointer to a valid device context. * @param pButton Pointer to a CXTPPropertyGridInplaceButton object. */ virtual void FillInplaceButton(CDC* pDC, CXTPPropertyGridInplaceButton* pButton); /** * @brief * Draws a check mark. * @param pDC Pointer to a valid device context. * @param rc Rectangle in logical units. * @param bEnabled TRUE to set to enabled, FALSE to set to disabled. * @param bChecked TRUE to set to checked, FALSE to set to unchecked. */ virtual void DrawCheckMark(CDC* pDC, CRect rc, BOOL bEnabled, BOOL bChecked); /** * @brief * Draws a radio button for a CXTPPropertyGridItemOption item * with the RadioButton (default) style. * @param pDC Pointer to a valid device context. * @param rc Rectangle in logical units. * @param bEnabled TRUE to set to enabled, FALSE to set to disabled. * @param bChecked TRUE to set to checked, FALSE to set to unchecked. */ virtual void DrawRadioMark(CDC* pDC, CRect rc, BOOL bEnabled, BOOL bChecked); /** * @brief * Draws an expand button for the grid. * @param dc Reference to a valid device context. * @param pItem Pointer to a CXTPPropertyGridItem object. * @param rcCaption Caption button rectangle. */ void DrawExpandButton(CDC& dc, CXTPPropertyGridItem* pItem, CRect rcCaption); /** * @brief * Gets the scrollbar theme identifier. * @return * The scrollbar theme identifier; one of the values * defined by the XTPScrollBarTheme enumeration. */ virtual XTPScrollBarTheme GetScrollBarTheme() const; }; /** * @brief * CXTPPropertyGridNativeXPTheme is a CXTPPropertyGridPaintManager * derived class. It represents a Native Windows XP style theme. */ class _XTP_EXT_CLASS CXTPPropertyGridNativeXPTheme : public CXTPPropertyGridPaintManager { public: /** * @brief * Constructs a CXTPPropertyGridNativeXPTheme object. * @param pGrid Pointer to a CXTPPropertyGrid object. */ CXTPPropertyGridNativeXPTheme(CXTPPropertyGrid* pGrid); /** * @brief * Refreshes the visual metrics of the property grid. */ virtual void RefreshMetrics(); /** * @brief * Gets the scrollbar theme identifier. * @return * The scrollbar theme identifier; one of the values * defined by the XTPScrollBarTheme enumeration. */ virtual XTPScrollBarTheme GetScrollBarTheme() const; }; /** * @brief * CXTPPropertyGridOfficeXPTheme is a CXTPPropertyGridPaintManager * derived class. It represents an Office XP style theme. */ class _XTP_EXT_CLASS CXTPPropertyGridOfficeXPTheme : public CXTPPropertyGridPaintManager { public: /** * @brief * Constructs a CXTPPropertyGridOfficeXPTheme object. * @param pGrid Pointer to a CXTPPropertyGrid object. */ CXTPPropertyGridOfficeXPTheme(CXTPPropertyGrid* pGrid); /** * @brief * Refreshes the visual metrics of the property grid. */ void RefreshMetrics(); /** * @brief * Gets the scrollbar theme identifier. * @return * The scrollbar theme identifier; one of the values * defined by the XTPScrollBarTheme enumeration. */ virtual XTPScrollBarTheme GetScrollBarTheme() const; }; /** * @brief * CXTPPropertyGridCoolTheme is a CXTPPropertyGridPaintManager * derived class. It represents a Cool style theme. */ class _XTP_EXT_CLASS CXTPPropertyGridCoolTheme : public CXTPPropertyGridPaintManager { public: /** * @brief * Constructs a CXTPPropertyGridCoolTheme object. * @param pGrid Pointer to a CXTPPropertyGrid object. */ CXTPPropertyGridCoolTheme(CXTPPropertyGrid* pGrid); /** * @brief * Draws a single item for the grid. * @param lpDrawItemStruct Long pointer to a DRAWITEMSTRUCT structure containing * information about the type of drawing required. */ virtual void DrawItem(PDRAWITEMSTRUCT lpDrawItemStruct); /** * @brief * Refreshes the visual metrics of the property grid. */ void RefreshMetrics(); /** * @brief * Gets the scrollbar theme identifier. * @return * The scrollbar theme identifier; one of the values * defined by the XTPScrollBarTheme enumeration. */ virtual XTPScrollBarTheme GetScrollBarTheme() const; }; /** * @brief * CXTPPropertyGridSimpleTheme is a CXTPPropertyGridPaintManager * derived class. It represents a Simple style theme. */ class _XTP_EXT_CLASS CXTPPropertyGridSimpleTheme : public CXTPPropertyGridPaintManager { public: /** * @brief * Constructs a CXTPPropertyGridSimpleTheme object. * @param pGrid Pointer to a CXTPPropertyGrid object. */ CXTPPropertyGridSimpleTheme(CXTPPropertyGrid* pGrid); /** * @brief * Draws a single item for the grid. * @param lpDrawItemStruct Long pointer to a DRAWITEMSTRUCT structure containing * information about the type of drawing required. */ virtual void DrawItem(PDRAWITEMSTRUCT lpDrawItemStruct); /** * @brief * Refreshes the visual metrics of the property grid. */ void RefreshMetrics(); /** * @brief * Gets the scrollbar theme identifier. * @return * The scrollbar theme identifier; one of the values * defined by the XTPScrollBarTheme enumeration. */ virtual XTPScrollBarTheme GetScrollBarTheme() const; }; /** * @brief * CXTPPropertyGridDelphiTheme is a CXTPPropertyGridPaintManager * derived class. It represents a Delphi style theme. */ class _XTP_EXT_CLASS CXTPPropertyGridDelphiTheme : public CXTPPropertyGridPaintManager { public: /** * @brief * Constructs a CXTPPropertyGridDelphiTheme object. * @param pGrid Pointer to a CXTPPropertyGrid object. */ CXTPPropertyGridDelphiTheme(CXTPPropertyGrid* pGrid); /** * @brief * Draws a single item for the grid. * @param lpDrawItemStruct Long pointer to a DRAWITEMSTRUCT structure containing * information about the type of drawing required. */ virtual void DrawItem(PDRAWITEMSTRUCT lpDrawItemStruct); /** * @brief * Refreshes the visual metrics of the property grid. */ virtual void RefreshMetrics(); /** * @brief * Gets the scrollbar theme identifier. * @return * The scrollbar theme identifier; one of the values * defined by the XTPScrollBarTheme enumeration. */ virtual XTPScrollBarTheme GetScrollBarTheme() const; }; /** * @brief * CXTPPropertyGridVisualStudio2005Theme is a CXTPPropertyGridPaintManager * derived class. It represents a Visual Studio 2005 style theme. */ class _XTP_EXT_CLASS CXTPPropertyGridVisualStudio2005Theme : public CXTPPropertyGridPaintManager { public: /** * @brief * Constructs a CXTPPropertyGridVisualStudio2005Theme object. * @param pGrid Pointer to a CXTPPropertyGrid object. */ CXTPPropertyGridVisualStudio2005Theme(CXTPPropertyGrid* pGrid); protected: /** * @brief * Draws the background for the bounding rectangle of a category caption. * @param pDC Pointer to a valid device context. * @param pItem Pointer to a CXTPPropertyGridItem object. * @param rc Bounding rectangle of the category caption. */ void DrawCategoryCaptionBackground(CDC* pDC, CXTPPropertyGridItem* pItem, CRect rc); /** * @brief * Refreshes the visual metrics of the property grid. */ void RefreshMetrics(); /** * @brief * Draws an expand button for the grid. * @param dc Reference to a valid device context. * @param pItem Pointer to a CXTPPropertyGridItem object. * @param rcCaption Caption button rectangle. */ void DrawExpandButton(CDC& dc, CXTPPropertyGridItem* pItem, CRect rcCaption); /** * @brief * Gets the scrollbar theme identifier. * @return * The scrollbar theme identifier; one of the values * defined by the XTPScrollBarTheme enumeration. */ virtual XTPScrollBarTheme GetScrollBarTheme() const; }; /** * @brief * CXTPPropertyGridVisualStudio2010Theme is a CXTPPropertyGridPaintManager * derived class. It represents a Visual Studio 2010 style theme. */ class _XTP_EXT_CLASS CXTPPropertyGridVisualStudio2010Theme : public CXTPPropertyGridPaintManager { public: /** * @brief * Constructs a CXTPPropertyGridVisualStudio2010Theme object. * @param pGrid Pointer to a CXTPPropertyGrid object. */ CXTPPropertyGridVisualStudio2010Theme(CXTPPropertyGrid* pGrid); /** * @brief * Destroys a CXTPPropertyGridVisualStudio2010Theme object, * handles cleanup and deallocation. */ ~CXTPPropertyGridVisualStudio2010Theme(); public: /** * @brief * Draws an expand button for the grid. * @param dc Reference to a valid device context. * @param pItem Pointer to a CXTPPropertyGridItem object. * @param rcCaption Caption button rectangle. */ virtual void DrawExpandButton(CDC& dc, CXTPPropertyGridItem* pItem, CRect rcCaption); /** * @brief * Refreshes the visual metrics of the property grid. */ virtual void RefreshMetrics(); /** * @brief * Gets the scrollbar theme identifier. * @return * The scrollbar theme identifier; one of the values * defined by the XTPScrollBarTheme enumeration. */ virtual XTPScrollBarTheme GetScrollBarTheme() const; }; /** * @brief * CXTPPropertyGridVisualStudio2012Theme is a CXTPPropertyGridVisualStudio2010Theme * derived class. It represents a Visual Studio 2012 style theme. */ class _XTP_EXT_CLASS CXTPPropertyGridVisualStudio2012Theme : public CXTPPropertyGridPaintManager { public: /** * @brief * Constructs a CXTPPropertyGridVisualStudio2012Theme object. * @param pGrid Pointer to a CXTPPropertyGrid object * @param bLight TRUE to use Visual Studio light theme. */ CXTPPropertyGridVisualStudio2012Theme(CXTPPropertyGrid* pGrid, BOOL bLight); /** * @brief * Refreshes the visual metrics of the property grid. */ virtual void RefreshMetrics(); /** * @brief * Draws an expand button for the grid. * @param dc Reference to a valid device context. * @param pItem Pointer to a CXTPPropertyGridItem object. * @param rcCaption Caption button rectangle. */ virtual void DrawExpandButton(CDC& dc, CXTPPropertyGridItem* pItem, CRect rcCaption); /** * @brief * Gets the scrollbar theme identifier. * @return * The scrollbar theme identifier; one of the values * defined by the XTPScrollBarTheme enumeration. */ virtual XTPScrollBarTheme GetScrollBarTheme() const; protected: BOOL m_bLight; }; /** * @brief * CXTPPropertyGridOffice2013Theme is a CXTPPropertyGridPaintManager * derived class. It represents an Office 2013 style theme. */ class _XTP_EXT_CLASS CXTPPropertyGridOffice2013Theme : public CXTPPropertyGridPaintManager { public: /** * @brief * Constructs a CXTPPropertyGridOffice2013Theme object. * @param pGrid Pointer to a CXTPPropertyGrid object. */ CXTPPropertyGridOffice2013Theme(CXTPPropertyGrid* pGrid); /** * @brief * Refreshes the visual metrics of the property grid. */ virtual void RefreshMetrics(); /** * @brief * Draws an expand button for the grid. * @param dc Reference to a valid device context. * @param pItem Pointer to a CXTPPropertyGridItem object. * @param rcCaption Caption button rectangle. */ virtual void DrawExpandButton(CDC& dc, CXTPPropertyGridItem* pItem, CRect rcCaption); /** * @brief * Gets the scrollbar theme identifier. * @return * The scrollbar theme identifier; one of the values * defined by the XTPScrollBarTheme enumeration. */ virtual XTPScrollBarTheme GetScrollBarTheme() const; CXTPPaintManagerColor m_clrGlyphExpand; /**< Expand glyph color. */ CXTPPaintManagerColor m_clrGlyphBorder; /**< Expand glyph border color. */ CXTPPaintManagerColor m_clrGlyphContract; /**< Contract glyph color. */ }; /** * @brief * CXTPPropertyGridVisualStudio2015Theme is a CXTPPropertyGridVisualStudio2010Theme * derived class. It represents a Visual Studio 2015 style theme. */ class _XTP_EXT_CLASS CXTPPropertyGridVisualStudio2015Theme : public CXTPPropertyGridVisualStudio2010Theme { public: /** * @brief * Constructs a CXTPPropertyGridVisualStudio2015Theme object. * @param pGrid Pointer to a CXTPPropertyGrid object. */ CXTPPropertyGridVisualStudio2015Theme(CXTPPropertyGrid* pGrid); /** * @brief * Draws an expand button for the grid. * @param dc Reference to a valid device context. * @param pItem Pointer to a CXTPPropertyGridItem object. * @param rcCaption Caption button rectangle. */ virtual void DrawExpandButton(CDC& dc, CXTPPropertyGridItem* pItem, CRect rcCaption); /** * @brief * Refreshes the visual metrics of the property grid. */ virtual void RefreshMetrics(); /** * @brief * Gets the scrollbar theme identifier. * @return * The scrollbar theme identifier; one of the values * defined by the XTPScrollBarTheme enumeration. */ virtual XTPScrollBarTheme GetScrollBarTheme() const; }; /** * @brief * CXTPPropertyGridVisualStudio2017Theme is a CXTPPropertyGridVisualStudio2010Theme * derived class. It represents a Visual Studio 2017 style theme. */ class _XTP_EXT_CLASS CXTPPropertyGridVisualStudio2017Theme : public CXTPPropertyGridVisualStudio2010Theme { public: /** * @brief * Constructs a CXTPPropertyGridVisualStudio2017Theme object. * @param pGrid Pointer to a CXTPPropertyGrid object. */ CXTPPropertyGridVisualStudio2017Theme(CXTPPropertyGrid* pGrid); /** * @brief * Draws an expand button for the grid. * @param dc Reference to a valid device context. * @param pItem Pointer to a CXTPPropertyGridItem object. * @param rcCaption Caption button rectangle. */ virtual void DrawExpandButton(CDC& dc, CXTPPropertyGridItem* pItem, CRect rcCaption); /** * @brief * Refreshes the visual metrics of the property grid. */ virtual void RefreshMetrics(); /** * @brief * Gets the scrollbar theme identifier. * @return * The scrollbar theme identifier; one of the values * defined by the XTPScrollBarTheme enumeration. */ virtual XTPScrollBarTheme GetScrollBarTheme() const; }; /** * @brief * CXTPPropertyGridVisualStudio2019Theme is a CXTPPropertyGridVisualStudio2010Theme * derived class. It represents a Visual Studio 2019 style theme. */ class _XTP_EXT_CLASS CXTPPropertyGridVisualStudio2019Theme : public CXTPPropertyGridVisualStudio2010Theme { public: /** * @brief * Constructs a CXTPPropertyGridVisualStudio2019Theme object. * @param pGrid Pointer to a CXTPPropertyGrid object. */ CXTPPropertyGridVisualStudio2019Theme(CXTPPropertyGrid* pGrid); /** * @brief * Draws an expand button for the grid. * @param dc Reference to a valid device context. * @param pItem Pointer to a CXTPPropertyGridItem object. * @param rcCaption Caption button rectangle. */ virtual void DrawExpandButton(CDC& dc, CXTPPropertyGridItem* pItem, CRect rcCaption); /** * @brief * Refreshes the visual metrics of the property grid. */ virtual void RefreshMetrics(); /** * @brief * Gets the scrollbar theme identifier. * @return * The scrollbar theme identifier; one of the values * defined by the XTPScrollBarTheme enumeration. */ virtual XTPScrollBarTheme GetScrollBarTheme() const; }; /** * @brief * CXTPPropertyGridVisualStudio2022Theme is a CXTPPropertyGridVisualStudio2010Theme * derived class. It represents a Visual Studio 2022 style theme. */ class _XTP_EXT_CLASS CXTPPropertyGridVisualStudio2022Theme : public CXTPPropertyGridVisualStudio2010Theme { public: /** * @brief * Constructs a CXTPPropertyGridVisualStudio2022Theme object. * @param pGrid Pointer to a CXTPPropertyGrid object. */ CXTPPropertyGridVisualStudio2022Theme(CXTPPropertyGrid* pGrid); /** * @brief * Draws an expand button for the grid. * @param dc Reference to a valid device context. * @param pItem Pointer to a CXTPPropertyGridItem object. * @param rcCaption Caption button rectangle. */ virtual void DrawExpandButton(CDC& dc, CXTPPropertyGridItem* pItem, CRect rcCaption); /** * @brief * Refreshes the visual metrics of the property grid. */ virtual void RefreshMetrics(); /** * @brief * Gets the scrollbar theme identifier. * @return * The scrollbar theme identifier; one of the values * defined by the XTPScrollBarTheme enumeration. */ virtual XTPScrollBarTheme GetScrollBarTheme() const; }; /** * @brief * CXTPPropertyGridNativeWindows10Theme is a CXTPPropertyGridVisualStudio2010Theme * derived class. It represents a Native Windows 10 style theme. */ class _XTP_EXT_CLASS CXTPPropertyGridNativeWindows10Theme : public CXTPPropertyGridVisualStudio2010Theme { public: /** * @brief * Constructs a CXTPPropertyGridNativeWindows10Theme object. * @param pGrid Pointer to a CXTPPropertyGrid object. */ CXTPPropertyGridNativeWindows10Theme(CXTPPropertyGrid* pGrid); /** * @brief * Draws an expand button for the grid. * @param dc Reference to a valid device context. * @param pItem Pointer to a CXTPPropertyGridItem object. * @param rcCaption Caption button rectangle. */ virtual void DrawExpandButton(CDC& dc, CXTPPropertyGridItem* pItem, CRect rcCaption); /** * @brief * Refreshes the visual metrics of the property grid. */ virtual void RefreshMetrics(); /** * @brief * Gets the scrollbar theme identifier. * @return * The scrollbar theme identifier; one of the values * defined by the XTPScrollBarTheme enumeration. */ virtual XTPScrollBarTheme GetScrollBarTheme() const; }; /** * @brief * CXTPPropertyGridNativeWindows11Theme is a CXTPPropertyGridVisualStudio2010Theme * derived class. It represents a Native Windows 10 style theme. */ class _XTP_EXT_CLASS CXTPPropertyGridNativeWindows11Theme : public CXTPPropertyGridVisualStudio2010Theme { public: /** * @brief * Constructs a CXTPPropertyGridNativeWindows11Theme object. * @param pGrid Pointer to a CXTPPropertyGrid object. */ CXTPPropertyGridNativeWindows11Theme(CXTPPropertyGrid* pGrid); /** * @brief * Draws an expand button for the grid. * @param dc Reference to a valid device context. * @param pItem Pointer to a CXTPPropertyGridItem object. * @param rcCaption Caption button rectangle. */ virtual void DrawExpandButton(CDC& dc, CXTPPropertyGridItem* pItem, CRect rcCaption); /** * @brief * Refreshes the visual metrics of the property grid. */ virtual void RefreshMetrics(); /** * @brief * Gets the scrollbar theme identifier. * @return * The scrollbar theme identifier; one of the values * defined by the XTPScrollBarTheme enumeration. */ virtual XTPScrollBarTheme GetScrollBarTheme() const; }; AFX_INLINE CXTPPropertyGridItemMetrics* CXTPPropertyGridPaintManager::GetItemMetrics() const { return m_pMetrics; } AFX_INLINE void CXTPPropertyGridPaintManager::DrawInplaceButtons(CDC* pDC, CXTPPropertyGridItem* pItem, CRect rcValue) { DrawInplaceButtons(pDC, NULL, pItem, rcValue); } AFX_INLINE int CXTPPropertyGridPaintManager::GetItemsBorderHeight() const { return m_nItemsBorderHeight; } AFX_INLINE void CXTPPropertyGridPaintManager::SetItemsBorderHeight(int nHeight) { m_nItemsBorderHeight = nHeight; } AFX_INLINE void CXTPPropertyGridPaintManager::SetThinSplitter(BOOL bThinSplitter) { m_bThinSplitter = bThinSplitter; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(_XTPPROPERTYGRIDPAINTMANAGER_H__) /** @endcond */