/** * @file XTPCommandBarsVisualStudio2008Theme.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(__XTPCOMMANDBARSVISUALSTUDIO2008THEME_H__) # define __XTPCOMMANDBARSVISUALSTUDIO2008THEME_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * The CXTPVisualStudio2008Theme class is used to enable a * Visual Studio 2008 style theme for Command Bars. * @see * CXTPPaintManager::SetTheme */ class _XTP_EXT_CLASS CXTPVisualStudio2008Theme : public CXTPVisualStudio2005Theme { public: /** * @brief * Constructs a CXTPVisualStudio2008Theme object. */ CXTPVisualStudio2008Theme(); /** * @brief * Destroys a CXTPVisualStudio2008Theme object, handles cleanup and deallocation. */ virtual ~CXTPVisualStudio2008Theme(); /** * @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 the CXTPCommandBar object whose borders must be retrieved. * @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); public: /** * @brief * Draws pixel in specific position with specify Alpha. * @param pDC Pointer to a valid device context. * @param xPos Position to draw. * @param yPos Position to draw. * @param clr Color of pixel to draw. * @param nAlpha Opacity of pixel. * @return */ static void AFX_CDECL AlphaPixel(CDC* pDC, int xPos, int yPos, COLORREF clr, int nAlpha); /** * @brief * Draws a border around a specified rectangle. * @param pDC Pointer to a valid device context. * @param rc Rectangle with the border to be drawn. * @param clrBorder Color of the border to be drawn. * @return */ static void AFX_CDECL AlphaBorder(CDC* pDC, CRect rc, COLORREF clrBorder); public: /** * @brief * Retrieves the base theme of the manager. * @return * The base theme of the manager. */ virtual XTPPaintTheme BaseTheme() { return xtpThemeVisualStudio2008; } public: CXTPPaintManagerColorGradient m_clrMenuSelection; /**< Gradient used to draw the current menu selection. */ CXTPPaintManagerColor m_clrMenuSelectionBorder; /**< Color used to draw the border of the current menu selection. */ CXTPPaintManagerColor m_clrMenuSelectionText; /**< Color used to draw the text of the current menu selection. */ }; /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(__XTPCOMMANDBARSVISUALSTUDIO2008THEME_H__) /** @endcond */