/** * @file XTPCommandBarsOfficeXPTheme.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(__XTPCOMMANDBARSOFFICEXPTHEME_H__) # define __XTPCOMMANDBARSOFFICEXPTHEME_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * The CXTPCommandBarsOfficeXPTheme class is used to enable an * Office XP style theme for Command Bars. * @see * CXTPPaintManager::SetTheme */ class _XTP_EXT_CLASS CXTPCommandBarsOfficeXPTheme : public CXTPPaintManager { /** @cond */ DECLARE_DYNAMIC(CXTPCommandBarsOfficeXPTheme) /** @endcond */ public: /** * @brief * Constructs a CXTPCommandBarsOfficeXPTheme object. */ CXTPCommandBarsOfficeXPTheme(); /** * @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 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 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 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 control placed on the ListBox. * @param pDC Pointer to a valid device context. * @param pButton Pointer to a CXTPControl object. * @param rc Bounding rectangle to draw. * @param bSelected TRUE if the control is selected. * @param bDraw TRUE to draw; FALSE to retrieve the size of the control. * @param pCommandBars CommandBars object which metrics need to use. * @return * Size of the control. */ virtual CSize DrawListBoxControl(CDC* pDC, CXTPControl* pButton, CRect rc, BOOL bSelected, BOOL bDraw, CXTPCommandBars* pCommandBars = 0); /** * @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 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 * This method is called to draw a resize gripper of a pop-up bar. * @param pDC Pointer to a valid device context * @param rcGripper Bounding rectangle of the gripper. * @param nFlags Position of the resize gripper. */ virtual void DrawPopupResizeGripper(CDC* pDC, CRect rcGripper, int nFlags); /** * @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 gripper, FALSE to calculate size. * @return * Size of gripper to be drawn. */ virtual CSize DrawDialogBarGripper(CDC* pDC, CXTPDialogBar* pBar, BOOL bDraw); protected: /** * @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 control placed on the pop-up bar. * @param pDC Pointer to a valid device context. * @param pButton Pointer to a CXTPControl object. * @param bDraw TRUE to draw; FALSE to retrieve the size of the control. * @return * Size of the control. */ virtual CSize DrawControlPopupParent(CDC* pDC, CXTPControl* pButton, BOOL bDraw); /** * @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 the button. * @return * TRUE if the rectangle was drawn, otherwise returns FALSE. */ virtual BOOL DrawRectangle(CDC* pDC, CXTPControl* pButton); /** * @brief * This method is called to draw the image of the control. * @param pDC Pointer to a valid device context. * @param pt Position to draw. * @param sz Size of the image. * @param pImage Pointer to a CXTPImageManagerIcon object. * @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 bToolBarImage TRUE if it is a toolbar image. */ virtual void DrawImage(CDC* pDC, CPoint pt, CSize sz, CXTPImageManagerIcon* pImage, BOOL bSelected, BOOL bPressed, BOOL bEnabled = TRUE, BOOL bChecked = FALSE, BOOL bPopuped = FALSE, BOOL bToolBarImage = 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 a CXTPControlComboBox object to draw. * @return * Size of the control. */ virtual CSize DrawControlComboBox(CDC* pDC, CXTPControlComboBox* pComboBox, 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 intersect rectangle of a pop-up bar and its control. * @param pDC Pointer to a valid device context. * @param pPopupBar Pop-up bar pointer. * @param clr COLORREF specifies RGB color value. */ void FillIntersectRect(CDC* pDC, CXTPPopupBar* pPopupBar, COLORREF clr); /** * @brief * Retrieves the base theme of the manager. * @return * Returns the base theme. */ virtual XTPPaintTheme BaseTheme() { return xtpThemeOfficeXP; } /** * @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 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 the 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 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 the check box mark */ virtual CSize DrawControlCheckBoxMark(CDC* pDC, CXTPControl* pButton, CRect rc, BOOL bDraw); /** * @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 the radio button mark. */ virtual CSize DrawControlRadioButtonMark(CDC* pDC, CRect rc, BOOL bDraw, BOOL bSelected, BOOL bPressed, BOOL bChecked, BOOL bEnabled); virtual void DrawCheckMark(CDC* pDC, CRect rcCheck, BOOL bIsRadio, BOOL bEnabled, BOOL bSelected); protected: /** @cond */ virtual void DrawSplitButtonPopup(CDC* pDC, CXTPControl* pButton); virtual void DrawControlPopupGlyph(CDC* pDC, CXTPControl* pButton); virtual void FillPopupLabelEntry(CDC* pDC, CRect rc); /** @endcond */ }; # define CXTPOfficeTheme CXTPCommandBarsOfficeXPTheme /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(__XTPCOMMANDBARSOFFICEXPTHEME_H__) /** @endcond */