/** * @file XTPCommandBarsOffice2003Theme.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(__XTPCOMMANDBARSOFFICE2003THEME_H__) # define __XTPCOMMANDBARSOFFICE2003THEME_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * The CXTPCommandBarsOffice2003Theme class is used to enable an * Office 2003 style theme for Command Bars. * @see * CXTPPaintManager::SetTheme */ class _XTP_EXT_CLASS CXTPCommandBarsOffice2003Theme : public CXTPCommandBarsOfficeXPTheme { /** @cond */ DECLARE_DYNAMIC(CXTPCommandBarsOffice2003Theme) /** @endcond */ public: /** * @brief * Constructs a CXTPCommandBarsOffice2003Theme object. */ CXTPCommandBarsOffice2003Theme(); /** * @brief * Destroys a CXTPCommandBarsOffice2003Theme object, * handles cleanup and deallocation. */ virtual ~CXTPCommandBarsOffice2003Theme(); /** * @brief * Loads bitmap specified by nIDResource and converts its colors. * @param nIDResource Specifies bitmap resource ID. * @return * Handle to bitmap with loaded bitmap. */ static HBITMAP AFX_CDECL GetModernBitmap(UINT nIDResource); /** * @brief * Loads bitmap specified by nIDResource and adds it to ImageManager. * @param nIDResource Specifies bitmap resource ID. * @return * Returns TRUE if successful, FALSE otherwise * @see * GetModernBitmap, CXTPImageManager */ static BOOL AFX_CDECL LoadModernToolbarIcons(UINT nIDResource); /** * @brief * Loads bitmap specified by nIDResource and adds it to ImageManager. * @param nIDResource Specifies bitmap resource ID. * @param pCommands Pointer to an array of IDs. * @param nCount Number of elements in the array pointed to by lpIDArray. * @param szIcon Size of the icons. * @return * Returns TRUE if successful, FALSE otherwise * @see * GetModernBitmap, CXTPImageManager */ static BOOL AFX_CDECL LoadModernToolbarIcons(UINT nIDResource, UINT* pCommands, int nCount, CSize szIcon = CSize(16, 15)); /** * @brief * This method creates a new clipping region that consists of the * existing clipping region minus the corners rectangles. * @param pDC Pointer to a valid device context. * @param rc CRect object specifying size of area. */ void ExcludeCorners(CDC* pDC, CRect rc); protected: /** * @brief * This method is called to refresh the visual metrics of the manager. */ virtual void RefreshMetrics(); /** * @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, otherwise FALSE. */ virtual void DrawPopupBarGripper(CDC* pDC, int xPos, int yPos, int cx, int cy, BOOL bExpanded = FALSE); /** * @brief * This method is called to fill a dockbar. * @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 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 * 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 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 is called to draw the specified controls. * @param pDC Pointer to a valid device context. * @param controlType Special control enumerator. * @param pButton Pointer to a CXTPControl object to draw. * @param pBar Parent CXTPCommandBar object. * @param bDraw TRUE to draw; FALSE to retrieve the size of the * control. * @param lpParam Specified parameter. * @return * Size of the control. * @see * XTPSpecialControl */ virtual CSize DrawSpecialControl(CDC* pDC, XTPSpecialControl controlType, CXTPControl* pButton, CXTPCommandBar* pBar, BOOL bDraw, LPVOID lpParam); /** * @brief * This method is called to retrieve the command bar's borders. * @param pBar Pointer to the 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 the tear-off gripper of a pop-up bar. * @param pDC Pointer to a valid device context. * @param rcGripper Bounding rectangle of the gripper. * @param bSelected TRUE if the gripper is selected. * @param bDraw TRUE to draw; FALSE to retrieve the size of the gripper. * @return * Size of the gripper. */ virtual CSize DrawTearOffGripper(CDC* pDC, CRect rcGripper, BOOL bSelected, BOOL bDraw); /** * @brief * Call this member to draw the gripper of a dialog bar. * @param pDC Pointer to a valid device context. * @param pBar Dialog Bar pointer. * @param bDraw TRUE to draw the gripper, FALSE to calculate size. * @return * Size of the gripper to be drawn. */ virtual CSize DrawDialogBarGripper(CDC* pDC, CXTPDialogBar* pBar, BOOL bDraw); /** * @brief * Retrieves the base theme of the manager. * @return * Returns the base theme. */ virtual XTPPaintTheme BaseTheme() { return xtpThemeOffice2003; } /** * @brief * Generates an expanded bitmap used for CXTPPopupBar. */ void CreateGradientCircle(); /** * @brief * Returns TRUE if a floating toolbar is drawn with a gradient background. * @param pBar Toolbar to check. * @return * TRUE if the Toolbar has a gradient background, otherwise FALSE. */ virtual BOOL HasFloatingBarGradientEntry(CXTPCommandBar* pBar); protected: /** @cond */ void DrawExpandSymbols(CDC* pDC, BOOL bVertical, CRect rc, BOOL bHiddenExists, COLORREF clr); void RectangleEx(CDC* pDC, CRect rc, int nColorBorder, BOOL bHoriz, CXTPPaintManagerColorGradient& color); /** @endcond */ public: CXTPPaintManagerColorGradient m_clrDockBar; /**< Color of dockbar face */ CXTPPaintManagerColorGradient m_clrCommandBar; /**< Color of commandbar face */ CXTPPaintManagerColorGradient m_clrToolbarExpand; /**< Toolbar Expand button color. */ CXTPPaintManagerColorGradient m_clrMenuExpand; /**< MenuBar Expand button color. */ CXTPPaintManagerColorGradient m_clrMenuExpandedGripper; /**< Color of pop-up bar gripper. */ CXTPPaintManagerColorGradient m_clrMenuGripper; /**< Color of the pop-up menu gripper. */ CXTPPaintManagerColorGradient m_clrPopupControl; /**< color of pop-up control */ CXTPPaintManagerColor m_clrToolbarShadow; /**< Toolbar bottom shadow color */ CXTPPaintManagerColor m_clrTearOffGripper; /**< TearOff gripper color */ BOOL m_bLunaTheme; /**< TRUE if luna theme is active. */ BOOL m_bPlainSeparators; /**< TRUE to draw plain separators */ BOOL m_bFlatGripper; int m_nToolbarSeparatorMargin; CImageList m_ilGradientCircle; /**< Gradient circle holder. */ CXTPPaintManagerColorGradient m_grcLunaChecked; /**< Background color of checked button */ CXTPPaintManagerColorGradient m_grcLunaPushed; /**< Background color of pushed button */ CXTPPaintManagerColorGradient m_grcLunaSelected; /**< Background color of selected button */ }; # define CXTPOffice2003Theme CXTPCommandBarsOffice2003Theme /**< Old name */ /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // #if !defined(__XTPCOMMANDBARSOFFICE2003THEME_H__) /** @endcond */