/** * @file XTPCommandBarsVisualStudio2017Theme.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(__XTPCOMMANDBARSVISUALSTUDIO2017THEME_H__) # define __XTPCOMMANDBARSVISUALSTUDIO2017THEME_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * The CXTPCommandBarsVisualStudio2017Theme class is used to enable a * Visual Studio 2017 style theme for Command Bars. * @see * CXTPPaintManager::SetTheme */ class _XTP_EXT_CLASS CXTPCommandBarsVisualStudio2017Theme : public CXTPCommandBarsOffice2013Theme { /** @cond */ DECLARE_DYNAMIC(CXTPCommandBarsVisualStudio2017Theme) /** @endcond */ public: /** * @brief * Constructs a CXTPCommandBarsVisualStudio2017Theme object. */ CXTPCommandBarsVisualStudio2017Theme(); /** * @brief * Destroys a CXTPCommandBarsVisualStudio2017Theme object, * handles cleanup and deallocation. */ virtual ~CXTPCommandBarsVisualStudio2017Theme(); /** * @brief * Call this member function to set the application state color for the * frame border and status bar. * @param clrState COLORREF value representing the application state color. Use * COLORREF_NULL to reset back to default color. */ virtual void SetStateColor(COLORREF clrState = COLORREF_NULL); /** * @brief * Call this member function to get the application state color for the * frame border and status bar. * @return * COLORREF value representing the application state color. */ virtual COLORREF GetStateColor() const; protected: /** * @brief * This method is called to draw the frame for the SplitButton * control. * @param pDC Pointer to a valid device context. * @param pButton Pointer to a CXTPControl object. * @param rc Bounding rectangle to draw. */ virtual void DrawSplitButtonFrame(CDC* pDC, CXTPControl* pButton, CRect rc); /** * @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 returns the control text color to draw. * @param pButton Points to a CXTPControl object to draw. * @return Returns control text color */ virtual COLORREF GetControlTextColor(CXTPControl* pButton); /** * @brief * This method is called to draw the background for a gallery menu item. * @param pDC Pointer to a valid device context. * @param rcItem Reference to item area rectangle coordinates. * @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 barType Parent's bar type. */ virtual void DrawGalleryItemBack(CDC* pDC, CRect rcItem, BOOL bEnabled, BOOL bSelected, BOOL bPressed, BOOL bChecked, XTPBarType barType); /** * @brief * Helper class called by DrawRectangle to render a checkmark * background and border. * @param pDC Pointer to a valid device context. * @param rc Rectangle to draw. * @param clrFore RGB color value used to draw border. * @param clrBack RGB color value used to draw background. */ virtual void DrawCheckRect(CDC* pDC, CRect rc, COLORREF clrFore, COLORREF clrBack); /** * @brief * This method is called to draw the command bar's gripper. * @param pDC Pointer to a valid device context. * @param pBar Pointer to a CXTPCommandBar object. * @param bDraw TRUE to draw; FALSE to retrieve the size of the gripper. * @return * Size of the gripper. */ virtual CSize DrawCommandBarGripper(CDC* pDC, CXTPCommandBar* pBar, BOOL bDraw = TRUE); /** * @brief * This method is called to draw the control. * @param pDC Pointer to a valid device context. * @param bDraw TRUE to draw; FALSE to retrieve the size of the control. * @param pComboBox A pointer to a CXTPControlComboBox object to draw. * @return * Size of the control. */ virtual CSize DrawControlComboBox(CDC* pDC, CXTPControlComboBox* pComboBox, BOOL bDraw); }; /** * @brief * Call XTPSetVS2017StateColor to set the border and status bar colors for this * theme to indicate state changes. This is similar to when Visual Studio 2017 * opens a document or runs the debugger causing both the border and status * bar colors to be updated. * Unlike CXTPApplication::SetAmbientProperty, this function * sets state color only for the specified command bars object and does * not change the value of xtpApplicationStateColor. * @param pCommandBars Pointer to a valid CXTPCommandBars object. * @param clrState RGB state color value to set. Use default COLORREF_NULL * to reset colors to their default state. * @return * TRUE if the colors were successfully updated, otherwise FALSE. * @see * CXTPApplication::SetAmbientProperty, CXTPApplication::GetAmbientProperty */ _XTP_EXT_CLASS BOOL AFX_CDECL XTPSetVS2017StateColor(CXTPCommandBars* pCommandBars, COLORREF clrState = COLORREF_NULL); /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(__XTPCOMMANDBARSVISUALSTUDIO2017THEME_H__) /** @endcond */