/** * @file XTPCommandBarsOffice2013Theme.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(__XTPCOMMANDBARSOFFICE2013THEME_H__) # define __XTPCOMMANDBARSOFFICE2013THEME_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * Defines a back image. */ enum XTPBackImage { XTPNone, /**< Specifies no back image */ XTPCalligraphy, /**< Specifies caligraphy back image */ XTPCirclesAndStripes, /**< Specifies circle and stipes back image */ XTPCircuit, /**< Specifies circuit back image */ XTPClouds, /**< Specifies cluds back image */ XTPDoodleCircles, /**< Specifies doodle circles back image */ XTPDoodleDiamonds, /**< Specifies doodle diamonds back image */ XTPGeometry, /**< Specifies geometry back image */ XTPLunchBox, /**< Specifies lunch box back image */ XTPSchoolSupplies, /**< Specifies school supplies back image */ XTPSpring, /**< Specifies sptring back image */ XTPStars, /**< Specifies stars back image */ XTPStraws, /**< Specifies straws back image */ XTPTreeRings, /**< Specifies tree rings back image */ XTPUnderWater, /**< Specifies underwater back image */ }; /** * @brief * The CXTPCommandBarsOffice2013Theme class is used to enable an * Office 2013 style theme for Command Bars. * @see * CXTPPaintManager::SetTheme */ class _XTP_EXT_CLASS CXTPCommandBarsOffice2013Theme : public CXTPCommandBarsModernUITheme { /** @cond */ DECLARE_DYNAMIC(CXTPCommandBarsOffice2013Theme) /** @endcond */ public: /** * @brief * Constructs a CXTPCommandBarsOffice2013Theme object. */ CXTPCommandBarsOffice2013Theme(); /** * @brief * Destroys a CXTPCommandBarsOffice2013Theme object, handles cleanup and deallocation. */ virtual ~CXTPCommandBarsOffice2013Theme(); /** * @brief * Retrieves the base theme of the manager. * @return * Returns the base theme of the manager. */ virtual XTPPaintTheme BaseTheme(); /** * @brief * This method is called to fill the control's face. * @param pDC Pointer to a valid device context. * @param pButton Pointer to a CXTPControl object to draw. * @return * TRUE if the rectangle was drawn, otherwise FALSE. */ virtual BOOL DrawRectangle(CDC* pDC, CXTPControl* pButton); /** * @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 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 draw a command bar's group separator. * @param pDC Pointer to a valid device context. * @param pBar Pointer to a CXTPCommandBar object. * @param pLeftControl Pointer to a left CXTPControl object. * @param pRightControl Pointer to a right CXTPControl object. * @param bDraw TRUE to draw; FALSE to retrieve the size of the separator. */ virtual void DrawCommandBarGroupSeparator(CDC* pDC, CXTPCommandBar* pBar, CXTPControl* pLeftControl, CXTPControl* pRightControl, BOOL bDraw); /** * @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 pEdit Edit control to draw. * @return * Size of the control. */ virtual CSize DrawControlEdit(CDC* pDC, CXTPControlEdit* pEdit, BOOL bDraw); /** * @brief * Draws workspace space. * @param pDC Pointer to a valid device context. * @param rc Bounding rectangle. * @param rcExclude Excluded rectangle. */ virtual void FillWorkspace(CDC* pDC, CRect rc, CRect rcExclude); /** * @brief * Used by the paint manager to determine if the theme requires a * resource DLL to load image and color information. * @return * Returns TRUE if the theme requires a resource DLL, otherwise FALSE. */ virtual BOOL RequiresResourceImages(); /** * @brief * This method returns the edit control back color to draw. * @param pControl Pointer to the CXTPControl object to get the back color from. * @return * Edit control back color. */ virtual COLORREF GetControlEditBackColor(CXTPControl* pControl); /** * @brief * This method is called to draw the background for a gallery menu item. * @param pDC Pointer to a valid device context. * @param rcItem CRect object specifying the size of the area. * @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); virtual BOOL SetOfficeBackImage(CXTPCommandBars* pCommandBars, XTPBackImage nBackImage = XTPNone); protected: /** * @brief * This method is called to refresh the visual metrics of the manager. */ virtual void RefreshMetrics(); /** * @brief * Called to update the standard colors used by the framework. * @see * CXTPPaintManager::GetXtremeColor(UINT nIndex) */ virtual void RefreshStandardColors(); /** * @brief * This method retrieves a buttons 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 Returns buttons text color */ virtual COLORREF GetRectangleTextColor(BOOL bSelected, BOOL bPressed, BOOL bEnabled, BOOL bChecked, BOOL bPopuped, XTPBarType barType, XTPBarPosition barPosition); /** * @brief * This method retrieves a buttons text color. * @param pButton Pointer to the button. * @return returns buttons text color */ virtual COLORREF GetControlTextColor(CXTPControl* pButton); /** * @brief * Call this method to get the control back color to draw. * @param pButton Pointer to a CXTPControl object to draw. * @return * The control back color to draw. */ virtual COLORREF GetControlBackColor(CXTPControl* pButton); //----------------------------------------------------------------------- // Summary: // This method is called to fill the control's face. // Parameters: // pDC - Pointer to a valid device context. // rc - Rectangle to draw. // bSelected - TRUE if the control is selected. // bPressed - TRUE if the control is pushed. // bEnabled - TRUE if the control is enabled. // bChecked - TRUE if the control is checked. // bPopuped - TRUE if the control is pop-up'ed. // barType - Parent's bar type. // barPosition - Parent's bar position. // 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); /** * @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 border of 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 nBorderThickness Border thickness value. */ void DrawFrameBorder(CDC* pDC, CRect rc, int nBorderThickness, BOOL bSelected, BOOL bPressed, BOOL bEnabled, BOOL bChecked, BOOL bPopuped, XTPBarType barType, XTPBarPosition barPosition); /** * @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 = FALSE); /** * @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 Pointer to the CXTPControlComboBox object to draw. * @return * Size of the control. */ virtual CSize DrawControlComboBox(CDC* pDC, CXTPControlComboBox* pComboBox, BOOL bDraw); virtual COLORREF GetGlyphColor(CXTPControl* pControl); virtual COLORREF GetSeparatorColor(CXTPControl* pControl, BOOL bDark); virtual void DrawControlPopupGlyph(CDC* pDC, CXTPControl* pButton); /** * @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 the 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); /** * @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 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 * 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 DrawExpandGlyph(CDC* pDC, CXTPControl* pButton, COLORREF clr, BOOL bVertical); virtual void DrawCheckMark(CDC* pDC, CRect rcCheck, BOOL bIsRadio, BOOL bEnabled, BOOL bSelected); /** * @brief * This method is called to draw a check box mark area. * @param pDC Pointer to a valid device context. * @param pButton Pointer to the checkbox control. * @param rc Bounding rectangle of the check box itself (not control). * @param bDraw TRUE to draw; FALSE to find size. * @return * Size of check box mark. */ virtual CSize DrawControlCheckBoxMark(CDC* pDC, CXTPControl* pButton, CRect rc, BOOL bDraw); /** * @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); /** * @brief * This method is called to draw a radio button 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 radio button mark. */ virtual CSize DrawControlRadioButtonMark(CDC* pDC, CRect rc, BOOL bDraw, BOOL bSelected, BOOL bPressed, BOOL bChecked, BOOL bEnabled); /** * @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); CXTPColorSetStateButton* GetButtonColorSet(XTPBarType barType, BOOL bTextColor = FALSE); virtual void GetCheckMarkColors(COLORREF& clrMark, COLORREF& clrBack, COLORREF& clrBorder, BOOL bSelected, BOOL bPressed, BOOL bEnabled); /** * @brief * Call this member function to draw Menu MDI buttons. * @param pDC Pointer to a valid device context. * @param pButton Button to draw. */ virtual void DrawControlMDIButton(CDC* pDC, CXTPControlButton* pButton); virtual void DrawDashedLine(CDC* pDC, int x, int y, int z, COLORREF clr, BOOL bHorzBar); BOOL m_bIntersect; /**< TRUE to draw pop-up bar intersect rectangle. */ CXTPColorSetStateMenu m_csMenu; /**< State colors used by Menu items. */ CXTPColorSetStateMenuTitleBar m_csMenuTitleBar; /**< State colors used by MenuTitleBar items. */ CXTPColorSetStateRibbon m_csRibbon; /**< State colors used by Ribbon group buttons. */ CXTPColorSetStateToolbar m_csToolbar; /**< State colors used by Toolbar buttons. */ CXTPColorSetStateCheckMark m_csCheckMark; /**< State colors used by Menu Check Marks. */ CXTPColorSetStateComboBox m_csComboBox; /**< State colors used by ComboBox control. */ CXTPColorSetStateCheckBox m_csCheckBox; /**< State colors used by Check Box and Radio Button controls. */ CXTPPaintManagerColor m_clrBack; /**< CommandBars background color; */ CXTPPaintManagerColor m_clrGlyph; /**< Glyph Normal color. */ CXTPPaintManagerColor m_clrGlyphHighlight; /**< Glyph Highlight color. */ CXTPPaintManagerColor m_clrGlyphPushed; /**< Glyph Pushed color. */ CXTPPaintManagerColor m_clrGlyphDisabled; /**< Glyph Disabled color. */ CXTPPaintManagerColor m_clrMessageBarText; /**< Message bar text color. */ CXTPPaintManagerColor m_clrBtnFace; /**< Button background color. */ CXTPPaintManagerColor m_clr3DShadow; /**< Button shadow color. */ CXTPPaintManagerColor m_clrHighlight; /**< Button highlight color. */ CXTPPaintManagerColor m_clrCaptionButtonFill; /**< Text color for frame caption buttons. */ CXTPPaintManagerColorGradient m_clrWorkspace; /**< Workspace area gradient color. */ COLORREF m_clrQuickAccess; COLORREF m_clrQuickAccessDisabled; COLORREF m_clrQuickAccessButtonHotBack; COLORREF m_clrQuickAccessButtonPressedBack; }; _XTP_EXT_CLASS BOOL AFX_CDECL XTPSetOfficeSetBackImage(CXTPCommandBars* pCommandBars, XTPBackImage nBackImage = XTPNone); ///////////////////////////////////////////////////////////////////////////// AFX_INLINE XTPPaintTheme CXTPCommandBarsOffice2013Theme::BaseTheme() { return xtpThemeOffice2013; } AFX_INLINE BOOL CXTPCommandBarsOffice2013Theme::RequiresResourceImages() { return TRUE; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(__XTPCOMMANDBARSOFFICE2013THEME_H__) /** @endcond */