/** * @file XTPRibbonThemeResource.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(__XTPRIBBONTHEMERESOURCE_H__) # define __XTPRIBBONTHEMERESOURCE_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * CXTPRibbonThemeResource is a CXTPRibbonPaintManager derived class * used to represent a Resource .DLL ribbon theme. */ class _XTP_EXT_CLASS CXTPRibbonThemeResource : public CXTPRibbonPaintManager { public: /** * @brief * Constructs a CXTPRibbonThemeResource object. * @param pPaintManager A CXTPPaintManager object. */ CXTPRibbonThemeResource(CXTPPaintManager* pPaintManager); /** * @brief * Destroys a CXTPRibbonThemeResource object, handles cleanup and deallocation. */ virtual ~CXTPRibbonThemeResource(); /** * @brief * This method is called to refresh the visual metrics of the manager. * @details * Refreshes all of the colors in the ribbon bar. Many of the colors * used are set with the GROUP_COLOR structure. * @see * GROUP_COLOR */ virtual void RefreshMetrics(); public: // Drawing interface /** * @brief * Draws the specified CXTPRibbonGroup. * @param pDC Pointer to a valid device context. * @param pGroup Pointer to the CXTPRibbonGroup to be drawn. * @details * Draws the entire group including background, caption, and text. * This will not draw the option button or the group pop-up. * @see * GROUP_COLOR, FillRibbonBar, FillGroupRect, RefreshMetrics */ virtual void DrawGroup(CDC* pDC, CXTPRibbonGroup* pGroup); /** * @brief * This method is called to fill the background of a CXTPRibbonGroup. * @param pDC Pointer to a valid device context. * @param pActiveTab Pointer to the tab that is currently active. * @param rcGroups Bounding rectangle of the group. * @details * Performs a gradient fill using the GROUP_COLOR::clrBackground for * the main group background and GROUP_COLOR::clrCaption to fill the * group caption rectangle. * @see * CXTPRibbonGroup::GetRect, GROUP_COLOR */ virtual void FillGroupRect(CDC* pDC, CXTPRibbonTab* pActiveTab, CRect rcGroups); /** * @brief * Draws the group pop-up button. * @param pDC Pointer to a valid device context * @param pControlGroupPopup Pointer to a CXTPControlPopup object. * @param bDraw TRUE to draw the group pop-up button, * FALSE to retrieve the size of the control. * @details * A single group button will be displayed if there is not enough room * to display the items in the group. A group pop-up is displayed * when the button is clicked. The pop-up contains all the items in * the group. When a group button is clicked, a CXTPControlPopup * is displayed that contains the items of the group. * @return * If bDraw is FALSE, then the size of the group pop-up button control * will be returned. * @see * CXTPRibbonGroup::GetControlGroupPopup */ virtual CSize DrawControlGroupPopup(CDC* pDC, CXTPControlPopup* pControlGroupPopup, BOOL bDraw); /** * @brief * This method is called to draw the pop-up toolbar of a reduced group. * @param pDC Pointer to a valid device context. * @param pGroup Parent group of pop-up'ed toolbar. * @param pCommandBar Pop-up toolbar to draw. */ virtual void FillGroupPopupToolBar(CDC* pDC, CXTPRibbonGroup* pGroup, CXTPCommandBar* pCommandBar); /** * @brief * This method is called to fill the background of a ribbon bar control. * @param pDC Pointer to a valid device context * @param pRibbonBar Pointer to the parent ribbon bar. */ virtual void FillRibbonBar(CDC* pDC, CXTPRibbonBar* pRibbonBar); /** * @brief * Draws the group option button. * @param pDC Pointer to a valid device context. * @param pControlGroupOption Pointer to a CXTPControl object. * @param bDraw TRUE to draw option button, * FALSE to retrieve the size of the control. * @details * The option button is typically used to launch a dialog associated with the group. * It is drawn on the right side of the group caption. * @return * If bDraw is FALSE, then the size of the option button control * will be returned. * @see * CXTPRibbonGroup::ShowOptionButton, CXTPRibbonGroup::GetControlGroupOption */ virtual CSize DrawControlGroupOption(CDC* pDC, CXTPControl* pControlGroupOption, BOOL bDraw); /** * @brief * This method is called to draw ribbon context headers. * @param pDC Pointer to a valid device context. * @param pContextHeaders Collection of context headers. * @param pRibbonBar Pointer to the parent ribbon bar. */ virtual void DrawRibbonFrameContextHeaders(CDC* pDC, CXTPRibbonBar* pRibbonBar, CXTPRibbonTabContextHeaders* pContextHeaders); /** * @brief * This member fills in the tab header and tab client area. It * will then draw tab client frame. * @param pRibbonBar Pointer to the ribbon bar to draw the tab control for. * @param pDC Pointer to a valid device context. * @param rcControl Bounding rectangle of the tab control. */ virtual void FillRibbonTabControl(CDC* pDC, CXTPRibbonBar* pRibbonBar, CRect rcControl); /** * @brief * This method is called to draw a single tab of the ribbon bar. * @param pDC Pointer to a valid device context. * @param pItem Ribbon tab to draw. */ virtual void DrawRibbonTab(CDC* pDC, CXTPRibbonTab* pItem); /** * @brief * This method is called to draw the ribbon caption if EnableFrameTheme * was not called. * @param pDC Pointer to a valid device context. * @param pRibbonBar Pointer to the ribbon bar to draw the caption for. * @param bActive TRUE if the ribbon frame is active. */ virtual void DrawRibbonFrameCaptionBar(CDC* pDC, CXTPRibbonBar* pRibbonBar, BOOL bActive); /** * @brief * This method is called to draw the Ribbon caption. * @param pDC Pointer to a valid device context. * @param pRibbonBar Pointer to the ribbon bar to draw the caption for. * @param bActive TRUE if the ribbon frame is active. */ virtual void DrawRibbonFrameCaption(CDC* pDC, CXTPRibbonBar* pRibbonBar, BOOL bActive); /** * @brief * This method is called to draw ribbon Quick Access controls. * @param pDC Pointer to a valid device context. * @param pRibbonBar Pointer to the parent ribbon bar. */ virtual void DrawRibbonQuickAccessControls(CDC* pDC, CXTPRibbonBar* pRibbonBar); /** * @brief * This method is called to draw the Quick Access customize button. * @param pDC Pointer to a valid device context. * @param pControl Pointer to the Quick Access customize button. * @see * DrawRibbonQuickAccessMoreButton */ virtual void DrawRibbonQuickAccessButton(CDC* pDC, CXTPControlPopup* pControl); /** * @brief * This method is called to draw the Quick Access more button. * @param pDC Pointer to a valid device context. * @param pControl Pointer to the Quick Access more button. * @see * DrawRibbonQuickAccessButton */ virtual void DrawRibbonQuickAccessMoreButton(CDC* pDC, CXTPControlPopup* pControl); /** * @brief * Draws the top-left system button. * @param pDC Pointer to a valid device context. * @param pControl System button control. * @param rc Bounding rectangle of the control. */ virtual void DrawRibbonFrameSystemButton(CDC* pDC, CXTPRibbonControlSystemButton* pControl, CRect rc); /** * @brief * This method is called to draw scroll group buttons. * @param pDC Pointer to a valid device context. * @param pControl Scroll button to draw. * @param bScrollLeft TRUE to draw the left button, FALSE to draw the right. */ virtual void DrawRibbonScrollButton(CDC* pDC, CXTPControl* pControl, BOOL bScrollLeft); /** * @brief * This method is called to draw the pop-up bar of the more button. * @param pDC Pointer to a valid device context. * @param pBar Toolbar to fill. */ virtual void FillMorePopupToolBarEntry(CDC* pDC, CXTPCommandBar* pBar); /** * @brief * This method is called to draw the pop-up bar of the system button. * @param pDC Pointer to a valid device context. * @param pBar Toolbar to fill. */ virtual void FillSystemPopupBarEntry(CDC* pDC, CXTPPopupBar* pBar); /** * @brief * This method is called to draw a pop-up bar button. * @param pDC Pointer to a valid device context. * @param pButton Pop-up bar button to draw. */ virtual void DrawSystemPopupBarButton(CDC* pDC, CXTPControl* pButton); /** * @brief * This method is called to draw the ribbon group when the group is * minimized and only a button is displayed. When the button is * pressed, the group is displayed as a pop-up. * @param pDC Pointer to a valid device context. * @param pButton Button to draw. * @return TRUE if successful, FALSE otherwise. */ virtual BOOL DrawRibbonGroupControlEntry(CDC* pDC, CXTPControl* pButton); public: /** * @brief * Calculates the ribbon caption height. * @param pRibbonBar Pointer to the parent ribbon bar. * @return * The ribbon caption height. */ virtual int GetRibbonCaptionHeight(const CXTPRibbonBar* pRibbonBar) const; /** * @brief * Calculates the ribbon group option size. * @return * The ribbon group option size. */ virtual CSize GetControlGroupOptionSize() const; protected: int m_nFileButtonImageCount; }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif // !defined(__XTPRIBBONTHEMERESOURCE_H__) /** @endcond */