/** * @file XTPCommandBarsOffice2000Theme.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(__XTPCOMMANDBARSOFFICE2000THEME_H__) # define __XTPCOMMANDBARSOFFICE2000THEME_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * The CXTPCommandBarsOffice2000Theme class is used to enable an * Office 2000 style theme for Command Bars. * @see * CXTPPaintManager::SetTheme */ class _XTP_EXT_CLASS CXTPCommandBarsOffice2000Theme : public CXTPPaintManager { /** @cond */ DECLARE_DYNAMIC(CXTPCommandBarsOffice2000Theme) /** @endcond */ public: /** * @brief * Constructs a CXTPCommandBarsOffice2000Theme object. */ CXTPCommandBarsOffice2000Theme(); /** * @brief * This method is called to refresh the visual metrics of the manager. */ virtual void RefreshMetrics(); /** * @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 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 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 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 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 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 the pop-up bar resize gripper. * @param pDC Pointer to a valid device context. * @param rcGripper Bounding rectangle of the gripper. * @param nFlags Position of resize gripper */ virtual void DrawPopupResizeGripper(CDC* pDC, CRect rcGripper, int nFlags); protected: /** * @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 * Draws split button frame. * @param pDC Pointer to a valid device context. * @param pButton Pointer to the split button to draw. * @param rcButton Bounding rectangle to draw. */ virtual void DrawSplitButtonFrame(CDC* pDC, CXTPControl* pButton, CRect rcButton); /** * @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 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 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 pComboBox ComboBox to draw. * @param bDraw TRUE to draw; FALSE to retrieve the size of the control. * @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 * 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 * This method is called to draw the frame of an edit control. * @param pDC Pointer to a valid device context. * @param rc CRect object specifying size of area. * @param bEnabled TRUE if control is enabled. * @param bSelected TRUE if control is selected. */ virtual void DrawControlEditFrame(CDC* pDC, CRect rc, BOOL bEnabled, BOOL bSelected); /** * @brief * This method is called to draw the button of a combobox control. * @param pDC Pointer to a valid device context. * @param rcBtn Button bounding rectangle. * @param bEnabled TRUE if combobox is enabled. * @param bSelected TRUE if combobox is selected. * @param bDropped TRUE if combobox is dropped. */ virtual void DrawControlComboBoxButton(CDC* pDC, CRect rcBtn, BOOL bEnabled, BOOL bSelected, BOOL bDropped); /** * @brief * This method draws edit control spin buttons. * @param pDC Pointer to a valid device context. * @param pControlEdit Edit control. */ virtual void DrawControlEditSpin(CDC* pDC, CXTPControlEdit* pControlEdit); /** * @brief * Retrieves the base theme of the manager. * @return * Returns the base theme. */ virtual XTPPaintTheme BaseTheme() { return xtpThemeOffice2000; } protected: /** @cond */ void DrawShadedRect(CDC* pDC, CRect& rect); virtual CSize GetPopupBarImageSize(CXTPCommandBar* pBar); /** @endcond */ protected: int m_nPopupBarText; /**< Pop-up bar text index. */ }; # define CXTPDefaultTheme CXTPCommandBarsOffice2000Theme /**< Old name */ /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(__XTPCOMMANDBARSOFFICE2000THEME_H__) /** @endcond */