/** * @file XTPCommandBarsVisualStudio2010Theme.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(__XTPCOMMANDBARSVISUALSTUDIO2010THEME_H__) # define __XTPCOMMANDBARSVISUALSTUDIO2010THEME_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * The CXTPVisualStudio2010Theme class is used to enable a * Visual Studio 2010 style theme for Command Bars. * @see * CXTPPaintManager::SetTheme */ class _XTP_EXT_CLASS CXTPVisualStudio2010Theme : public CXTPCommandBarsOffice2003Theme { public: /** * @brief * Constructs a CXTPVisualStudio2008Theme object. */ CXTPVisualStudio2010Theme(); /** * @brief * Destroys a CXTPVisualStudio2008Theme object, handles cleanup and deallocation. */ virtual ~CXTPVisualStudio2010Theme(); /** * @brief * This method is called to refresh the visual metrics of the manager. */ void RefreshMetrics(); public: /** * @brief * This method is called to retrieve the command bar's borders. * @param pBar Pointer to a CXTPCommandBar object that the borders need to get. * @return * Borders of the command bar. */ virtual CRect GetCommandBarBorders(CXTPCommandBar* pBar); /** * @brief * This method is called to draw a pop-up bar's right gripper. * @param pDC Pointer to a valid device context. * @param xPos Specifies the logical x coordinate of the upper-left corner of the * rectangle. * @param yPos Specifies the logical y coordinate of the upper-left corner of * the destination rectangle. * @param cx Specifies the width of the rectangle. * @param cy Specifies the height of the rectangle. * @param bExpanded TRUE if expanded. */ virtual void DrawPopupBarGripper(CDC* pDC, int xPos, int yPos, int cx, int cy, BOOL bExpanded); /** * @brief * This method is called to fill the control's face. * @param pDC Pointer to a valid device context. * @param rc Rectangle to draw. * @param bSelected TRUE if the control is selected. * @param bPressed TRUE if the control is pushed. * @param bEnabled TRUE if the control is enabled. * @param bChecked TRUE if the control is checked. * @param bPopuped TRUE if the control is pop-up'ed. * @param barType Parent's bar type. * @param barPosition Parent's bar position. */ virtual void DrawRectangle(CDC* pDC, CRect rc, BOOL bSelected, BOOL bPressed, BOOL bEnabled, BOOL bChecked, BOOL bPopuped, XTPBarType barType, XTPBarPosition barPosition); /** * @brief * This method is called to fill the control's face. * @param pDC Pointer to a valid device context. * @param rc Rectangle to draw. * @param bSelected TRUE if the control is selected. * @param bPressed TRUE if the control is pushed. * @param bEnabled TRUE if the control is enabled. * @param bChecked TRUE if the control is checked. * @param bPopuped TRUE if the control is pop-up'ed. * @param barType Parent's bar type. * @param barPosition Parent's bar position. * @param nID Bar's control ID. */ virtual void DrawRectangle(CDC* pDC, CRect rc, BOOL bSelected, BOOL bPressed, BOOL bEnabled, BOOL bChecked, BOOL bPopuped, XTPBarType barType, XTPBarPosition barPosition, int nID); /** * @brief * This method is called to fill the control's face. * @param pDC Pointer to a valid device context. * @param pButton pointer to a button * @return * TRUE if the rectange was drawn, otherwise FALSE. */ virtual BOOL DrawRectangle(CDC* pDC, CXTPControl* pButton); /** * @brief * This method retrieves a button's text color. * @param bSelected TRUE if the control is selected. * @param bPressed TRUE if the control is pushed. * @param bEnabled TRUE if the control is enabled. * @param bChecked TRUE if the control is checked. * @param bPopuped TRUE if the control is pop-up'ed. * @param barType Parent's bar type. * @param barPosition Parent's bar position. * @return * Button's text color. */ virtual COLORREF GetRectangleTextColor(BOOL bSelected, BOOL bPressed, BOOL bEnabled, BOOL bChecked, BOOL bPopuped, XTPBarType barType, XTPBarPosition barPosition); /** * @brief * This method is called to determine the offset of a pop-up bar. * @param rc Control's bounding rectangle. * @param pControl Pointer to a CXTPControl object. * @param bVertical TRUE if the control is docked vertically. */ virtual void AdjustExcludeRect(CRect& rc, CXTPControl* pControl, BOOL bVertical); /** * @brief * This method is called to draw a command bar's separator. * @param pDC Pointer to a valid device context. * @param pBar Pointer to a CXTPCommandBar object. * @param pControl Pointer to a CXTPControl object. * @param bDraw TRUE to draw; FALSE to retrieve the size of the separator. * @return * Size of the separator. */ virtual CSize DrawCommandBarSeparator(CDC* pDC, CXTPCommandBar* pBar, CXTPControl* pControl, BOOL bDraw); virtual void FillCommandBarEntry(CDC* pDC, CXTPCommandBar* pBar); protected: public: /** * @brief * Retrieves the base theme of the manager. * @return * The base theme of the manager. */ virtual XTPPaintTheme BaseTheme() { return xtpThemeVisualStudio2010; } public: CXTPPaintManagerColor m_clrMenuSeparator; }; /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(__XTPCOMMANDBARSVISUALSTUDIO2010THEME_H__) /** @endcond */