/** * @file XTPGridThemeOffice2013.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(__XTPGridThemeOffice2013_H__) # define __XTPGridThemeOffice2013_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * CXTPGridThemeOffice2013 is a CXTPGridPaintManager derived * class that represents an Office 2013 style theme. */ class _XTP_EXT_CLASS CXTPGridThemeOffice2013 : public CXTPGridPaintManager { public: /** * @brief * Default paint manager constructor, handles properties initialization. */ CXTPGridThemeOffice2013(); /** * @brief * Loads the default images used by the Grid control. */ virtual void LoadGlyphs(); /** * @brief * This method is called to refresh the visual metrics of the * Grid control. */ virtual void RefreshMetrics(); /** * @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 * 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*/); /** * @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); /** * @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); virtual void DrawColumnInverted(CDC* pDC, CRect rcColumn, BOOL bColumnPressed, BOOL bDraggingFromHeader, int nShadowWidth); virtual void DrawWindowFrame(CDC* pDC, CRect rcWindow); /** * @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); 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 a 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 * 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 * 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); using CXTPGridPaintManager::GetRowHeight; virtual CRect GetGroupRowBmpSize(CRect rcRow, int nBitmapOffset); virtual CRect GetGroupRowTextSize(CRect rcBitmap, CRect rcRow, int nBitmapWidth, int nNoIconWidth, int nTextOffset); CXTPPaintManagerColor m_clrGroupText; CXTPPaintManagerColor m_clrGroupTextHilite; CXTPPaintManagerColor m_clrGroupBack; CXTPPaintManagerColor m_clrGroupBackHilite; CXTPPaintManagerColor m_clrGlyph; /**< Header glyph color. */ CXTPPaintManagerColor m_clrGlyphHighlight; /**< Header highlighted glyph color. */ CXTPPaintManagerColor m_clrGlyphExpand; /**< Expand glyph color. */ CXTPPaintManagerColor m_clrGlyphBorder; /**< Expand glyph border color. */ CXTPPaintManagerColor m_clrGlyphContract; /**< Contract glyph color. */ }; /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPGridThemeOffice2013_H__) /** @endcond */