/** * @file XTPCommandBarsNativeXPTheme.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(__XTPCOMMANDBARSNATIVEXPTHEME_H__) # define __XTPCOMMANDBARSNATIVEXPTHEME_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * The CXTPCommandBarsNativeXPTheme class is used to enable a * Native Windows XP style theme for Command Bars. * @see * CXTPPaintManager::SetTheme */ class _XTP_EXT_CLASS CXTPCommandBarsNativeXPTheme : public CXTPCommandBarsOffice2000Theme { /** @cond */ DECLARE_DYNAMIC(CXTPCommandBarsNativeXPTheme) /** @endcond */ public: /** * @brief * Constructs a CXTPCommandBarsNativeXPTheme object. */ CXTPCommandBarsNativeXPTheme(); /** * @brief * Destroys a CXTPCommandBarsNativeXPTheme object, handles cleanup and deallocation. */ ~CXTPCommandBarsNativeXPTheme(); protected: /** * @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 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 rectangle was drawn, otherwise returns FALSE. */ virtual BOOL DrawRectangle(CDC* pDC, CXTPControl* pButton); /** * @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. */ void DrawControlEntry(CDC* pDC, CXTPControl* pButton); /** * @brief * This method returns the control text color to draw. * @param pButton Pointer to a CXTPControl object to draw. * @return Returns application state color */ COLORREF GetControlTextColor(CXTPControl* pButton); /** * @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 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 a dockbar. * @param pDC Points to a valid device context. * @param pWnd Client area to fill. * @param pFrame Parent frame window. */ void FillDockBarRect(CDC* pDC, CWnd* pWnd, CWnd* pFrame); /** * @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. */ void AdjustExcludeRect(CRect& rc, CXTPControl* pControl, BOOL bVertical); /** * @brief * Draws a 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. */ void DrawSplitButtonFrame(CDC* pDC, CXTPControl* pButton, CRect rcButton); /** * @brief * This method is called to draw the frame of edit control. * @param pDC Points to a valid device context. * @param rc CRect object specifying the size of the 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 Points 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 * 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); /** * @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 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 * Retrieves the base theme of the manager. * @return * The base theme of the manager. */ virtual XTPPaintTheme BaseTheme() { return xtpThemeNativeWinXP; } /** * @brief * Determines if WinXP theme is enabled. * @return * TRUE if WinXP theme is enabled, FALSE otherwise. */ BOOL IsThemeEnabled() const; /** * @brief * This method draws edit control spin buttons. * @param pDC Pointer to device context. * @param pControlEdit Edit control. */ virtual void DrawControlEditSpin(CDC* pDC, CXTPControlEdit* pControlEdit); /** * @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. */ virtual CSize DrawSpecialControl(CDC* pDC, XTPSpecialControl controlType, CXTPControl* pButton, CXTPCommandBar* pBar, BOOL bDraw, LPVOID lpParam); /** * @brief * This method is called to draw a pop-up bar's right gripper. * @param pDC Points 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 * Call this member function to draw a check mark. * @param pDC Pointer to a valid device context. * @param rcCheck Specifies the rectangle in logical units. * @param clr Color to fill. * @param bEnabled TRUE to enable, FALSE to disable the button. */ virtual void DrawPopupBarCheckMark(CDC* pDC, CRect rcCheck, BOOL bEnabled, COLORREF clr); /** * @brief * Call this member function to draw a radio button. * @param pDC Pointer to a valid device context. * @param rcCheck Specifies the rectangle in logical units. * @param clr Color to fill. * @param bEnabled TRUE to enable, FALSE to disable the button. */ virtual void DrawPopupBarRadioMark(CDC* pDC, CRect rcCheck, BOOL bEnabled, COLORREF clr); /** * @brief * Calculates the gripper of a pop-up bar. * @param pBar Pop-up bar. * @return * Width of the gripper to draw. */ virtual int GetPopupBarGripperWidth(CXTPCommandBar* pBar); /** * @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); protected: CXTPWinThemeWrapper* m_themeRebar; /**< Rebar theme helper */ CXTPWinThemeWrapper* m_themeToolbar; /**< Toolbar theme helper */ CXTPWinThemeWrapper* m_themeCombo; /**< ComboBox theme helper */ CXTPWinThemeWrapper* m_themeWindow; /**< Window theme helper */ CXTPWinThemeWrapper* m_themeSpin; /**< Window theme helper */ CXTPWinThemeWrapper* m_themeMenu; /**< Menu theme helper */ COLORREF m_clrEdgeShadowColor; /**< Color of toolbar bottom line */ COLORREF m_clrEdgeHighLightColor; /**< Color of toolbar top line */ BOOL m_bFlatMenus; /**< TRUE if OS flat menu option enabled */ COLORREF m_clrSelectedText; /**< Selected text color */ COLORREF m_clrPressedText; /**< Pressed text color. */ }; # define CXTPNativeXPTheme CXTPCommandBarsNativeXPTheme // Old name /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(__XTPCOMMANDBARSNATIVEXPTHEME_H__) /** @endcond */