/** * @file XTPGridPaintManager.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(__XTPGRIDPAINTMANAGER_H__) # define __XTPGRIDPAINTMANAGER_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPMarkupUIElement; class CXTPImageManager; class CXTPWinThemeWrapper; struct XTP_GRIDRECORDITEM_DRAWARGS; struct XTP_GRIDRECORDITEM_METRICS; class CXTPGridControl; class CXTPGridRow; class CXTPGridHeader; class CXTPGridColumn; class CXTPGridColumns; class CXTPGridGroupRow; class CXTPGridInplaceButton; class CXTPGridHyperlink; class CXTPGridRecordItem; class CXTPGridRecordItemControl; class CXTPGridHyperlinkStyle; class CXTPGridBorder; class CXTPTrackBlock; class CXTPComboBox; /** * @brief * Utility class that handles most drawing activities. It stores all of * the settings required by a control to perform drawing operations * (i.e. fonts, colors, and styles for all other classes of a control). * It also implements all functions for drawing typical graphical * primitives and functions that directly work with the device context. * @details * Can be overridden to provide another look and feel for the control. Thus, * you have an easy way to change the "skin" of your control. Just provide * your own implementation of CXTPGridPaintManager and there is no need to * touch the functionality for other classes of the control. * * You create a CXTPGridPaintManager object by calling its constructor. * Furthermore, you can call getter and setter functions to change every * setting as you wish. * @see * CXTPGridControl overview, CXTPGridRow, CXTPGridGroupRow, * CXTPGridColumn, CXTPGridHeader */ class _XTP_EXT_CLASS CXTPGridPaintManager : public CXTPCmdTarget { DECLARE_DYNAMIC(CXTPGridPaintManager); /** @cond */ friend class CXTPGridControl; /** @endcond */ public: /** * @brief * Default CXTPGridPaintManager constructor, handles properties initialization. * @see * RefreshMetrics */ CXTPGridPaintManager(); /** * @brief * Default CXTPGridPaintManager destructor, handles member items deallocation. */ virtual ~CXTPGridPaintManager(); /** * @brief * Sets the associated Grid control for the paint manager. * @param pControl Pointer to the Grid control to set. */ virtual void SetGridControl(CXTPGridControl* pControl); /** @cond */ _XTP_DEPRECATED_IN_FAVOR(SetGridControl) virtual void SetReportControl(CXTPGridControl* pControl); /** @endcond */ public: /** * @brief * Loads the default images used by the Grid control. */ virtual void LoadGlyphs(); /** * @brief * Initializes all drawings defaults (fonts, colors, etc.). Most * of them are system defaults. * @see * CXTPGridPaintManager */ virtual void RefreshMetrics(); /** * @brief * Retrieves the default row height for print mode * (i.e. the height of the default rectangle where the row's items will be drawn). * @param pDC Pointer to the used device context. * @param pRow Pointer to a grid row. * @return * The default row height for print mode. * * Example: *
int nRowHeight = GetRowHeight(pDC, pRow)*/ virtual int GetRowHeight(CDC* pDC, CXTPGridRow* pRow); /** * @brief * Retrieves the default row height for print mode * (i.e. the height of the default rectangle where the row's items will be drawn). * @param pDC Pointer to the used device context. * @param pRow Pointer to a grid row. * @param nTotalWidth Width of the row. * @return * The default row height for print mode. * * Example: *
int nRowHeight = GetRowHeight(pDC, pRow)*/ virtual int GetRowHeight(CDC* pDC, CXTPGridRow* pRow, int nTotalWidth); /** * @brief * Retrieves the default row height for print mode * (i.e. the height of the default rectangle where the row's items will be drawn). * @param pDC Pointer to the used device context. * @param pRow Pointer to a grid row. * @param nTotalWidth Width of the row. * @param firstLevel Represents the first level. * @return * The default row height for print mode. * * Example: *
int nRowHeight = GetRowHeight(pDC, pRow)*/ int GetRowHeightEx(CDC* pDC, CXTPGridRow* pRow, int nTotalWidth, const BOOL firstLevel = TRUE); /** * @brief * Retrieves the height of a record item for a given width. * @param drawArgs Draws arguments. * @param nWidth Width of the rectangle where the item will be drawn. * @return * The height of the record item for the given width. */ int GetItemHeight(XTP_GRIDRECORDITEM_DRAWARGS& drawArgs, int nWidth); /** * @brief * Searches the topmost or bottommost row depending on the height of * the current row. The height of rows depends on merged cells which * can contain big text or other content. * @param pColumns Pointer to a CXTPGridColumns object. * @param pRow Pointer to a CXTPGridRow object. * @param bUpward TRUE to set the search direction upward from the current row, * @param nAdjRowIndex Adjust row index value. * FALSE to set the search direction downward. * @return * TRUE if successful, otherwise FALSE. */ BOOL FindRowAdjacentToMergedEx(const CXTPGridColumns* pColumns, const CXTPGridRow* pRow, int& nAdjRowIndex, BOOL bUpward); /** * @brief * Wrapper for the FindRowAdjacentToMergedEx method. Searches the * topmost or bottommost row depending on the height of the current row. * @param pColumns Pointer to a CXTPGridColumns object. * @param pRow Pointer to a CXTPGridRow object. * @param bUpward TRUE to set the search direction upward from the current row, * FALSE to set the search direction downward. * @return * The index of the adjacent row. */ int FindRowAdjacentToMerged(const CXTPGridColumns* pColumns, const CXTPGridRow* pRow, BOOL bUpward); /** * @brief * Recalculates row height according to the height of merged items. * @param pColumns Pointer to a CXTPGridColumns object. * @param pDC Pointer to the used device context. * @param pRow Pointer to a CXTPGridRow object. * @param nRowHeight Height of pRow without merge cells. * @param nTotalWidth Width of the row for print mode. * @return * The height of the default rectangle where the row's items will be drawn. */ int RecalcTotalHightOfMergedRows(CXTPGridColumns* pColumns, CDC* pDC, CXTPGridRow* pRow, int nRowHeight, int nTotalWidth); /** * @brief * Retrieves the height of a preview item for print mode. * @param pDC Pointer to the used device context. * @param pRow Pointer to a CXTPGridRow object. * @param nWidth Width of the preview item. * @param nHeight Height of the preview item. * @return * The height of the default rectangle where the preview item will be drawn. * * Example: *
int nPreviewItemHeight = GetPreviewItemHeight(pDC, pRow, nWidth, nHeight)*/ virtual int GetPreviewItemHeight(CDC* pDC, CXTPGridRow* pRow, int nWidth, int nHeight); /** * @brief * Gets the column header height. * @return * The current height of the rectangle where the column's headers are drawn. */ virtual int GetHeaderHeight(); /** * @brief * Calculates the optimal header height. * @param pControl Pointer to a Grid control. * @param pDC Pointer to the used device context. * @param nTotalWidth Total header width; used only for printing. * @return * The optimal header height. */ virtual int GetHeaderHeight(CXTPGridControl* pControl, CDC* pDC, int nTotalWidth = 0); /** * @brief * Sets the column header height. * @param nHeight Header height to be set. */ virtual void SetHeaderHeight(int nHeight); /** * @brief * Calculates the optimal footer height. * @param pControl Pointer to a Grid control. * @param pDC Pointer to the used device context. * @param nTotalWidth Total footer width; used only for printing. * @return * The optimal footer height. */ virtual int GetFooterHeight(CXTPGridControl* pControl, CDC* pDC, int nTotalWidth = 0); /** * @brief * Retrieves the parent Grid control's background color. * @param pControl Pointer to the parent Grid control object. * @return * The color used to fill the parent Grid control's client rectangle. */ virtual COLORREF GetControlBackColor(CXTPGridControl* pControl); /** * @brief * Fills a specified row with its background color. * @param pDC Pointer to the used device context. * @param pRow Pointer to the row. * @param rcRow Row area rectangle coordinates. * * Example: *
* // paint row background * pPaintManager->FillRow(pDC, this, rcRow); **/ virtual void FillRow(CDC* pDC, CXTPGridRow* pRow, CRect rcRow); /** * @brief * Draws a grid for the control. * @param pDC Pointer to the used device context. * @param orientation Determines the grid lines to be tested. * @param rcGrid Grid area rectangle coordinates. * * Example: *
* // draw vertical grid in Row * CRect rcGridItem(rcRowRect); * pPaintManager->DrawGrid(pDC, TRUE, rcGridItem); * * // draw horizontal grid in Row * CPaintDC pDC(this); * CRect rcGridItem(rcRowRect); * pPaintManager->DrawGrid(pDC, FALSE, rcGridItem); **/ virtual void DrawGrid(CDC* pDC, XTPGridOrientation orientation, CRect rcGrid); /** * @brief * Draws a freeze column divider. * @param pDC Pointer to the used device context. * @param rc Reference to rectangle coordinates. * @param pControl Pointer to a Grid control. * @param pRow Pointer to a row. */ virtual void DrawFreezeColsDivider(CDC* pDC, const CRect& rc, CXTPGridControl* pControl, CXTPGridRow* pRow = NULL); /** * @brief * Draws a vertical timeline marker. * @param pDC Pointer to the used device context. * @param xPos The x- coordinate where the vertical timeline marker will be drawn. * @param pControl Pointer to a Grid control. * @param color Color of the marker. */ virtual void DrawVerticalTimeLineMarker(CDC* pDC, int xPos, CXTPGridControl* pControl, COLORREF color = RGB(0, 255, 0)); // Return current Print Page Width after Preview mode was call and set value int GetPrintPageWidth(); virtual CRect GetGroupRowBmpSize(CRect rcRow, int nBitmapOffset); virtual CRect GetGroupRowTextSize(CRect rcBitmap, CRect rcRow, int nBitmapWidth, int nNoIconWidth, int nTextOffset); virtual void DrawGroupRowBack(CDC* pDC, CRect rcRow, XTP_GRIDRECORDITEM_METRICS* pMetrics); /** * @brief * Draws a group row. * @param pDC Pointer to the used device context. * @param pRow Pointer to the Group Row. * @param rcRow Group row area rectangle coordinates. * @param pMetrics Pointer to an XTP_GRIDRECORDITEM_METRICS structure. * * Example: *
* CXTPGridPaintManager* pPaintManager = m_pControl->GetPaintManager(); * pDC->SetBkMode(TRANSPARENT); * pPaintManager->DrawGroupRow(pDC, this, rcRow); **/ virtual void DrawGroupRow(CDC* pDC, CXTPGridGroupRow* pRow, CRect rcRow, XTP_GRIDRECORDITEM_METRICS* pMetrics); /** * @brief * Fills the font and color members of the metrics structure * for a specified group row. * @param pRow Pointer to the group row. * @param pMetrics Pointer to the metrics structure to be filled. * @param bPrinting TRUE if printing mode is enabled. */ virtual void FillGroupRowMetrics(CXTPGridGroupRow* pRow, XTP_GRIDRECORDITEM_METRICS* pMetrics, BOOL bPrinting); /** * @brief * Fills an indent area by its background. * @param pDC Pointer to the used device context. * @param rcRow Row area rectangle coordinates. * * Example: *
* CXTPGridPaintManager* pPaintManager = m_pControl->GetPaintManager(); * CRect rcRow(rcClient); * // Get default row height * int nRowHeight = m_pControl->GetRowHeight(FALSE) * rcRow.bottom = rcRow.top + nRowHeight; * pPaintManager->FillIndent(pDC, rcRow); **/ virtual void FillIndent(CDC* pDC, CRect rcRow); /** * @brief * Fills an item shade by its background if necessary. * @param pDC Pointer to the used device context. * @param rcItem Item area rectangle coordinates. * * Example: *
* CXTPGridPaintManager* pPaintManager = m_pControl->GetPaintManager(); * CRect rcItem(m_rcRow); * pPaintManager->FillItemShade(pDC, rcItem); **/ virtual void FillItemShade(CDC* pDC, CRect rcItem); /** * @brief * Fills a column header control area by its background. * @param pDC Pointer to the used device context. * @param rcHeader Header area rectangle coordinates. * * Example: *
* CXTPGridPaintManager* pPaintManager = m_pControl->GetPaintManager(); * CRect rcHeader(rcClient); * int nHeaderHeight = m_pControl->GetHeaderHeight(); * rcHeader.bottom = rcHeader.top + nHeaderHeight; * pPaintManager->FillHeaderControl(pDC, rcHeader); **/ virtual void FillHeaderControl(CDC* pDC, CRect rcHeader); /** * @brief * Fills a column footer control area by its background. * @param pDC Pointer to the used device context. * @param rcFooter Footer area rectangle coordinates. */ virtual void FillFooter(CDC* pDC, CRect rcFooter); /** * @brief * Draws text for the column header. * @param pDC Pointer to the used device context. * @param rcText Size and position of the text to render. * @param strCaption NULL-terminated string representing the caption text. * @param nHeaderAlignment DT_ text alignment flags. * @param bIsHeader TRUE if the column is to be rendered for the header. * @param bColumnPressed TRUE if the column is pressed by the user. */ virtual void DrawColumnText(CDC* pDC, CRect rcText, CString strCaption, int nHeaderAlignment, BOOL bIsHeader, BOOL bColumnPressed); /** * @brief * Draws a column header with all related attributes (sort order, icon, etc.). * @param pDC Pointer to the used device context. * @param pColumn Pointer to column header area rectangle coordinates. * @param pHeader Pointer to the grid header. * @param rcColumn Column area rectangle coordinates. * @param bDrawExternal TRUE to draw the column above the header; * the default value for this parameter is FALSE. * @param nShadowWidth Size in pixels for the bottom shadow; * the default value for this parameter is 0. * * Example: *
* CXTPGridPaintManager* pPaintManager = m_pControl->GetPaintManager(); * CXTPGridColumn* pColumn = CXTPGridColumn* pColumn = m_pColumns->GetAt(1); * CRect rcHeader(rcClient); * int nHeaderHeight = m_pControl->GetHeaderHeight(); * rcHeader.bottom = rcHeader.top + nHeaderHeight; * GetPaintManager()->DrawColumn(pDC, pColumn, this, rcHeader); **/ virtual void DrawColumn(CDC* pDC, CXTPGridColumn* pColumn, CXTPGridHeader* pHeader, CRect rcColumn, BOOL bDrawExternal = FALSE, int nShadowWidth = 0); /** * @brief * Draws the column footer divider. * @param pDC Pointer to the used device context. * @param pColumn Pointer to column header area rectangle coordinates. * @param rcColumn Column area rectangle coordinates. */ virtual void DrawColumnFooterDivider(CDC* pDC, CXTPGridColumn* pColumn, CRect rcColumn); /** * @brief * Draws the column footer with all related attributes (e.g. footer text). * @param pDC Pointer to the used device context. * @param pColumn Pointer to column header area rectangle coordinates. * @param pHeader Pointer to the grid header. * @param rcColumn Column area rectangle coordinates. */ virtual void DrawColumnFooter(CDC* pDC, CXTPGridColumn* pColumn, CXTPGridHeader* pHeader, CRect rcColumn); /** * @brief * Determines if hot tracking is enabled for the current column style. * @return * TRUE if hot tracking is enabled, otherwise FALSE. * @details * Hot tracking can only be used for the xtpGridColumnOffice2003 * and xtpGridColumnExplorer styles. * @see * m_columnStyle, m_bHotTracking */ virtual BOOL IsColumHotTrackingEnabled() const; /** * @brief * Draws focused rows. * @param pDC Pointer to the used device context. * @param rcRow Area rectangle coordinates. * * Example: *
* CRect rcClient(GetParent()->GetClientRect()); * CXTPGridHeader* pHeader = m_pColumns->GetGridHeader(); * CXTPGridPaintManager* pPaintManager = m_pControl->GetPaintManager(); * GetPaintManager()->DrawResizingRect(pDC, pHeader, rcClient); **/ virtual void DrawFocusedRow(CDC* pDC, CRect rcRow); /** * @brief * Draws the Group By box. * @param pDC Pointer to the used device context. * @param rcGroupBy Reference to Group By box area rectangle coordinates. * * Example: *
* CXTPGridPaintManager* pPaintManager = m_pControl->GetPaintManager(); * pPaintManager->FillGroupByControl(pDC, rcGroupBy); **/ virtual void FillGroupByControl(CDC* pDC, CRect& rcGroupBy); /** * @brief * Gets a pointer to the additional image list with glyphs. * @details * The additional image list is usually used for bitmaps of collapsed * icons, etc. You call this member function to get a pointer to the * additional image list and manipulate its contents as you wish. * @return * A pointer to the additional imahe list with glyphs. */ CXTPImageManager* GetGlyphs() const; /** * @brief * Draws a horizontal line. * @param pDC Pointer to the used device context. * @param xPos Horizontal coordinate of the beginning of the line. * @param yPos Vertical coordinate of the beginning of the line. * @param cx Length of the line. * @param clr Color of the line. * @details * This member function is called anywhere in the control where a * simple horizontal line must be drawn. */ void DrawHorizontalLine(CDC* pDC, int xPos, int yPos, int cx, COLORREF clr); /** * @brief * Draws a vertical line. * @param pDC Pointer to the used device context. * @param xPos Horizontal coordinate of the beginning of the line. * @param yPos Vertical coordinate of the beginning of the line. * @param cy Length of the line. * @param clr Color of the line. * @details * This member function is called anywhere in the control where a * simple vertical line must be drawn. */ void DrawVerticalLine(CDC* pDC, int xPos, int yPos, int cy, COLORREF clr); /** * @brief * Draws a triangle that shows the sort order of the column. * @param pDC Pointer to the used device context. * @param rcTriangle Triangle area rectangle coordinates. * @param bToDown TRUE to turn the top of the triangle downward, * FALSE to turn the top of the triangle upward. * @param bDraggingFromHeader TRUE if the column is being dragged from the header area. * @param nShadowWidth Size, in pixels, of the shadow to draw under * the triangle image, or 0 to disable the shadow; * the default value for this parameter is 0. * @param bColumnPressed TRUE if the column is pressed by the user. * @details * This function is used to draw a triangle image on the header of * the column that is sorted. The triangle represents the direction * of the sort: ascending or descending. The size of the triangle * depends on the rectangle area provided. * * Example: *
* // draw ascendant triangle * CRect rcTriangle; * rcTriangle.CopyRect(rcHeader); * rcTriangle.DeflateRect(40, 5, 5, 5); * DrawTriangle(pDC, rcTriangle, TRUE); * * // draw descendant triangle * CRect rcTriangle; * rcTriangle.CopyRect(rcHeader); * rcTriangle.DeflateRect(40, 5, 5, 5); * DrawTriangle(pDC, rcTriangle, FALSE); **/ virtual void DrawTriangle(CDC* pDC, CRect rcTriangle, BOOL bToDown, BOOL bDraggingFromHeader, int nShadowWidth, BOOL bColumnPressed); virtual void DrawColumnInverted(CDC* pDC, CRect rcColumn, BOOL bColumnPressed, BOOL bDraggingFromHeader, int nShadowWidth); /** * @brief * Draws a column connector for the Group By box. * @param pDC Pointer to the used device context. * @param ptFrom Source point of the connector. * @param ptTo Target point of the connector. * @details * You use this function to draw a line that represents a * chain of columns in the Group By box. It connects columns * in the Group By box together. * * Example: *
* DrawConnector(pDC, CPoint(rcItem.right 5, rcItem.bottom), CPoint(x, rcItem.bottom * + 4)); **/ void DrawConnector(CDC* pDC, CPoint ptFrom, CPoint ptTo); /** * @brief * Draws a collapsed bitmap. * @param pDC Pointer to the used device context. * @param pRow Pointer to a grid row. * @param rcBitmap Reference to bitmap area rectangle coordinates. * @return * The size of the drawn bitmap. */ virtual CSize DrawCollapsedBitmap(CDC* pDC, const CXTPGridRow* pRow, CRect& rcBitmap); /** * @brief * Draws a bitmap. * @param pDC Pointer to the used device context. * @param pControl Pointer to the Grid control where the bitmap will be drawn. * @param rcColumn Bitmap area rectangle coordinates. * @param iImage Image index. * Remarks * You use this function to draw a bitmap in the column rectangle. * If the provided rectangle is too small, the bitmap will not be drawn. * Generally, the column rectangle must be big enough to contain * text (if presented) and a bitmap. * @return * The width of the drawn bitmap. * * Example: *
* // draws bitmap with id ID_READ * pPaintManager->DrawBitmap(pDC, pControl, rcColumn, ID_READ); **/ virtual int DrawBitmap(CDC* pDC, CXTPGridControl* pControl, CRect rcColumn, int iImage); /** * @brief * Draws an icon for a column. * @param pDC Pointer to the used device context. * @param pColumn Pointer to a column object. * @param rcColumn Column rectangle. * @param rcIcon Image bounding rectangle. * @param iIcon Image index. * @return * The width of the drawn bitmap. */ virtual int DrawColumnIcon(CDC* pDC, CXTPGridColumn* pColumn, CRect rcColumn, CRect rcIcon, int iIcon); /** * @brief * Draws the standard glyphs of the Grid control. * @param pDC Pointer to the used device context. * @param rcColumn Bitmap area rectangle coordinates. * @param iImage Image index. * @return * The size of the drawn bitmap. */ virtual CSize DrawGlyph(CDC* pDC, CRect rcColumn, int iImage); /** * @brief * Draws the shell icon. * @param pDC Pointer to the used device context. * @param rcColumn Bitmap area rectangle coordinates. * @param iImage Image index. * @return * The size of the drawn bitmap. */ virtual CSize DrawShellIcon(CDC* pDC, CRect rcColumn, int iImage); /** * @brief * Enables/disables preview mode for the control. * @param bIsPreviewMode TRUE to enable preview mode, * FALSE to disable preview mode. * @details * Preview mode has two states: enabled and disabled. When preview is * enabled, the control tries to show additional bands with preview text. * * Example: *
* // enable preview mode * EnablePreviewMode(TRUE); * * // disable preview mode * EnablePreviewMode(FALSE); **/ void EnablePreviewMode(BOOL bIsPreviewMode); /** * @brief * Determines if preview mode is enabled/disabled for the control. * @return * TRUE if preview mode is enabled, FALSE if preview mode is disabled. */ BOOL IsPreviewMode() const; /** * @brief * Gets the default text font used for control items. * @return * The default text font used for control items. */ CFont* GetTextFont(); /** * @brief * Sets the maximum number of lines of text for a preview item. * @param nMaxLines New maximum number of lines of text for a preview item. * @details * You use this member function to bound the height of a textPreview item * by setting the maximum rows of text for it. * @return * The previous maximum number of lines of text for a preview item. * * Example: *
int nOldMaxLines = SetMaxPreviewLines(4);*/ int SetMaxPreviewLines(int nMaxLines); /** * @brief * Gets the maximum number of lines of text for a preview item. * @return * The maximum number of lines of text for a preview item. */ int GetMaxPreviewLines(); /** * @brief * Calculates the number of lines required to draw a specified preview * text string, taking into account the maximum number of lines of text * for a preview item. * @param pDC Pointer to the used device context. * @param rcText Reference to text area rectangle coordinates. * @param strText Reference to the preview text string. * @details * This function calculates the number of lines required to draw the * specified preview text string based on the length of the preview text * string, the preview text font, and the width of the provided rectangle. * If the calculated number of lines is greater than the maximum number * of lines of text for a preview item, then the maximum number of lines * of text for a preview item will be returned instead. * @return * If the calculated number of lines required to draw the preview text * string is greater than the maximum number of lines of text for a preview * item, then the maximum number of lines of text for a preview item will * be returned. Otherwise, the calculated number of lines will be returned. */ int GetPreviewLinesCount(CDC* pDC, CRect& rcText, const CString& strText); /** * @brief * Determines the visibility of specified grid lines. * @param bVertical Determines the grid lines to be tested; * TRUE to test vertical grid lines, * FALSE to test horizontal grid lines. * @return * TRUE if the tested grid lines are visible, otherwise FALSE. */ BOOL IsGridVisible(BOOL bVertical) const; /** * @brief * Determines the visibility of specified grid lines. * @param orientation Determines the grid lines to be tested. * must be one of the values defined by * the XTPGridOrientation enumeration. * @return * TRUE if the tested grid lines are visible, otherwise FALSE. */ BOOL IsGridVisible(XTPGridOrientation orientation) const; /** * @brief * Sets the header style. * @param columnStyle Header style to be set; must be one of the values * defined by the XTPGridColumnStyle enumeration. * @see * GetColumnStyle, XTPGridColumnStyle */ void SetColumnStyle(XTPGridColumnStyle columnStyle); /** * @brief * Gets the header style. * @return * The header style; one of the values defined by the * XTPGridColumnStyle enumeration. * @see * SetColumnStyle, XTPGridColumnStyle */ XTPGridColumnStyle GetColumnStyle() const; /** * @brief * Sets the header's custom theme base color for Office2007 column style. * @param clrBaseColor Custom theme base color for Office2007 column style. * Set this value to -1 to use the standard theme. * @see * GetColumnOffice2007CustomThemeBaseColor */ void SetColumnOffice2007CustomThemeBaseColor(COLORREF clrBaseColor); /** * @brief * Gets the header's custom theme base color for Office2007 column style. * @return * The custom theme base color for Office2007 column style. * A value of -1 means that the standard theme is used. * @see * SetColumnOffice2007CustomThemeBaseColor */ COLORREF GetColumnOffice2007CustomThemeBaseColor() const; /** * @brief * Creates and sets the default text font. * @param lf Reference to a LOGFONT structure. * @see * LOGFONT, SetCaptionFont */ void SetTextFont(LOGFONT& lf); /** * @brief * Creates and sets the default caption font. * @param lf Reference to a LOGFONT structure. * @see * LOGFONT, SetTextFont */ void SetCaptionFont(LOGFONT& lf); /** * @brief * Sets the preview item indent. * @param nLeft Left indent to be set. * @param nTop Top indent to be set. * @param nRight Right indent to be set. * @param nBottom Bottom indent to be set. */ void SetPreviewIndent(int nLeft, int nTop, int nRight, int nBottom); /** * @brief * Draws the in-place button of the Grid control. * @param pDC Pointer to the device context. * @param pButton Pointer to the in-place button to draw. */ virtual void DrawInplaceButton(CDC* pDC, CXTPGridInplaceButton* pButton); /** * @brief * Draws the combo button of the Grid control. * @param pDC Pointer to the device context. * @param pRc Pointer to the rectangle to draw. * @return * TRUE if the operation was successful, otherwise FALSE. */ virtual BOOL DrawInplaceComboButton(CDC* pDC, CRect* pRc); /** * @brief * Draws the expand button of the Grid control. * @param pDC Pointer to the device context. * @param pRc Pointer to the rectangle to draw. * @return * TRUE if the operation was successful, otherwise FALSE. */ virtual BOOL DrawInplaceExpandButton(CDC* pDC, CRect* pRc); /** * @brief * Draws the spin button of the Grid control. * @param pDC Pointer to the device context. * @param pRc Pointer to the rectangle to draw. * @return * TRUE if the operation was successful, otherwise FALSE. */ virtual BOOL DrawInplaceSpinButton(CDC* pDC, CRect* pRc); /** * @brief * Draws tree elements of the Grid control. * @param pDrawArgs Pointer to an XTP_GRIDRECORDITEM_DRAWARGS * structure containing drawing arguments. * @param pMetrics Pointer to an XTP_GRIDRECORDITEM_METRICS * structure containing item metrics. * @param rcItem Item area rectangle coordinates. * @param sizeGlyph Item glyph rectangle coordinates. */ virtual void DrawTreeStructure(XTP_GRIDRECORDITEM_DRAWARGS* pDrawArgs, XTP_GRIDRECORDITEM_METRICS* pMetrics, CRect rcItem, CSize sizeGlyph); /** * @brief * Draws an item bitmap. Override this method to draw a custom bitmap. * @param pDrawArgs Pointer to an XTP_GRIDRECORDITEM_DRAWARGS * structure containing drawing arguments. * @param rcItem Reference to item area rectangle coordinates. * @param nImage Image index. */ virtual void DrawItemBitmap(XTP_GRIDRECORDITEM_DRAWARGS* pDrawArgs, CRect& rcItem, int nImage); /** * @brief * Draws an item caption. Override this method to draw a custom caption. * @param pDrawArgs Pointer to an XTP_GRIDRECORDITEM_DRAWARGS * structure containing drawing arguments. * @param pMetrics Pointer to an XTP_GRIDRECORDITEM_METRICS * structure containing item metrics. */ virtual void DrawItemCaption(XTP_GRIDRECORDITEM_DRAWARGS* pDrawArgs, XTP_GRIDRECORDITEM_METRICS* pMetrics); /** * @brief * Draws a row number. Override this method to draw differently. * @param pDC Pointer to a valid device context. * @param rcNumber Number area rectangle coordinates. * @param pRow Pointer to the grid row. */ virtual void DrawRowNumber(CDC* pDC, CRect rcNumber, CXTPGridRow* pRow); /** * @brief * Draws an item control. Override this method to draw a custom control. * @param pDrawArgs Pointer to an XTP_GRIDRECORDITEM_DRAWARGS * structure containing drawing arguments. * @param pControl Pointer to the control to draw. * @param rcItem Reference to item area rectangle coordinates. */ virtual void DrawItemControl(XTP_GRIDRECORDITEM_DRAWARGS* pDrawArgs, CXTPGridRecordItemControl* pControl, CRect& rcItem); /** * @brief * Determines if the paint manager supports fixed or variable row height. * @return * TRUE if the paint manager supports fixed row height, * FALSE if the paint manager supports variable row height. * @see * GetRowHeight */ BOOL IsFixedRowHeight() const; /** * @brief * Sets if the paint manager supports fixed or variable row height. * @param bFixedRowHeight TRUE to set fixed row height, * FALSE to set variable row height. * @see * GetRowHeight */ void SetFixedRowHeight(BOOL bFixedRowHeight); /** * @brief * Determines if the paint manager supports column width WYSIWYG mode. * @return * TRUE if the paint manager supports column width WYSIWYG mode, * otherwise FALSE. */ BOOL IsColumnWidthWYSIWYG() const; /** * @brief * Determines if the paint manager supports last column width WYSIWYG mode. * @return * TRUE if the paint manager supports last column width WYSIWYG mode, * otherwise FALSE. */ BOOL IsLastColumnWidthWYSIWYG() const; /** * @brief * Determines if the paint manager shows WYSIWYG page-end markers. * @return * TRUE if the paint manager shows WYSIWYG page-end markers, * otherwise FALSE. */ BOOL IsShowWYSIWYGMarkers() const; /** * @brief * Sets if the paint manager shows WYSIWYG page-end markers. * @param bSet TRUE to show WYSIWYG page-end markers, FALSE otherwise. */ void ShowWYSIWYGMarkers(BOOL bSet); /** * @brief * Sets if the paint manager supports column width WYSIWYG mode. * @param bColumnWidthWYSIWYG TRUE to set column width WYSIWYG mode, * FALSE otherwise. */ void SetColumnWidthWYSIWYG(BOOL bColumnWidthWYSIWYG); /** * @brief * Sets if the paint manager supports last column width WYSIWYG mode. * @param bColumnWidthWYSIWYG TRUE to set last column width WYSIWYG mode, * FALSE otherwise. */ void SetLastColumnWidthWYSIWYG(BOOL bColumnWidthWYSIWYG); /** * @brief * Determines if the paint manager supports fixed or variable * in-place button height. * @return * TRUE if the paint manager supports fixed in-place button height, * FALSE if the paint manager supports variable in-place button height. * @see * SetInplaceButtonHeight */ BOOL IsFixedInplaceButtonHeight() const; /** * @brief * Sets if the paint manager supports fixed or variable * in-place button height. * @param bFixedInplaceButtonHeight TRUE to set fixed in-place button height, * FALSE to set variable in-place button height. * @see * IsFixedInplaceButtonHeight */ void SetInplaceButtonHeight(BOOL bFixedInplaceButtonHeight); /** * @brief * Gets the style of the freeze columns divider line. * @return * The style of the freeze columns divider line, one of the values * defined by the XTPGridFreezeColsDividerStyle enumeration. * @see * XTPGridFreezeColsDividerStyle */ int GetFreezeColsDividerStyle() const; /** * @brief * Sets the style for the freeze columns divider line. * @param nStyle Style for the freeze columns divider line; must be one of the * values defined by the XTPGridFreezeColsDividerStyle enumeration. * @see * XTPGridFreezeColsDividerStyle */ void SetFreezeColsDividerStyle(int nStyle); /** * @brief * Override this method to perform custom activities for the item * before processing it. * @param pDrawArgs Pointer to an XTP_GRIDRECORDITEM_DRAWARGS * structure containing drawing arguments. * @return * TRUE if the item requires further processing. */ virtual BOOL OnDrawAction(XTP_GRIDRECORDITEM_DRAWARGS* pDrawArgs); /** * @brief * Draws the "No items" text message in the Group By area when there * are no items inside it. Override this method for custom drawing. * @param pDC Pointer to the used device context. * @param rcItem Text area rectangle coordinates. * @see * CXTPGridPaintManager::m_strNoGroupBy */ virtual void DrawNoGroupByText(CDC* pDC, CRect rcItem); /** * @brief * Determines if the grid fills empty space after body rows. * @details * By default, the grid does not fill empty space after body rows. * @return * TRUE if the grid fills empty space after body rows, otherwise FALSE. */ BOOL IsDrawGridForEmptySpace() const; /** * @brief * Sets if the grid fills empty space after body rows. * @param bDrawGrid TRUE to set the grid to fill empty space after body rows, * FALSE otherwise. */ void SetDrawGridForEmptySpace(BOOL bDrawGrid); /** * @brief * Determines if the group row collapse-expand icon is drawn in print mode. * @return * TRUE if the group row collapse-expand icon is drawn in print mode, * otherwise FALSE. */ BOOL IsPrintGroupRowIcon() const; /** * @brief * Sets if the group row collapse-expand icon is drawn in print mode. * @param bDraw TRUE to set the group row collapse-expand icon to be * drawn in print mode, FALSE otherwise. */ void SetPrintGroupRowIcon(BOOL bDraw); /** * @brief * Determines if columns use expand/collapse icons (+/-) or directional arrows. * @return * TRUE if columns use expand/collapse icons (+/-), * FALSE if columns use directional arrows. */ BOOL IsColumnPlusMinusSign() const; /** * @brief * Specifies if columns use expand/collapse icons (+/-) or directional arrows. * @param bDraw TRUE to set columns to use expand/collapse icons (+/-), * FALSE to set columns to use directional arrows. */ void SetColumnPlusMinusSign(BOOL bDraw); CXTPGridBorder* GetDefaultItemBorder() const; CXTPGridBorder* GetItemBorder(const CXTPGridRecordItem* pItem) const; virtual int DrawTrackBlock(CDC* pDC, CRect rc, BOOL bSelected, CXTPTrackBlock* pTrackBlock) { _ASSERTE(FALSE); /**< not handled. */ UNREFERENCED_PARAMETER(pDC); UNREFERENCED_PARAMETER(rc); UNREFERENCED_PARAMETER(bSelected); UNREFERENCED_PARAMETER(pTrackBlock); return 0; }; # if XTP_GRID_DEPRECATED() /** * @brief * Gets the grid style. * @param bvertical Determines the grid style to get; * TRUE to get the vertical grid style, * FALSE to get the horizontal grid style. * @return * The grid style; one of the values defined by the XTPGridLineStyle enumeration. */ XTPGridLineStyle GetGridStyle(BOOL bVertical) const; /** @cond */ _XTP_DEPRECATED_IN_FAVOR(GetGridStyle) XTPGridLineStyle GetReportStyle(BOOL bVertical) const; /** @endcond */ /** * @brief * Sets the grid style. * @param bVertical Determines the grid style to set; * TRUE to set the vertical grid style, * FALSE to set the horizontal grid style. * @param gridStyle Grid style to be set; can be * any of the values listed in the Remarks section. * @details * Grid style can be one of the following: * xtpGridGridNoLines: Empty line. * xtpGridGridSmallDots: Line drawn by small dots. * xtpGridGridLargeDots: Line drawn by large dots. * xtpGridGridDashes: Line drawn by dashes. * xtpGridGridSolid: Draws solid line. * @see * XTPGridGridStyle */ void SetGridStyle(BOOL bVertical, XTPGridLineStyle lineStyle); /** @cond */ _XTP_DEPRECATED_IN_FAVOR(SetGridStyle) void SetReportStyle(BOOL bVertical, XTPGridLineStyle lineStyle); /** @endcond */ /** * @brief * Gets the grid line color. * @return * The grid line color. */ COLORREF GetGridColor() const; /** @cond */ _XTP_DEPRECATED_IN_FAVOR(GetGridColor) COLORREF GetReportColor() const; /** @endcond */ /** * @brief * Sets the grid line color. * @param clrGridLine Grid line color to be set. * @return * The previous grid line color. * * Example: *
* // Set new color, save old one * COLORREF clrOld; * clrOld = SetGridColor(RGB(0, 255, 0)); **/ COLORREF SetGridColor(COLORREF clrGridLine); /** @cond */ _XTP_DEPRECATED_IN_FAVOR(SetGridColor) COLORREF SetReportColor(COLORREF clrGridLine); /** @endcond */ # endif protected: /** * @brief * Draws a line of text with respect to the drawing rectangle. * @param pDrawArgs Pointer to an XTP_GRIDRECORDITEM_DRAWARGS * structure containing drawing arguments. * @param pMetrics Pointer to an XTP_GRIDRECORDITEM_METRICS * structure containing item metrics. * @param strText Reference to a text string. * @param rcItem Item area rectangle coordinates. * @param nFlag Flag can be the following values: * * DT_END_ELLIPSIS truncate text by ellipses. * * DT_WORDBREAK truncate text by word end. * @param nCharCounter Reference to a printed char counter; * accepts value before and returns value after drawing. * @param nHyperlinkCounter Reference to printed hyperlinks counter; * accepts value before and returns value after drawing. * @details * This member function is used internally by DrawText() and draws one line of text. * It processes plain/hyperlink text for one line. For multi-line text, it processes * the last line and then truncates the text either by ellipses or by word. */ virtual void DrawTextLine(XTP_GRIDRECORDITEM_DRAWARGS* pDrawArgs, XTP_GRIDRECORDITEM_METRICS* pMetrics, const CString& strText, CRect rcItem, int nFlag, int& nCharCounter, int& nHyperlinkCounter); /** * @brief * Draw a simple string into rectangle * @param pnCurrDrawPos Pointer to the current drawing position * (is updated after each call to this function). * @param pDC Point to used device context. * @param strDraw Reference to a text string. * @param rcDraw Text area rectangle coordinates. * @param nFormat Flag can allow next values: * * DT_END_ELLIPSIS truncate text by ellipses. * * DT_WORDBREAK truncate text by word end. * * @details * This member function is used internally by DrawTextLine to draw the * plain chunk of a text string. * @return * The position in the string where drawing was stopped. */ virtual int DrawString(int* pnCurrDrawPos, CDC* pDC, const CString& strDraw, CRect rcDraw, UINT nFormat); /** * @brief * This method is called to draw the background of a column using * the current column style. * @param pDC Pointer to the used device context. * @param pColumn Pointer to the column whose background must be drawn. * @param rcColumn Bounding rectangle of the column. * @param bColumnPressed TRUE if the column is pressed by the user. * @param bDraggingFromHeader TRUE if the column is being dragged from the header area. * @param pHeader Pointer to the header that the column belongs to. */ virtual void DrawColumnBackground(CDC* pDC, CXTPGridColumn* pColumn, CRect rcColumn, BOOL& bColumnPressed, BOOL& bDraggingFromHeader, CXTPGridHeader* pHeader = NULL); virtual void DrawPlainColumnBackground(CDC* /*pDC*/, CRect /*rcColumn*/); protected: /** * @brief * Generates a custom grid pattern if necessary. * Otherwise, uses the initially created grid pattern. * @param pDC Pointer to the device context. * @param pBrush Pointer to a CBrush object. * @param rc Rectangle area. * @param pPattern Pointer to a short-integer array containing the * initial bitmap bit values. If this parameter is * NULL, then the new bitmap is left uninitialized. * @param clr Pattern color. * @param bUpdateBrush TRUE to recreate pBrush from pPattern, FALSE otherwise. */ virtual void DrawGridPattern(CDC* pDC, CBrush* pBrush, CRect rc, const void* pPattern, COLORREF clr, BOOL bUpdateBrush); /** * @brief * Generates a custom grid pattern if necessary. * Otherwise, uses the initially created grid pattern. * @param pDC Pointer to the device context. * @param pBrush Pointer to a CBrush object. * @param rc Rectangle area. * @param pPattern Pointer to a short-integer array containing the * initial bitmap bit values. If this parameter is * NULL, then the new bitmap is left uninitialized. * @param clr Pattern color. * @param bUpdateBrush TRUE to recreate pBrush from pPattern, FALSE otherwise. */ virtual void DrawGridPattern(CDC* pDC, CXTPBrush* pBrush, CRect rc, const void* pPattern, COLORREF clr, BOOL bUpdateBrush); /** * @brief * Generates a custom grid pattern. * This method only uses pPattern initially. * @param pDC Pointer to the device context. * @param pBrush Pointer to a CBrush object. * @param rc Rectangle area. * @param pPattern Pointer to a short-integer array containing the * initial bitmap bit values. If this parameter is * NULL, then the new bitmap is left uninitialized. * @param clr Pattern color. */ virtual void DrawGridPattern(CDC* pDC, CBrush* pBrush, CRect rc, const void* pPattern, COLORREF clr); /** * @brief * Draws the in-place button frame. * @param pDC Pointer to the device context. * @param pButton Pointer to the in-place button. */ virtual void DrawInplaceButtonFrame(CDC* pDC, CXTPGridInplaceButton* pButton); /** * @brief * Draws the in-place button icon. * @param pDC Pointer to the device context. * @param pButton Pointer to the in-place button. * @return * TRUE if the icon was drawn successfully, otherwise FALSE. */ virtual BOOL DrawInplaceButtonIcon(CDC* pDC, CXTPGridInplaceButton* pButton); /** * @brief * Calculates the optimal height for a specified column. * @param pDC Pointer to the device context. * @param pColumn Pointer to a CXTPGridColumn object. * @param nTotalWidth Total header width (used only for printing). * @return * The optimal height for the specified column. */ virtual int CalcColumnHeight(CDC* pDC, CXTPGridColumn* pColumn, int nTotalWidth = 0); /** * @brief * Draws multi-line text. * @param pDrawArgs Pointer to an XTP_GRIDRECORDITEM_DRAWARGS * structure containing drawing arguments. * @param pMetrics Pointer to an XTP_GRIDRECORDITEM_METRICS * structure containing item metrics. * @param strText Reference to a text string. * @param rcItem Item area rectangle coordinates. * @param bWordBreak TRUE to break lines by words, FALSE to only * allow new line characters to force new lines. * @details * This method keeps hyperlinks active. */ virtual void DrawMultiLineText(XTP_GRIDRECORDITEM_DRAWARGS* pDrawArgs, XTP_GRIDRECORDITEM_METRICS* pMetrics, const CString& strText, CRect rcItem, BOOL bWordBreak = TRUE); /** * @brief * Draws single-line text. * @param pDrawArgs Pointer to an XTP_GRIDRECORDITEM_DRAWARGS * structure containing drawing arguments. * @param pMetrics Pointer to an XTP_GRIDRECORDITEM_METRICS * structure containing item metrics. * @param strText Reference to a text string. * @param rcItem Item area rectangle coordinates. * @param nStartPos Start position in strText. * @param nEndPos End position in strText. * @param nActualWidth Width of the text to be drawn. * @details * This method keeps hyperlinks active. */ virtual void DrawSingleLineText(XTP_GRIDRECORDITEM_DRAWARGS* pDrawArgs, XTP_GRIDRECORDITEM_METRICS* pMetrics, const CString& strText, CRect rcItem, int nStartPos, int nEndPos, int nActualWidth); public: /** * @brief * Calculates the height required for a rectangle bounding multi-line text * to draw the multi-line text when the width of the rectangle is fixed. * @param pDC Pointer to the device context. * @param strText Reference to a text string. * @param nMaxWidth Maximum width of the rectangle bounding the text. * @param bWordBreak TRUE to break lines by words, FALSE to only allow * new line characters to increase the row height. * @return * The height required for the rectangle to draw the multi-line text. */ virtual int CalculateRowHeight(CDC* pDC, const CString& strText, int nMaxWidth, BOOL bWordBreak = TRUE); /** @cond */ virtual CRect CalculateMaxTextRect(CDC* pDC, const CString& strText, const CRect& rcMaxRect, BOOL bWordBreak = TRUE, BOOL bLimitSize = TRUE, UINT uiFlags = 0); /** @endcond */ protected: /** * @brief * Draws a hyperlink string using hyperlink text settings (i.e. removes blanks). * @param pnCurrDrawPos Pointer to the current drawing position * (is updated after each call to this function). * @param pDrawArgs Pointer to an XTP_GRIDRECORDITEM_DRAWARGS * structure containing drawing arguments. * @param pMetrics Pointer to an XTP_GRIDRECORDITEM_METRICS * structure containing item metrics. * @param pHyperlink Pointer to a CXTPGridHyperlink object. * @param strText Text string. * @param rcLink Link hot spot area rectangle coordinates. * @param nFlag Flag can allow next values: * * DT_END_ELLIPSIS truncate text by ellipses. * * DT_WORDBREAK truncate text by word end. * * @param bTrim TRUE to trim the hyperlink, FALSE otherwise. * @details * This member function is used internally by DrawTextLine to draw the * hyperlink chunk of a text string and update the hyperlink's hot spot. * If the hyperlink begins/ends with blanks, then the blanks are removed. * @return * The position in the string where drawing was stopped. */ virtual int DrawLink(int* pnCurrDrawPos, XTP_GRIDRECORDITEM_DRAWARGS* pDrawArgs, XTP_GRIDRECORDITEM_METRICS* pMetrics, CXTPGridHyperlink* pHyperlink, CString strText, CRect rcLink, int nFlag, BOOL bTrim = FALSE); virtual void DrawWindowFrame(CDC* pDC, CRect rcWindow); public: /** * @brief * Draws the divider between grid sections * (e.g. dividing header record rows and body rows). * @param pDC Pointer to the used device context. * @param rc Reference to rectangle coordinates. * @param dividerPosition Position of the section divider; must be one of the values * defined by the XTPGridSectionDividerPosition enumeration. * @param dividerStyle Style of the section divider; must be one of the values * defined by the XTPGridSectionDividerStyle enumeration. * @param dividerColor Color of the section divider. */ void DrawSectionDivider(CDC* pDC, const CRect& rc, XTPGridSectionDividerPosition dividerPosition, XTPGridSectionDividerStyle dividerStyle, CXTPPaintManagerColor dividerColor); /** * @brief * Gets the height of the section divider. * @param dividerStyle Section divider style; must be one of the values defined * by the XTPGridFixedRowsDividerStyle enumeration. * @return * The height of the section divider. * @see * XTPGridFixedRowsDividerStyle */ int GetSectionDividerHeight(XTPGridFixedRowsDividerStyle dividerStyle); /** * @brief * Determines if a drop marker will be used when dragging and dropping. * @return * TRUE if a drop marker will be used when dragging and dropping, * FALSE if no markers will be used. */ BOOL IsUseDropMarker() const; // private: /** @cond */ COLORREF MixColor(COLORREF clrLight, COLORREF clrDark, double dFactor); void Line(CDC* pDC, int x, int y, int cx, int cy, CPen* pPen); virtual void DrawTreeStructureLine(CDC* pDC, int x, int y, int cx, int cy, COLORREF clr); virtual void ReplaceInHyperLinks(CXTPGridRecordItem* pItem, CString& rstrText, TCHAR chReplace); /** @endcond */ public: CXTPFont m_xtpFontText; /**< Grid items default text. */ CXTPFont m_xtpFontBoldText; /**< Grid items default bold text. */ CXTPFont m_xtpFontCaption; /**< Column header caption font. */ CXTPFont m_xtpFontPreview; /**< Column header caption font. */ XTP_SUBSTITUTE_GDI_MEMBER_WITH_CACHED(CFont, m_fontText, m_xtpFontText, GetTextFontHandle); XTP_SUBSTITUTE_GDI_MEMBER_WITH_CACHED(CFont, m_fontBoldText, m_xtpFontBoldText, GetBoldTextFontHandle); XTP_SUBSTITUTE_GDI_MEMBER_WITH_CACHED(CFont, m_fontCaption, m_xtpFontCaption, GetCaptionFontHandle); XTP_SUBSTITUTE_GDI_MEMBER_WITH_CACHED(CFont, m_fontPreview, m_xtpFontPreview, GetPreviewFontHandle); CXTPGridHyperlinkStyle* m_pHyperlinkStyle; /**< Style for links. */ CXTPGridHyperlinkStyle* m_pHyperlinkHoverStyle; /**< Style for hovered links. */ CXTPPaintManagerColor m_clrHighlight; /**< Background color of the highlighted row. */ CXTPPaintManagerColor m_clrBoldText; /**< Grid items bold text color. */ CXTPPaintManagerColor m_clrBoldTextHighlight; /**< Grid items bold text highlight color. */ CXTPPaintManagerColor m_clrWindowText; /**< Grid items default text color. */ CXTPPaintManagerColor m_clrHighlightText; /**< Text color of the highlighted text. */ CXTPPaintManagerColor m_clrHeaderControl; /**< Background color of the grid header. */ CXTPPaintManagerColor m_clrCaptionText; /**< Column header text color. */ CXTPPaintManagerColor m_clrCaptionTextPressed; /**< Column header text color when pressed. */ CXTPPaintManagerColor m_clrControlBack; /**< Background color of the control grid area. */ CXTPPaintManagerColor m_clrGroupRowText; /**< Row text color. */ CXTPPaintManagerColor m_clrGroupShadeBack; /**< Group row background color when indentation shade is enabled. */ CXTPPaintManagerColor m_clrGroupShadeText; /**< Group row foreground color when indentation shade is enabled. */ CXTPPaintManagerColor m_clrGroupShadeBorder; /**< Color for group border's shade. */ CXTPPaintManagerColor m_clrGroupBoxBack; /**< Color of group box. */ CXTPPaintManagerColor m_clrControlDark; /**< Dark background color of the Grid control (used on Group By area). */ CXTPPaintManagerColor m_clrControlLightLight; /**< Light background color used for drawing shades (used on column header area). */ CXTPPaintManagerColor m_clrHotDivider; /**< Color of the column hot divider window (two arrows). */ CXTPPaintManagerColor m_clrIndentControl; /**< Color of the tree indentation area. */ CXTPPaintManagerColor m_clrItemShade; /**< Color of the shade on sorted by column items. */ CXTPPaintManagerColor m_clrBtnFace; /**< Standard button face color. */ CXTPPaintManagerColor m_clrBtnText; /**< Standard button text color. */ CXTPPaintManagerColor m_clrPreviewText; /**< Preview text color. */ CXTPPaintManagerColor m_clrSelectedRow; /**< Selected row background color. */ CXTPPaintManagerColor m_clrSelectedRowText; /**< Selected row text color. */ CXTPPaintManagerColor m_clrBtnFacePressed; /**< Standard button face color when pressed. */ CXTPPaintManagerColor m_clrConnector; /**< Header column connector line color. */ CXTPPaintManagerColor m_clrDisableBitmapLightest; /**< The lightest color of bitmap which covers disabled grid. */ CXTPPaintManagerColor m_clrDisableBitmapDarkest; /**< The darkest color of bitmap which covers disabled grid. */ # if XTP_GRID_DEPRECATED() /** * @brief * Gets the style of the header divider line * (i.e. the divider line between the header and body rows). * @return * The style of the header divider line; one of the values defined * by the XTPGridFixedRowsDividerStyle enumeration. * @see * XTPGridFixedRowsDividerStyle */ XTPGridFixedRowsDividerStyle GetHeaderRowsDividerStyle() const; /** * @brief * Sets the style for the header divider line. * (i.e. the divider line between the header and body rows). * @param nStyle Style to be set; must be one of the values defined * by the XTPGridFixedRowsDividerStyle enumeration. * @see * XTPGridFixedRowsDividerStyle */ void SetHeaderRowsDividerStyle(XTPGridFixedRowsDividerStyle style); /** * @brief * Gets the style of the footer divider line. * (i.e. the divider line between the footer and body rows). * @return * The style of the footer divider line; one of the values defined * by the XTPGridFixedRowsDividerStyle enumeration. * @see * XTPGridFixedRowsDividerStyle */ XTPGridFixedRowsDividerStyle GetFooterRowsDividerStyle() const; /** * @brief * Sets the style for the footer divider line. * (i.e. the divider line between the footer and body rows). * @param nStyle Style to be set; must be one of the values defined * by the XTPGridFixedRowsDividerStyle enumeration. * @see * XTPGridFixedRowsDividerStyle */ void SetFooterRowsDividerStyle(XTPGridFixedRowsDividerStyle style); __declspec(property(get = GetHeaderRowsDividerStyle, put = SetHeaderRowsDividerStyle)) XTPGridFixedRowsDividerStyle m_HeaderRowsDividerStyle; /**< Style of a divider line between the header and body rows. */ __declspec(property(get = GetFooterRowsDividerStyle, put = SetFooterRowsDividerStyle)) XTPGridFixedRowsDividerStyle m_FooterRowsDividerStyle; /**< Style of a divider line between the footer and body rows. */ # endif // XTP_GRID_DEPRECATED() # if XTP_GRID_DEPRECATED() CXTPPaintManagerColor GetHeaderRowsDividerColor() const; void SetHeaderRowsDividerColor(CXTPPaintManagerColor clrDivider); CXTPPaintManagerColor GetFooterRowsDividerColor() const; void SetFooterRowsDividerColor(CXTPPaintManagerColor clrDivider); __declspec(property(get = GetHeaderRowsDividerColor, put = SetHeaderRowsDividerColor)) CXTPPaintManagerColor m_clrHeaderRowsDivider; __declspec(property(get = GetFooterRowsDividerColor, put = SetFooterRowsDividerColor)) CXTPPaintManagerColor m_clrFooterRowsDivider; __declspec(property(get = GetGridColor, put = SetGridColor)) COLORREF m_clrGridLine; # endif CXTPPaintManagerColorGradient m_grcGradientColumn; /**< Color of column used with xtpGridColumnOffice2003 style. */ CXTPPaintManagerColorGradient m_grcGradientColumnHot; /**< HotTracking Color of column used with xtpGridColumnOffice2003 style. */ CXTPPaintManagerColorGradient m_grcGradientColumnPushed; /**< Pushed Color of column used with xtpGridColumnOffice2003 style. */ CXTPPaintManagerColor m_clrGradientColumnShadow; /**< Bottom shadow of column used with xtpGridColumnOffice2003 style. */ CXTPPaintManagerColor m_clrGradientColumnSeparator; /**< Separator of column used with xtpGridColumnOffice2003 style. */ CXTPPaintManagerColor m_crlNoGroupByText; /**< A color for "No items" text in GroupBy area (see m_strNoGroupBy member). */ CXTPPaintManagerColor m_clrFreezeColsDivider; /**< Freeze Columns Divider color. */ COLORREF m_clrColumnOffice2007CustomTheme; /**< Base color for Office2007 custom theme. */ COLORREF m_clrFormulaSum; /**< Color for Formula Sum fields. */ COLORREF m_clrFormulaSubSum; /**< Color for Formula SubSum fields. */ COLORREF m_clrAlternativeBackground; /**< Color for Alternative Row Background. */ BOOL m_bUseAlternativeBackground; /**< TRUE to use Alternative Row Background, FALSE otherwise. */ BOOL m_bAllowMergeCells; /**< TRUE to Allow Merge Cells, FALSE otherwise. */ int m_nTextIndentForGroupRowsWithNoIcon; /**< Specifies Text indent if a group row icon is not used. */ int m_nTreeIndent; /**< Tree indentation. */ int m_nTreeStructureStyle; /**< Tree structure style. */ int m_nTreeTextIndentRowParent; /**< Text indent, in pixels, for rows with children. */ int m_nTreeTextIndentRowChildren; /**< Text indent, in pixels, for rows without children. */ int m_nTreeTextIndent; /**< Text indent, in pixels, for rows that are neither parent nor children. */ int m_nTreeTextIndentGroupRow; /**< Text indent, in pixels, for group rows. */ BOOL m_bGroupRowTextBold; /**< TRUE to draw group rows with bold text. */ BOOL m_bShadeGroupHeadings; /**< TRUE to show the indentation shade, FALSE otherwise. */ BOOL m_bShadeSortColumn; /**< TRUE to show the items shade in the sorted by column, FALSE otherwise. */ BOOL m_bHotTracking; /**< TRUE to allow column hot tracking. */ BOOL m_bInvertColumnOnClick; /**< TRUE to invert column on click. */ CString m_strNoItems; /**< A string which contains customized "No Items" text for displaying in view when there are no visible rows. */ CString m_strSortBy; /**< A string which contains customized "Sort By" text for displaying in tooltip. */ CString m_strIncreasing; /**< A string which contains customized "Increasing" text for displaying in tooltip. */ CString m_strDecreasing; /**< A string which contains customized "Decreasing" text for displaying in tooltip. */ CString m_strNoGroupBy; /**< A string which contains customized "No items" text message for displaying in Group By area when there are no items inside it. */ CString m_strNoFieldsAvailable; /**< A string which contains customized "No Fields Available" text message for displaying in Field Chooser. */ CString m_strExpand; /**< A string which contains customized "Expand" text for displaying in tooltip.*/ CString m_strCollapse; /**< A string which contains customized "Collapse" text for displaying in tooltip. */ BOOL m_bHideSelection; /**< TRUE when hiding Grid control's selection by drawing selected items as others, FALSE otherwise. */ BOOL m_bPrintSortTriangle; /**< TRUE to show the sort triangle in printout. */ /** @cond */ __declspec(property(get = GetDrawSortTriangleAlways, put = SetDrawSortTriangleAlways)) BOOL m_bDrawSortTriangleAlways; _XTP_DEPRECATED_IN_FAVOR(m_bPrintSortTriangle) BOOL GetDrawSortTriangleAlways() const; _XTP_DEPRECATED_IN_FAVOR(m_bPrintSortTriangle) void SetDrawSortTriangleAlways(BOOL bValue); /** @endcond */ XTPGridDrawSortTriangleStyle m_DrawSortTriangleStyle; // xtpGridDrawSortTriangleAlways - the sort triangle is displayed in the column header when a // column is sorted and the caption will cut will ellipsis; xtpGridDrawSortTriangleDefault - // the sort triangle will be removed when the column size is too small to display the full // caption and triangle; xtpGridDrawSortTriangleNever - the sort triangle is never used. BOOL m_bUseColumnTextAlignment; // TRUE to draw caption text accordingly to its alignment. BOOL m_bRevertAlignment; /**< TRUE to revert column alignments. */ BOOL m_bUseEditTextAlignment; /**< TRUE to automatically apply edit alignment using column alignment. */ BOOL m_bShowLockIcon; /**< TRUE to show the lock icon, FALSE to hide. */ BOOL m_bUseShellIcon; /**< TRUE to use the shell icon, FALSE otherwise. */ int m_iRecOrRowStart; /**< Start position in numbering (0 or 1 or something user want). */ BOOL m_bRecOrRowNum; /**< TRUE to display record number if support mode is used, FALSE to display row number. */ BOOL m_bMakeUpper; /**< TRUE to display column header and group row text in all caps. */ XTPGridTreeStructureStyle m_treeStructureStyle; /**< Tree structure style. */ CRect m_rcPreviewIndent; /**< Preview indentation. */ int m_nFixedColumnsIndent; /**< Fixed Column total width. */ BOOL m_bMoveScrollbarOnFixedColumnsIndent; /**< Move Scrollbar right follow FixedColumnsIndent. */ BOOL m_bThemedInplaceButtons; /**< Draw in-place buttons using current theme settings. */ BOOL m_bBaseTreeIndent; /**< TRUE to add Extra Tree indentation to cover initial TreeColumn. */ CUIntArray m_arStartCol; /**< Start column in each virtual page. */ int m_PrintPageWidth; /**< Width of print page (run-time) */ BOOL m_bPrintVirtualPageNumber; /**< TRUE to print horizontal page number. */ BOOL m_bPrintPageRectangle; /**< TRUE to draw rectangle around page. */ int m_RecordNumberWidth; /**< Column width for row/record numbers. */ BOOL m_bForceDynamicMarkupForCell; /**< TRUE if use Markup for Grid Record Item. */ BOOL m_bForceShowDropMarker; /**< TRUE if Force Show Drop Marker. used to support external (OLE) drag and drop handler and take care of drop marker line drawing and auto-scrolling. */ BOOL m_bShowNonActiveInPlaceButton; /**< TRUE if use Show Non-Active In-Place Button (Combo, Expand, Spin). */ BOOL m_bPrintWatermark; /**< TRUE to print watermark. */ BOOL m_bUseGroupRowSelectionState; /**< TRUE if use GroupSelectionState Glyph. */ BOOL m_bForceShowTooltip; /**< TRUE if use show tooltip for any cell width case. */ BOOL m_bCleanTooltip; /**< TRUE if use show tooltip without markup. */ BOOL m_bGrayIfDisable; /**< TRUE is disable draw in gray (standard behavior). */ int m_nRowHeightDefault; /**< The default row height. */ BOOL m_bCompactText; /**< TRUE to ignore Icon for Narrow column to show more text. */ BOOL m_bUseDropMarker; /**< FALSE to not draw drop marked when dragging/dropping, TRUE by default. */ BOOL m_bSortTriangleOffsetFromRight; /**< Offset of sort triangle. */ int m_nTreeColumnLineLength; /**< This is the extra line length to apply to tree column lines if there is no expand button. */ int m_nBaseParentRecordIndent; /**< This is initial number of pixels a parent node will be indented when in a group. */ protected: int m_nRowHeight; /**< Grid row default height. */ int m_nHeaderHeight; /**< Column header height. */ int m_nFooterHeight; /**< Column footer height. */ int m_nGroupGridLineHeight; /**< The height of the group grid line. */ CXTPImageManager* m_pGlyphs; /**< An additional image list for the Grid control. */ BOOL m_bIsPreviewMode; /**< TRUE to show the item preview, FALSE to hide. */ int m_nResizingWidth; /**< The width of the column resizing marker area. */ int m_nMaxPreviewLines; /**< Restrict maximum lines for preview text. */ CSize m_szGlyph; /**< Glyph size. */ CXTPBrush m_xtpBrushTreeStructure; /**< Brush to draw tree nodes. */ XTP_SUBSTITUTE_GDI_MEMBER_WITH_CACHED(CBrush, m_brushTreeStructure, m_xtpBrushTreeStructure, GetTreeStructureBrushHandle); CXTPBrush m_xtpBrushGroupGridLineStyle; /**< Brush to draw group row grid lines. */ XTP_SUBSTITUTE_GDI_MEMBER_WITH_CACHED(CBrush, m_brushGroupGridLineStyle, m_xtpBrushGroupGridLineStyle, GetGroupGridLineStyleBrushHandle); int m_nFreezeColsDividerStyle; /**< A set of flags from XTPGridFreezeColsDividerStyle. */ BOOL m_bFixedRowHeight; /**< TRUE if fixed rows used. */ BOOL m_bColumnWidthWYSIWYG; /**< TRUE if columns width WYSIWYG mode used. */ BOOL m_bShowWYSIWYGMarkers; /**< TRUE if in non-print mode header show red page-end markers. */ BOOL m_bLastColumnWidthWYSIWYG; /**< TRUE if last column width WYSIWYG mode used. */ BOOL m_bDrawGridForEmptySpace; /**< TRUE if grid fills the empty space (if any) after the body rows. */ BOOL m_bPrintGroupRowIcon; /**< TRUE if printout draw collapse-expand icon for group row. */ BOOL m_bColumnPlusMinusSign; /**< TRUE if expand/collapse icons are used, FALSE if directional arrows are used. */ BOOL m_bFixedInplaceButtonHeight; /**< TRUE if fixed in-place button height is used. */ XTPGridGridStyle m_nGroupGridLineStyle; /**< Current style for group row grid lines. */ XTPGridColumnStyle m_columnStyle; /**< Column drawing style. */ CXTPGridBorder* m_pBorder; CXTPWinThemeWrapper* m_themeHeader; /**< Header theme wrapper. */ CXTPWinThemeWrapper* m_themeButton; /**< In-place button theme wrapper. */ CXTPWinThemeWrapper* m_themeCombo; /**< Combo box in-place button theme wrapper. */ CXTPWinThemeWrapper* m_themeSpin; /**< Spin in-place button theme wrapper. */ # ifdef _XTP_INCLUDE_CONTROLS void SetControlsTheme(int eTheme); /**< XTPControlTheme. */ CXTPComboBox* m_pCombo; BOOL m_bUseThemedControls; # else CXTPExcludedMemberPadding