/** * @file XTPScrollBarThemeOffice2013.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(__XTPSCROLLBARTHEMEOFFICE2013_H__) # define __XTPSCROLLBARTHEMEOFFICE2013_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * Used by paint manager to retrieve color settings from the loaded * resource INI file. */ struct XTP_SCROLLBARINICOLORS { COLORREF clrBack; /**< Scrollbar background color. */ COLORREF clrScrollBack; /**< Scrollbar button background color. */ COLORREF clrScrollArrow; /**< Scrollbar button arrow color. */ COLORREF clrScrollBorder; /**< Scrollbar button border color. */ COLORREF clrThumbBack; /**< Scrollbar thumb background color. */ COLORREF clrThumbBorder; /**< Scrollbar thumb border color. */ }; /** * @brief * Used by paint manager to retrieve the current state color settings * when drawing scrollbars. */ struct XTP_SCROLLBARDRAWCOLORS : public XTP_SCROLLBARINICOLORS { COLORREF clrScrollDownBack; /**< Scrollbar down / right button background color. */ COLORREF clrScrollDownArrow; /**< Scrollbar down / right button arrow color. */ COLORREF clrScrollDownBorder; /**< Scrollbar down / right button border color. */ }; /** * @brief * The CXTPScrollBarThemeOffice2013 class is used to enable a Gallery Office 2013 style theme * for Command Bars. * @see CXTPPaintManager::SetTheme */ class _XTP_EXT_CLASS CXTPScrollBarThemeOffice2013 : public CXTPScrollBarPaintManager { public: /** * @brief * Constructs a CXTPScrollBarThemeOffice2013 object. */ CXTPScrollBarThemeOffice2013(); /** * @brief * Destructor, handles any cleanup / deallocation necessary. */ virtual ~CXTPScrollBarThemeOffice2013(); /** * @brief * Used by the paint manager to retreive state colors used when * drawing the scrollbar. * @param sbc Reference to a XTP_SCROLLBARDRAWCOLORS that recives state color values. * @param nHitSelected Contains selected hit test index value, see remarks for more details. * @param nHitPressed Contains pressed hit test index value, see remarks for more details. * @param bEnabled TRUE if the scrollbar is enabled, otherwise FALSE. * @details * The nHitSelected and nHitPressed values contain an index id which identifies * the scroll button and thumb track state. Possible values are XTP_HTSCROLLUP, * XTP_HTSCROLLLEFT, XTP_HTSCROLLDOWN, XTP_HTSCROLLRIGHT and XTP_HTSCROLLTHUMB. So * for example if nHitPressed equals XTP_HTSCROLLDOWN, that would indicate the * down scroll arrow has been pressed. * @see * XTP_SCROLLBARDRAWCOLORS */ virtual void GetScrollBarColors(XTP_SCROLLBARDRAWCOLORS& sbc, int nHitSelected, int nHitPressed, BOOL bEnabled); protected: /** * @brief * This method is called to draw all scrollbar parts. * @param pDC Pointer to device context * @param pGallery ScrollBar to draw */ virtual void DrawScrollBar(CDC* pDC, CXTPScrollBase* pGallery); /** * @brief * Recalculates scrollbar metrics */ virtual void RefreshMetrics(); /** * @brief * Draws verical scrollbar background only. * @param pDC Target device context pointer * @param pScroll Scroll bar object pointer * @param pMetrics Precomputed scrollbar metrics */ virtual void DrawBackground(CDC* pDC, CXTPScrollBase* pScroll, XTPScrollMetricsV* pMetrics); /** * @brief * Draws vertical scrollbar buttons only. * @param pDC Target device context pointer * @param pScroll Scroll bar object pointer * @param pMetrics Precomputed scrollbar metrics */ virtual void DrawButtons(CDC* pDC, CXTPScrollBase* pScroll, XTPScrollMetricsV* pMetrics); /** * @brief * Draws vertical scrollbar button arrows only. * @param pDC Target device context pointer * @param pScroll Scroll bar object pointer * @param pMetrics Precomputed scrollbar metrics */ virtual void DrawArrows(CDC* pDC, CXTPScrollBase* pScroll, XTPScrollMetricsV* pMetrics); /** * @brief * Draws vertical scrollbar thumb button only. * @param pDC Target device context pointer * @param pScroll Scroll bar object pointer * @param pMetrics Precomputed scrollbar metrics */ virtual void DrawThumbButton(CDC* pDC, CXTPScrollBase* pScroll, XTPScrollMetricsV* pMetrics); /** * @brief * Draws horizontal scrollbar background only. * @param pDC Target device context pointer * @param pScroll Scroll bar object pointer * @param pMetrics Precomputed scrollbar metrics */ virtual void DrawBackground(CDC* pDC, CXTPScrollBase* pScroll, XTPScrollMetricsH* pMetrics); /** * @brief * Draws horizontal scrollbar buttons only. * @param pDC Target device context pointer * @param pScroll Scroll bar object pointer * @param pMetrics Precomputed scrollbar metrics */ virtual void DrawButtons(CDC* pDC, CXTPScrollBase* pScroll, XTPScrollMetricsH* pMetrics); /** * @brief * Draws horizontal scrollbar button arrows only. * @param pDC Target device context pointer * @param pScroll Scroll bar object pointer * @param pMetrics Precomputed scrollbar metrics */ virtual void DrawArrows(CDC* pDC, CXTPScrollBase* pScroll, XTPScrollMetricsH* pMetrics); /** * @brief * Draws horizontal scrollbar thumb button only. * @param pDC Target device context pointer * @param pScroll Scroll bar object pointer * @param pMetrics Precomputed scrollbar metrics */ virtual void DrawThumbButton(CDC* pDC, CXTPScrollBase* pScroll, XTPScrollMetricsH* pMetrics); /** * @brief * Draws scrollbar gripper only. * @param pDC Target device context pointer * @param pScroll Scroll bar object pointer */ virtual void DrawGripper(CDC* pDC, CXTPScrollBase* pScroll); XTP_SCROLLBARINICOLORS m_clrNormal; /**< Holds scrollbar default state colors. */ XTP_SCROLLBARINICOLORS m_clrPressed; /**< Holds scrollbar pressed state colors. */ XTP_SCROLLBARINICOLORS m_clrSelected; /**< Holds scrollbar selected state colors. */ XTP_SCROLLBARINICOLORS m_clrDisabled; /**< Holds scrollbar disabled state colors. */ XTP_SCROLLBARDRAWCOLORS m_clrCurrent; /**< Holds currently selected scrollbar colors. */ }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPSCROLLBARTHEMEOFFICE2013_H__) /** @endcond */