/** * @file XTPCommandBarsVisualStudio2012Theme.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(__XTPCOMMANDBARSVISUALSTUDIO2012THEME_H__) # define __XTPCOMMANDBARSVISUALSTUDIO2012THEME_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPCommandBarsColorSet; /** * @brief * The CXTPCommandBarsVisualStudio2012Theme class is used to enable a * Visual Studio 2012 theme for Command Bars. * @see * CXTPPaintManager::SetTheme */ class _XTP_EXT_CLASS CXTPCommandBarsVisualStudio2012Theme : public CXTPCommandBarsModernUITheme { /** @cond */ DECLARE_DYNAMIC(CXTPCommandBarsVisualStudio2012Theme) /** @endcond */ public: /** * @brief * Constructs a CXTPCommandBarsVisualStudio2012Theme object. * @param paintTheme Theme to be set. */ explicit CXTPCommandBarsVisualStudio2012Theme( XTPPaintTheme paintTheme = xtpThemeVisualStudio2012Light); /** * @brief * Destroys a CXTPCommandBarsVisualStudio2012Theme object, * handles cleanup and deallocation. */ virtual ~CXTPCommandBarsVisualStudio2012Theme(); public: /** * @brief * This method is called to refresh the visual metrics of the manager. */ virtual void RefreshMetrics(); public: /** * @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 returns the edit control back color to draw. * @param pControl Pointer to a CXTPControl object to get the back color from. * @return * Edit control back color. */ virtual COLORREF GetControlEditBackColor(CXTPControl* pControl); virtual CSize DrawControlComboBox(CDC* pDC, CXTPControlComboBox* pControlCombo, BOOL bDraw); /** * @brief * This method is called to fill a dock bar. * @param pDC Pointer to a valid device context. * @param pBar Pointer to a CXTPDockBar object. */ virtual void FillDockBar(CDC* pDC, CXTPDockBar* pBar); /** * @brief * This method is called to fill the command bar's face. * @param pDC Pointer to a valid device context. * @param pBar Pointer to a CXTPCommandBar object to draw. */ virtual void FillCommandBarEntry(CDC* pDC, CXTPCommandBar* pBar); /** * @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 returns FALSE. */ virtual BOOL DrawRectangle(CDC* pDC, CXTPControl* pButton); /** * @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 * Draw expand or hidden glyphs for a button. * @param pDC Output device context pointer. * @param pButton Target button pointer. * @param pt0 Expand glyph triangle coordinates. * @param pt1 Expand glyph triangle coordinates. * @param pt2 Expand glyph triangle coordinates. * @param clr Glyph color. */ virtual void DrawExpandGlyph(CDC* pDC, CXTPControl* pButton, CPoint pt0, CPoint pt1, CPoint pt2, COLORREF clr); /** * @brief * Draw expand or hidden glyphs for a button. * @param pButton Target button pointer. * @param pDC Output device context pointer. * @param clr Glyph color. * @param bVertical TRUE if vertically positioned glyph is to be drawn. */ virtual void DrawExpandGlyph(CDC* pDC, CXTPControl* pButton, COLORREF clr, BOOL bVertical); /** * @brief * Draw expand or hidden glyphs for a button. * @param pDC Output device context pointer. * @param pButton Target button pointer. * @param clr Glyph color. * @param bVertical TRUE if vertically positioned glyph is to be drawn. */ virtual void DrawHiddenGlyph(CDC* pDC, CXTPControl* pButton, COLORREF clr, BOOL bVertical); /** * @brief * This member function is called to draw a split button expand symbol. * @param pDC Pointer to a valid device context. * @param pControl Pointer to a CXTPControl object. * @param pt Position of expand symbol. * @param bSelected TRUE if the control is selected. * @param bPopuped TRUE if the control is pop-up'ed. * @param bEnabled TRUE if the control is enabled. * @param bVert TRUE if control is vertical. */ virtual void DrawDropDownGlyph(CDC* pDC, CXTPControl* pControl, CPoint pt, BOOL bSelected, BOOL bPopuped, BOOL bEnabled, BOOL bVert); /** * @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 = TRUE); virtual void DrawCheckMark(CDC* pDC, CRect rcCheck, BOOL bIsRadio, BOOL bEnabled, BOOL bSelected); virtual COLORREF GetGlyphColor(CXTPControl* pControl); /** * @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 * Retrieves the base theme of the manager. * @return * The base theme of the manager. */ virtual XTPPaintTheme BaseTheme() { return xtpThemeVisualStudio2012; } protected: /** * @brief * This method is called to draw a check box mark area. * @param pDC Pointer to a valid device context. * @param rc Bounding rectangle. * @param bDraw TRUE to draw; FALSE to find size. * @param bSelected TRUE if control is selected. * @param bPressed TRUE if control is pressed. * @param bChecked TRUE if control is checked. * @param bEnabled TRUE if control is enabled. * @return * Size of check box mark. */ virtual CSize DrawControlCheckBoxMark(CDC* pDC, CRect rc, BOOL bDraw, BOOL bSelected, BOOL bPressed, BOOL bChecked, BOOL bEnabled); using CXTPCommandBarsModernUITheme::DrawControlCheckBoxMark; virtual void DrawDashedLine(CDC* pDC, int x, int y1, int y2, COLORREF clr); virtual BOOL RequiresResourceImages(); virtual void DrawControlPopupGlyph(CDC* pDC, CXTPControl* pButton); static void AFX_CDECL FillRect(CDC* pDC, CRect rc, BOOL bCheckMark, COLORREF clrFore, COLORREF clrBack); CXTPCommandBarsColorSet* m_pColorSet; }; AFX_INLINE BOOL CXTPCommandBarsVisualStudio2012Theme::RequiresResourceImages() { return TRUE; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(__XTPCOMMANDBARSVISUALSTUDIO2012THEME_H__) /** @endcond */