/** * @file XTPPaintManager.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(__XTPPAINTMANAGER_H__) # define __XTPPAINTMANAGER_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPWinThemeWrapper; class CXTPControlButton; class CXTPControlPopup; class CXTPControl; class CXTPToolBar; class CXTPCommandBar; class CXTPCommandBars; class CXTPPopupBar; class CXTPControlComboBox; class CXTPTabControl; class CXTPDockBar; class CXTPControlEdit; class CXTPImageManagerIcon; class CXTPDialogBar; class CXTPStatusBar; class CXTPStatusBarPane; class CXTPStatusBarSwitchPane; class CXTPStatusBarPaintManager; class CXTPMessageBar; class CXTPMessageBarButton; class CXTPMessageBarPaintManager; class CXTPCommandBarKeyboardTip; class CXTPShadowManager; class CXTPResourceImages; class CXTPResourceImage; /* * Paint manager */ class CXTPRibbonPaintManager; class CXTPControlGalleryPaintManager; class CXTPSliderPaintManager; class CXTPProgressPaintManager; class CXTPFramePaintManager; class CXTPScrollBarPaintManager; /** * @brief * Special control with extended drawing. * @see * CXTPPaintManager::DrawSpecialControl, xtpButtonExpandToolbar, xtpButtonExpandMenu, * xtpButtonHideFloating, xtpButtonExpandFloating, xtpButtonCustomize */ enum XTPSpecialControl { xtpButtonExpandToolbar, /**< Control is option button of docking toolbar.*/ xtpButtonExpandMenu, /**< Control is expand button of pop-up bar.*/ xtpButtonHideFloating, /**< Control is hide button of floating toolbar.*/ xtpButtonExpandFloating /**< Control is option button of floating toolbar.*/ }; /** * @brief * This structure collect icons options for command bars. * * Example: *
XTPPaintManager()->GetIconsInfo()->bIconsWithShadow = FALSE;* @see * CXTPPaintManager::GetIconsInfo */ struct XTP_COMMANDBARS_ICONSINFO { BOOL bUseFadedIcons; /**< If TRUE, icons will appear faded. */ BOOL bUseDisabledIcons; /**< If TRUE, disabled icons will be used when the control is disabled. */ BOOL bIconsWithShadow; /**< If TRUE, when the mouse pointer is moved over a command bar control, the icons will appear to "jump" away from the screen casting a shadow. */ BOOL bOfficeStyleDisabledIcons; /**< If TRUE, Office 2003 style disabled icons will be drawn when using disabled icons. */ }; /** * @brief * PaintManagers used CFont wrapper. */ class _XTP_EXT_CLASS CXTPPaintManagerFont : public CFont { public: /** * @brief * Constructs a CXTPPaintManagerFont object. */ CXTPPaintManagerFont() : m_bStandardFont(TRUE) { } /** * @brief * Sets application defined font. * @param lpLogFont Application defined font. * @return * TRUE if successful, otherwise FALSE. */ BOOL SetCustomFont(const LOGFONT* lpLogFont); /** * @brief * Call this method to enable/disable use of custom font. * @param bEnable TRUE if custom font is to be used. * @see SetCustomFont, SetStandardFont */ void EnableCustomFont(BOOL bEnable = TRUE); /** @cond */ _XTP_DEPRECATED_IN_FAVOR(EnableCustomFont) void SetCustomFont(BOOL bCustomFont) { EnableCustomFont(bCustomFont); } /** @endcond */ /** * @brief * Sets paint manager's font. * @param lpLogFont PaintManager's defined font. * @return * TRUE if successful, otherwise FALSE. */ BOOL SetStandardFont(const LOGFONT* lpLogFont); protected: BOOL m_bStandardFont; /**< TRUE to use standard font; */ }; /** @cond */ # define XTP_COMMANDBAR_MIN_FONT_HEIGHT 10 # define XTP_COMMANDBAR_MIN_CONTROL_HEIGHT \ (XTP_COMMANDBAR_MIN_FONT_HEIGHT + (XTP_COMMANDBAR_MIN_FONT_HEIGHT * 80) / 100) # define XTP_COMMANDBAR_SPLITBUTTON_DROPDOWN_WIDTH (XTP_COMMANDBAR_MIN_FONT_HEIGHT + 1) # define XTP_COMMANDBAR_TRIANGLE_SIZE XTP_DPI_Y(10) # define XTP_COMMANDBAR_BUTTON_TEXT_OFFSET XTP_DPI_Y(2) # define XTP_COMMANDBAR_TEXT_HEIGHT_FACTOR 110 # define XTP_COMMANDBAR_CONTROL_HEIGHT_FACTOR 190 /** @endcond */ class CXTPControlGalleryItem; class CXTPPaintManager; XTP_FORWARD_ENUM(XTPPrimitiveSymbol); struct IXTPPaintManagerEvents { //----------------------------------------------------------------------- // Handles object destruction //----------------------------------------------------------------------- virtual ~IXTPPaintManagerEvents() { } virtual void OnPaintManagerDestroyed(CXTPPaintManager* /*pPaintManager*/) { } }; /** * @brief * Paint manager of the command bars. */ class _XTP_EXT_CLASS CXTPPaintManager : public CXTPCmdTarget , public CXTPObservable
XTPPaintManager()->SetImageHandle(XTPSkinManager()->GetResourceFile()->GetModuleHandle());* @see * LoadImage, m_pImages */ virtual void SetImageHandle(HMODULE hResource, LPCTSTR lpszIniFileName); public: /** * @brief * This method is called to draw the control. * @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. */ CSize DrawControl(CDC* pDC, CXTPControl* pButton, BOOL bDraw = TRUE); /** * @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 draw the control placed on the toolbar. * @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 DrawControlToolBarParent(CDC* pDC, CXTPControl* pButton, BOOL bDraw); /** * @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) = 0; /** * @brief * This method is called to draw the control. * @param pDC Pointer to a valid device context * @param pCombo 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* pCombo, BOOL bDraw); /** * @brief * This method returns the edit control back color to draw. * @param pControl Pointer to a 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 control. * @param pDC Pointer to a valid device context. * @param pEdit Edit control to draw. * @param bDraw TRUE to draw, FALSE to retrieve the size of the control. * @return * Size of the control. */ virtual CSize DrawControlEdit(CDC* pDC, CXTPControlEdit* pEdit, BOOL bDraw); /** * @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) = 0; /** * @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) = 0; /** * @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. */ virtual void DrawControlEntry(CDC* pDC, CXTPControl* pButton); /** * @brief * Call this method to get the control text color to draw. * @param pButton Pointer to a CXTPControl object to draw. * @return * The control text color to draw. */ 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); /** * @brief * This method retrieves a button's 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 * A button's text color. */ virtual COLORREF GetRectangleTextColor(BOOL bSelected, BOOL bPressed, BOOL bEnabled, BOOL bChecked, BOOL bPopuped, XTPBarType barType, XTPBarPosition barPosition) = 0; /** * @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) = 0; /** * @brief * This method is called to draw the background for a gallery menu item. * @param pDC Pointer to a valid device context. * @param rcItem 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 barType Parent's bar type. */ virtual void DrawGalleryItemBack(CDC* pDC, CRect rcItem, BOOL bEnabled, BOOL bSelected, BOOL bPressed, BOOL bChecked, XTPBarType barType); /** * @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 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) = 0; /** * @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 left 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 = TRUE); /** * @brief * This method is called to determine the offset of a pop-up'ed bar. * @param rc Control's bounding rectangle. * @param pControl Pointer to a CXTPControl object. * @param bVertical TRUE if control is docked vertically. */ virtual void AdjustExcludeRect(CRect& rc, CXTPControl* pControl, BOOL bVertical) = 0; /** * @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 fill a workspace. * @param pDC Pointer to device context. * @param rc Bounding rectangle. * @param rcExclude Excluded rectangle. */ virtual void FillWorkspace(CDC* pDC, CRect rc, CRect rcExclude); /** * @brief * This method is called to refresh the visual metrics of the manager. */ virtual void RefreshMetrics(); /** * @brief * Determines the kind of shadow to use. * @return * Combination of XTPShadowOptions flags. * See Also * XTPShadowOptions */ int GetShadowOptions() const; /** * @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 DrawExpandGlyph(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 DrawHiddenGlyph(CDC* pDC, CXTPControl* pButton, COLORREF clr, BOOL bVertical); /** * @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 retrieve the command bar's borders. * @param pBar Pointer to a CXTPCommandBar object. * @return * Borders of the command bar. */ virtual CRect GetCommandBarBorders(CXTPCommandBar* pBar); /** * @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) = 0; /** * @brief * This method is called to draw a pop-up bar's 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) = 0; /** * @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) = 0; /** * @brief * Call this member to draw a dialog bar's gripper. * @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) = 0; /** * @brief * Determines split button command rectangle. * @param pButton Button to test. * @return * Bounding rectangle of command part of split button */ virtual CRect GetSplitButtonCommandRect(CXTPControl* pButton); /** * @brief * Call this method to set the bounding region of a pop-up bar. * @param pCommandBar Pointer to the pop-up bar whose bounding region must be set. */ virtual void SetCommandBarRegion(CXTPCommandBar* pCommandBar); /** * @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 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 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 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); public: /** * @brief * Creates a new CXTPPaintManager object. * @param paintTheme Theme to be created. * @return * Pointer to a new CXTPPaintManager object. * * Example: *
pCommandBars->SetPaintManager(CXTPPaintManager::CreateTheme(xtpThemeOfficeXP);*/ static CXTPPaintManager* AFX_CDECL CreateTheme(XTPPaintTheme paintTheme); /** * @brief * Call this member to switch the visual theme of the Command Bars. * @param paintTheme Theme to be set. Can be any of the values listed in * the Remarks section. * @details * paintTheme can be one of following: * xtpThemeOfficeXP: Enables Office XP theme. * xtpThemeOffice2000: Enables Office 2000 theme. * xtpThemeOffice2003: Enables Office 2003 theme. * xtpThemeNativeWinXP: Enables Windows XP themes support. * xtpThemeVisualStudio2005: Enables Visual Studio 2005 theme. * @return */ static void AFX_CDECL SetTheme(XTPPaintTheme paintTheme); /** * @brief * Call this member to set a custom theme. * @param pTheme Theme to be set. * @return */ static void AFX_CDECL SetCustomTheme(CXTPPaintManager* pTheme); /** * @brief * Call this member to get the current visual theme. * @return * The current theme. */ XTPPaintTheme GetCurrentTheme() { return m_themeCurrent; } /** * @brief * Retrieves the base theme of the manager. * @return * Returns the base theme. */ virtual XTPPaintTheme BaseTheme() = 0; /** * @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(); public: /** * @brief * Call this member to retrieve the font of the command bar control. * @param pControl Pointer to a CXTPCommandBar object. * @return * A pointer to a CFont object. */ virtual CFont* GetControlFont(CXTPControl* pControl); /** * @brief * Call this member to retrieve the font of the command bar. * @param pCommandBar Pointer to a CXTPCommandBar object to determine * the font used to draw text. * @return * A pointer to a CFont object. */ virtual CFont* GetCommandBarFont(CXTPCommandBar* pCommandBar); /** * @brief * Call this member to determine how to draw text. * @param pControl Pointer to a CXTPControl object. * @return The current text orientation as defined by the XTPBarTextOrientation enumeration. */ virtual XTPBarTextOrientation GetControlTextOrientation(CXTPControl* pControl); /** * @brief * Draws a triangle. * @param pDC Pointer to a valid device context. * @param pt0 Specifies the logical coordinates of the first point. * @param pt1 Specifies the logical coordinates of the second point. * @param pt2 Specifies the logical coordinates of the third point. * @param clr Color to fill. * @return */ static void AFX_CDECL Triangle(CDC* pDC, CPoint pt0, CPoint pt1, CPoint pt2, COLORREF clr); /** * @brief * Refreshes the fonts to use. */ virtual void UpdateFonts(); /** * @brief * Refreshes the standard colors to use. */ virtual void UpdateColors(); /** * @brief * Call this member to set command bar's font. * @param pLogFont New LOGFONT to use for text. * @param bUseStandardFont When calling SetCommandBarsFontIndirect, always * use FALSE, this will indicate that pLogFont * should be used as the new font. */ void SetCommandBarsFontIndirect(LOGFONT* pLogFont, BOOL bUseStandardFont = FALSE); /** * @brief * Returns the general font. * @return * A Pointer to a CFont object. */ CFont* GetRegularFont(); /** * @brief * Returns the general bold font. * @return * A Pointer to a CFont object. */ CFont* GetRegularBoldFont(); /** * @brief * Returns the icon font. * @return * A pointer to a CFont object. */ CFont* GetIconFont(); /** * @brief * Call this method to retrieve the caption of a floating mini frame. * @return * A pointer to a CFont object. */ CFont* GetSmCaptionFont(); /** * @brief * Call this method to use Tahoma font despite system metrics. * @param bUseOfficeFont TRUE to use office font. */ void UseOfficeFont(bool bUseOfficeFont); /** * @brief * This method returns the common controls height. * @return * Controls height. */ int GetControlHeight() const; /** * @brief * Computes default command bar size taking into account command bar font. * Command bar elements' sizes are not considered. * @param pBar Command bar object pointer to check size for. * @return * Default command bar size. */ virtual CSize GetDefaultCommandBarSize(CXTPCommandBar* pBar); /** * @brief * Draws a rectangle. * @param pDC Pointer to a valid device context. * @param rc Specifies the rectangle in logical units. * @param nPen Specifies the color used to paint the rectangle. * @param nBrush Specifies the color used to fill the rectangle. */ void Rectangle(CDC* pDC, LPCRECT rc, int nPen, const int nBrush); /** * @brief * Draws a rectangle. * @param pDC Pointer to a valid device context. * @param rc Specifies the rectangle in logical units. * @param clrPen Specifies the color used to paint the rectangle. * @param clrBrush Specifies the color used to fill the rectangle. */ void Rectangle(CDC* pDC, LPCRECT rc, COLORREF clrPen, COLORREF clrBrush); /** * @brief * Draws a rectangle. * @param pDC Pointer to a valid device context. * @param rc Specifies the rectangle in logical units. * @param clrPen Specifies the color used to paint the rectangle. * @param clrBrush Specifies the color used to fill the rectangle. */ void RoundRect(CDC* pDC, LPCRECT rc, COLORREF clrPen, COLORREF clrBrush); /** * @brief * Call this member function to draw a three-dimensional rectangle. * @param pDC Pointer to a valid device context. * @param rc Specifies the rectangle in logical units. * @param nTopLeft Specifies the color of the top and left sides * of the three-dimensional rectangle. * @param nBottomRight Specifies the color of the bottom and right sides * of the three-dimensional rectangle. */ void Draw3dRect(CDC* pDC, LPCRECT rc, int nTopLeft, int nBottomRight); /** * @brief * Call this member function to draw a rectangle with predetermined thickness. * @param pDC Pointer to a valid device context. * @param rc Specifies the rectangle in logical units. * @param frameThickness Thickness of the rectangle frame. * @param clrPen Specifies the color used to paint the rectangle. * @param clrBrush Specifies the color used to fill the rectangle. */ void Draw3dRect(CDC* pDC, LPCRECT rc, int frameThickness, COLORREF clrPen, COLORREF clrBrush); /** * @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 check mark. * @param pDC Pointer to a valid device context. * @param rcCheck Specifies the rectangle in logical units. * @param clr Color to fill. */ void DrawCheckMark(CDC* pDC, CRect rcCheck, COLORREF clr = 0) { DrawPopupBarCheckMark(pDC, rcCheck, TRUE, 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 * Call this member function to draw a combobox expand symbol. * @param pDC Pointer to a valid device context. * @param rc Specifies the rectangle in logical units. * @param clr Color to fill. */ virtual void DrawComboExpandMark(CDC* pDC, CRect rc, COLORREF clr); /** * @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); /** * @brief * Draws a line. * @param pDC Pointer to a valid device context. * @param p0 Specifies the logical coordinates of the start position. * @param p1 Specifies the logical coordinates of the endpoint for the line. */ void Line(CDC* pDC, CPoint p0, CPoint p1); /** * @brief * Draws a line. * @param pDC Pointer to a valid device context. * @param x0 Specifies the logical x coordinate of the start position. * @param y0 Specifies the logical y coordinate of the start position. * @param x1 Specifies the logical x coordinate of the endpoint for the line. * @param y1 Specifies the logical y coordinate of the endpoint for the line. * @param nPen Specifies the index of the color used to paint the line. */ void Line(CDC* pDC, int x0, int y0, int x1, int y1, const int nPen); /** * @brief * Draws a line. * @param pDC Pointer to a valid device context. * @param x0 Specifies the logical x coordinate of the start position. * @param y0 Specifies the logical y coordinate of the start position. * @param x1 Specifies the logical x coordinate of the endpoint for the line. * @param y1 Specifies the logical y coordinate of the endpoint for the line. * @param clrPen RGB value that specifies the color used to paint the line. */ void Line(CDC* pDC, int x0, int y0, int x1, int y1, COLORREF clrPen); /** * @brief * Call this member function to draw a horizontal line using the specified * coordinages and RGB color value. * @param pDC Pointer to a valid device context. * @param x0 Specifies the logical x coordinate of the start position. * @param y0 Specifies the logical y coordinate of the start position. * @param x1 Specifies the logical x coordinate of the endpoint for the line. * @param clrPen RGB value that specifies the color used to paint the line. */ void HorizontalLine(CDC* pDC, int x0, int y0, int x1, COLORREF clrPen); /** * @brief * Call this member function to draw a vertical line using the specified * coordinages and RGB color value. * @param pDC Pointer to a valid device context * @param x0 Specifies the logical x coordinate of the start position. * @param y0 Specifies the logical y coordinate of the start position. * @param y1 Specifies the logical y coordinate of the endpoint for the line. * @param clrPen RGB value that specifies the color used to paint the line. */ void VerticalLine(CDC* pDC, int x0, int y0, int y1, COLORREF clrPen); /** * @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 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 * Sets the pixel at the point. * @param pDC Pointer to a valid device context. * @param xPos Specifies the logical x coordinate of the point to be set. * @param yPos Specifies the logical y coordinate of the point to be set. * @param nPen Specifies the color used to paint the point. */ void Pixel(CDC* pDC, int xPos, int yPos, int nPen); /** * @brief * Gradient fills the rectangle. * @param pDC Pointer to a valid device context. * @param lpRect Specifies the rectangle in logical units. * @param crFrom Start color. * @param crTo Endpoint color. * @param bHorz TRUE to fill horizontally. * @param lpRectClip Pointer to a RECT structure that contains a clipping * rectangle. This parameter is optional and may be set to * NULL. */ void GradientFill(CDC* pDC, LPRECT lpRect, COLORREF crFrom, COLORREF crTo, BOOL bHorz, LPCRECT lpRectClip = NULL); /** * @return * Retrieves a specific icon's options. * @see * XTP_COMMANDBARS_ICONSINFO */ XTP_COMMANDBARS_ICONSINFO* GetIconsInfo(); ////////////////////////////////////////////////////////////////////////// // Animation Routines /** * @brief * This method is called to animate the pop-up bar. * @param pDestDC Pointer to the device context you must draw to. * @param pSrcDC Device context that contains the bitmap you must take. * @param rc Bounding rectangle. * @param animationType Type of animation to perform. * @see * SetAnimationDelay */ virtual void Animate(CDC* pDestDC, CDC* pSrcDC, CRect rc, XTPAnimationType animationType); /** * @brief * This method is called to animate the expanding process. * @param pCommandBar Command bar to animate. * @param pDestDC Pointer to the device context you must draw to. * @param pSrcDC Device context that contains the bitmap you must take. * @param bExpandDown TRUE to animate expanding top-to-bottom, * FALSE to animate expanding bottom-to-top. */ virtual void AnimateExpanding(CXTPCommandBar* pCommandBar, CDC* pDestDC, CDC* pSrcDC, BOOL bExpandDown); /** * @brief * Call this method to set animation delay. * @param nAnimationSteps Number of steps to take during animation. * @param nAnimationTime Amount of time to rest, in milliseconds, between * each step. */ void SetAnimationDelay(int nAnimationSteps, int nAnimationTime); /** * @brief * This function retrieves the current color of the specified XP * display element. Display elements are the parts of a window * and the display that appear on the system display screen. * The function returns the red, green, blue (RGB) color value * of the given element. To provide a consistent look to all * Windows applications, the operating system provides and * maintains global settings that define the colors of various * aspects of the display. These settings as a group are sometimes * referred to as a "color scheme." To view the current color * settings, click Control Panel, double-click the Display icon, * and then click the "Appearance" tab. * @param nIndex Specifies the display element whose color is to be * retrieved. This parameter can be one of the * following values displayed in the table below: * @details *
* Constant Value Description * COLOR_SCROLLBAR 0 Scroll bar * COLOR_BACKGROUND 1 Desktop color * COLOR_ACTIVECAPTION 2 Color of the title bar for the active *window, Specifies the left side color in the color gradient of an active window's title bar if *the gradient effect is enabled. COLOR_INACTIVECAPTION 3 Color of the *title bar for the inactive window, Specifies the left side color in the color gradient of an *inactive window's title bar if the gradient effect is enabled. COLOR_MENU 4 *Menu background color COLOR_WINDOW 5 Window background color * COLOR_WINDOWFRAME 6 Window frame color * COLOR_MENUTEXT 7 Color of text on menus * COLOR_WINDOWTEXT 8 Color of text in windows * COLOR_CAPTIONTEXT 9 Color of text in caption, size box, and *scroll arrow COLOR_ACTIVEBORDER 10 Border color of active window * COLOR_INACTIVEBORDER 11 Border color of inactive window * COLOR_APPWORKSPACE 12 Background color of multiple-document *interface (MDI) applications COLOR_HIGHLIGHT 13 Background color *of items selected in a control COLOR_HIGHLIGHTTEXT 14 Text color of *items selected in a control COLOR_BTNFACE 15 Face color for *three-dimensional display elements and for dialog box backgrounds. COLOR_BTNSHADOW 16 Color of *shading on the edge of command buttons COLOR_GRAYTEXT 17 Grayed *(disabled) text COLOR_BTNTEXT 18 Text color on push buttons * COLOR_INACTIVECAPTIONTEXT 19 Color of text in an inactive caption * COLOR_BTNHIGHLIGHT 20 Highlight color for 3-D display elements * COLOR_3DDKSHADOW 21 Darkest shadow color for 3-D display elements * COLOR_3DLIGHT 22 Second lightest 3-D color after 3DHighlight, *Light color for three-dimensional display elements (for edges facing the light source.) * COLOR_INFOTEXT 23 Color of text in ToolTips * COLOR_INFOBK 24 Background color of ToolTips * COLOR_HOTLIGHT 25 Color for a hot-tracked item. Single clicking *a hot-tracked item executes the item. COLOR_GRADIENTACTIVECAPTION 26 Right *side color in the color gradient of an active window's title bar. COLOR_ACTIVECAPTION *27 specifies the left side color. COLOR_GRADIENTINACTIVECAPTION 28 Right side *color in the color gradient of an inactive window's title bar. COLOR_INACTIVECAPTION 29 *specifies the left side color. XPCOLOR_TOOLBAR_FACE 30 Toolbar *background color. XPCOLOR_HIGHLIGHT 31 Menu item selected color. * XPCOLOR_HIGHLIGHT_BORDER 32 Menu item selected border color. * XPCOLOR_HIGHLIGHT_PUSHED 33 Menu item pushed color. * XPCOLOR_ICONSHADDOW 34 Menu item icon shadow. * XPCOLOR_MENUBAR_GRAYTEXT 35 Menu bar gray text * XPCOLOR_GRAYTEXT 35 Menu item disabled text color. * XPCOLOR_HIGHLIGHT_CHECKED 36 Menu item checked color. * XPCOLOR_HIGHLIGHT_CHECKED_BORDER 37 An RGB value that represents the menu item *checked border color. XPCOLOR_TOOLBAR_GRIPPER 38 Toolbar gripper color. * XPCOLOR_SEPARATOR 39 Toolbar separator color. * XPCOLOR_DISABLED 40 Menu icon disabled color. * XPCOLOR_MENUBAR_FACE 41 Menu item text background color. * XPCOLOR_MENUBAR_EXPANDED 42 Hidden menu commands background color. * XPCOLOR_MENUBAR_BORDER 43 Menu border color. * XPCOLOR_MENUBAR_TEXT 44 Menu item text color. * XPCOLOR_HIGHLIGHT_TEXT 45 Menu item selected text color. * XPCOLOR_CHECKED_TEXT 45 Color for text displayed in a checked button. * XPCOLOR_TOOLBAR_TEXT 46 Toolbar text color. * XPCOLOR_PUSHED_TEXT 47 Toolbar pushed text color. * XPCOLOR_TAB_INACTIVE_BACK 48 Inactive tab background color. * XPCOLOR_TAB_INACTIVE_TEXT 49 Inactive tab text color. * XPCOLOR_HIGHLIGHT_PUSHED_BORDER 50 An RGB value that represents the border color *for pushed in 3D elements. XPCOLOR_3DFACE 51 Face color for *three- dimensional display elements and for dialog box backgrounds. XPCOLOR_3DSHADOW 52 Shadow *color for three-dimensional display elements (for edges facing away from the light source). * XPCOLOR_EDITCTRLBORDER 53 Color for the border color of edit controls. * XPCOLOR_FRAME 54 Office 2003 frame color. * XPCOLOR_SPLITTER_FACE 55 Splitter face color. * XPCOLOR_LABEL 56 Color for label control (xtpControlLabel) * XPCOLOR_STATICFRAME 57 Static frame color * XPCOLOR_HIGHLIGHT_DISABLED_BORDER 58 Highlighted disabled border color * XPCOLOR_SHADOW_FACTOR 59 Shadow factor color * XPCOLOR_TOOLBAR_GRAYTEXT 60 Toolbar gray text color * XPCOLOR_FLOATBAR_BORDER 61 Floatbar border color * XPCOLOR_LAST 62 The last color value ** @return * The red, green, blue (RGB) color value of the given element. */ COLORREF GetXtremeColor(UINT nIndex); /** * @brief * Call this member to set the colors for each element to the * color in the specified color array. * @param cElements Number of elements in the array. * @param lpaElements Array of elements. * @param lpaRgbValues Array of RGB values. */ void SetColors(int cElements, CONST INT* lpaElements, CONST COLORREF* lpaRgbValues); public: /** * @brief * This method is called to draw control text. * @param pDC Pointer to a valid device context. * @param pControl Pointer to the control to draw. * @param rcText Bounding rectangle of the text. * @param bDraw TRUE to draw text, FALSE to calculate size. * @param bVert TRUE if text is vertical. * @param bCentered TRUE if text is centered. * @param bTriangled TRUE if triangle drawn. * @return * Size of the text. */ CSize DrawControlText(CDC* pDC, CXTPControl* pControl, CRect rcText, BOOL bDraw, BOOL bVert, BOOL bCentered, BOOL bTriangled); /** * @brief * Determines if a specified font exists in the system. * @param lpszFaceName Font to test. * @return * TRUE if font exists, otherwise FALSE. */ static BOOL AFX_CDECL FontExists(LPCTSTR lpszFaceName); /** * @brief * This member function will search a string, strip off the mnemonic * '&', and reformat the string. * @param strClear Text to strip. * @return */ static void AFX_CDECL StripMnemonics(CString& strClear); public: /** * @brief * This method is called to prepare a caption for Right-To-Left draw. * @param strCaption Caption to modify. */ virtual void UpdateRTLCaption(CString& strCaption); /** * @brief * Call this member function to determine the current Windows XP * theme in use. * @return * A XTPCurrentSystemTheme enumeration that represents the current * Windows XP theme in use; can be one of the following values: * xtpSystemThemeUnknown: Indicates no known theme in use. * xtpSystemThemeBlue: Indicates blue theme in use. * xtpSystemThemeOlive: Indicates olive theme in use. * xtpSystemThemeSilver: Indicates silver theme in use. * @see * SetLunaTheme, RefreshLunaColors */ XTPCurrentSystemTheme GetCurrentSystemTheme(); /** * @brief * Call this method to force system theme. * @param systemTheme Theme to use. Can be any of the values * listed in the Remarks section. * @details * Theme can be one of the following: * xtpSystemThemeUnknown: Disables luna theme support. * xtpSystemThemeBlue: Enables blue theme. * xtpSystemThemeOlive: Enables olive theme. * xtpSystemThemeSilver: Enables silver theme. */ void SetLunaTheme(XTPCurrentSystemTheme systemTheme); /** * @brief * Calculates the gripper of a pop-up bar. * @param pBar Pop-up bar. * @return * Width of gripper to draw. */ virtual int GetPopupBarGripperWidth(CXTPCommandBar* pBar); /** * @brief * Retrieves paint manager used to draw galleries. * @return * Pointer to a CXTPControlGalleryPaintManager object. */ virtual CXTPControlGalleryPaintManager* GetGalleryPaintManager() const; /** * @brief * Retrieves paint manager used to draw scrollbars. * @return * Pointer to a CXTPScrollBarPaintManager object. */ virtual CXTPScrollBarPaintManager* GetScrollBarPaintManager() const; /** * @brief * Retrieves paint manager used to draw slider panes. * @return * Pointer to a CXTPSliderPaintManager object. */ virtual CXTPSliderPaintManager* GetSliderPaintManager() const; /** * @brief * Retrieves paint manager used to draw progress bars. * @return * Pointer to a CXTPProgressPaintManager object. */ virtual CXTPProgressPaintManager* GetProgressPaintManager() const; /** * @brief * Retrieves paint manager used to draw frames. * @return * Pointer to a CXTPFramePaintManager object. */ virtual CXTPFramePaintManager* GetFramePaintManager(); /** * @brief * Retrieves paint manager used to draw the status bar. * @return * Pointer to a CXTPStatusBarPaintManager object. */ virtual CXTPStatusBarPaintManager* GetStatusBarPaintManager(); /** * @brief * Retrieves the ribbon paint manager. * @return * A pointer to a CXTPRibbonPaintManager object. */ virtual CXTPRibbonPaintManager* GetRibbonPaintManager(); /** * @brief * Retrieves paint manager used to draw message bars. * @return * Pointer to a CXTPMessageBarPaintManager object. */ virtual CXTPMessageBarPaintManager* GetMessageBarPaintManager(); /** * @brief * Retrieves shadow manager used to draw shadows. * @return * Pointer to a CXTPShadowManager object. */ CXTPShadowManager* GetShadowManager() const; /** * @brief Determines whether xtpApplicationUseSystemAccentColor application ambient property is * set. * @return TRUE if use of system accent color is required, FALSE otherwise. */ BOOL IsUseSystemAccentColorEnabled() const; /** @cond */ public: _XTP_DEPRECATED_IN_FAVOR2(GetInstanceAddRef, ReleaseInstance) static void AFX_CDECL Done() { } // deprecated. void ShowKeyboardCues(BOOL bShow); CFont* GetIconBoldFont(); virtual void DrawKeyboardTip(CDC* pDC, CXTPCommandBarKeyboardTip* pWnd, BOOL bSetRegion); CSize GetAutoIconSize(BOOL bLarge) const; void FillCompositeRect(CDC* pDC, LPCRECT lpRect, COLORREF clr); static void AFX_CDECL FillCompositeAlpha(CDC* pDC, CRect rc); _XTP_DEPRECATED_IN_FAVOR(DrawControlText) CSize DrawTextEx(CDC*, CString, CRect, BOOL, BOOL, BOOL, BOOL, BOOL = FALSE, BOOL = FALSE) { return CSize(0, 0); } void AlphaEllipse(CDC* pDC, CRect rc, COLORREF clrBorder, COLORREF clrFace); static void AFX_CDECL DrawTextApi(CDC* pDC, const CString& str, LPRECT lpRect, UINT format, BOOL bComposited); CSize DrawControlText2(CDC* pDC, CXTPControl* pControl, CRect rcText, BOOL bDraw, BOOL bVert, BOOL bTrangled); virtual int GetSplitDropDownHeight() const; virtual int GetEditHeight() const; virtual int GetTextHeight() const; virtual int GetFontHeight() const; virtual void SetFontHeight(int nFontHeight); virtual int GetTabsHeight() const; static BOOL IsDpiBitmapScalingEnabled(CXTPControl* pControl); static BOOL IsDpiBitmapScalingEnabled(CXTPCommandBar* pCommandBar); static BOOL IsDpiBitmapScalingEnabled(CXTPCommandBars* pCommandBars); static CSize AdjustDpiIconSize(CXTPImageManagerIcon* pIcon, CSize szIcon, CXTPControl* pControl, CSize szAvailable); static CSize AdjustDpiIconSize(CXTPImageManagerIcon* pIcon, CSize szIcon, CXTPCommandBar* pCommandBar, CSize szAvailable, CSize szMargin = CSize(0, 0)); static CSize AdjustDpiIconSize(CXTPImageManagerIcon* pIcon, CSize szIcon, CXTPCommandBars* pCommandBars, CSize szAvailable, CSize szMargin = CSize(0, 0)); static CSize AdjustDpiIconSize(CXTPImageManagerIcon* pIcon, CSize szIcon, CSize szAvailable, BOOL bScaleDpi, CSize szMargin = CSize(0, 0)); virtual BOOL IsPopupRoundedCorners(CPoint& pt); protected: virtual BOOL IsFlatToolBar(CXTPCommandBar* pCommandBar); void AlphaBlendU(PBYTE pDest, PBYTE pSrcBack, int cx, int cy, PBYTE pSrc, BYTE byAlpha); void _DrawCheckMark(CDC* pDC, CRect rcCheck, COLORREF clr = 0, BOOL bLayoutRTL = FALSE); void DrawControlText3(CDC* pDC, CXTPControl* pControl, const CString& str, const CString& strClear, CRect rcText, BOOL bVert, BOOL bCentered); void SplitString(const CString& str, CString& strFirstRow, CString& strSecondRow); virtual CSize DrawControlText(CDC* pDC, CXTPControl* pButton, CRect rcText, BOOL bDraw, BOOL bTriangled, CSize szImage, BOOL bDrawImage); CSize GetControlSize(CXTPControl* pControl, CSize sz, BOOL bVert); virtual CSize GetPopupBarImageSize(CXTPCommandBar* pBar); virtual void DrawPopupBarText(CDC* pDC, const CString& strText, CRect& rcText, UINT nFlags, BOOL bDraw, BOOL bSelected, BOOL bEnabled); CSize GetIconSize(CXTPControl* pControl) const; static CSize GetStretchIconSize(CXTPImageManagerIcon* pIcon, CSize szIcon); static int AFX_CDECL CalcEntityHeight(int nFontHeight, int nFactor, int nMinHeight = XTP_COMMANDBAR_MIN_CONTROL_HEIGHT, int nCustomDPI = 0); static int AFX_CDECL CalcTextHeight(int nFontHeight, int nFactor = XTP_COMMANDBAR_TEXT_HEIGHT_FACTOR, int nCustomDPI = 0); static int AFX_CDECL CalcCtrlHeight(int nFontHeight, int nFactor = XTP_COMMANDBAR_CONTROL_HEIGHT_FACTOR, int nCustomDPI = 0); static int AFX_CDECL CalcSplitButtonDropDownWidth(int nTextHeight); static int AFX_CDECL CalcSplitButtonDropDownHeight(int nFontHeight); XTPPrimitiveSymbol GetControlSymbol(XTPBarPosition barPosition, BOOL bVert) const; /** @endcond */ /** * @brief * Call this method to get the pointer to the global paint manager. * @return * If the global paint manager is set, then the pointer to the global * paint manager will be returned. If no global paint manager * is set, then a NULL value will be returned. * @see * SetGlobalPaintManager, XTPPaintManager */ static CXTPPaintManager* AFX_CDECL GetGlobalPaintManager(); /** * @brief * Call this method to set the pointer to the global paint manager. * @param pPaintManager A new global paint manager pointer. * @return * @see * GetGlobalPaintManager, XTPPaintManager */ static void AFX_CDECL SetGlobalPaintManager(CXTPPaintManager* pPaintManager); public: // Combobox / Edit-box public: CXTPPaintManagerColor m_clrEditTextNormal; CXTPPaintManagerColor m_clrEditTextDisabled; CXTPPaintManagerColor m_clrEditTextHighlighted; // Message bar public: COLORREF m_clrMessageBarText; /**< Message bar text color. */ CRect m_rcMessageBarMargin; /**< Margin of the message bar. */ // Paint manager public: CXTPFramePaintManager* m_pFramePaintManager; /**< Frame paint manager. */ CXTPStatusBarPaintManager* m_pStatusBarPaintManager; /**< Paint manager of the status bar. */ CXTPRibbonPaintManager* m_pRibbonPaintManager; /**< Ribbon paint Manager. */ CXTPControlGalleryPaintManager* m_pGalleryPaintManager; /**< Gallery paint manager. */ CXTPProgressPaintManager* m_pProgressPaintManager; /**< Progress bar paint manager. */ CXTPSliderPaintManager* m_pSliderPaintManager; /**< Slider pane paint manager. */ CXTPScrollBarPaintManager* m_pScrollBarPaintManager; /**< Scrollbar paint manager. */ CXTPMessageBarPaintManager* m_pMessageBarPaintManager; public: CXTPPaintManagerColorGradient m_clrDisabledIcon; /**< Disabled icons color. */ CXTPPaintManagerColor m_clrFloatingGripper; /**< Gripper color of floating toolbar. */ CXTPPaintManagerColor m_clrFloatingGripperText; /**< Gripper text color of floating toolbar. */ BOOL m_bThickCheckMark; /**< TRUE to draw thick check mark. */ BOOL m_bShowShadow; /**< TRUE to show shadow. */ BOOL m_bThemedStatusBar; /**< TRUE to draw status bar using WinXP theme. */ BOOL m_bThemedCheckBox; /**< TRUE to draw check box using WinXP theme. */ BOOL m_bClearTypeTextQuality; /**< TRUE to enable ClearType text for the font. */ BOOL m_bFlatToolBar; /**< TRUE to draw toolbars flat. */ BOOL m_bFlatMenuBar; /**< TRUE to draw menubar flat. */ int m_nPopupBarTextPadding; /**< Distance between gripper and control text. */ BOOL m_bSelectImageInPopupBar; /**< TRUE to select image as in explorer theme. */ BOOL m_bEnableAnimation; /**< TRUE to enable animation for all toolbars. */ BOOL m_bOffice2007Padding; /**< TRUE if Office2007 metrics used. */ BOOL m_bOffsetPopupLabelText; /**< TRUE if labels in pop-ups drawn with offset. */ BOOL m_bWrapCaptionBelowText; /**< Wrap text for xtpButtonIconAndCaptionBelow buttons. */ CXTPPaintManagerFont m_fontSmCaption; /**< Small caption font. */ CXTPPaintManagerFont m_fontIcon; /**< Icon font. */ CXTPPaintManagerFont m_fontIconBold; /**< Icon bold font. */ CXTPPaintManagerFont m_fontToolTip; /**< Tooltip font. */ int m_nSplitButtonDropDownWidth; /**< Split button drop down width in toolbars. */ int m_nSplitButtonDropDownHeight; /**< Split button drop down height in toolbars. */ int m_nSplitButtonPopupWidth; /**< Split button drop down width in pop-ups. */ BOOL m_bAutoResizeIcons; /**< TRUE to automatically resize icons using current DPI. */ int m_nStatusBarMinHeight; /**< Minimum height for the status bar. */ PVOID m_pfnSetLayeredWindowAttributes; /**< point to Transparency proc in USER32.dll module. */ CRect m_rcStatusBarBorder; /**< Bounding rectangle of the status bar border. */ BOOL m_bUseOfficeFont; /**< TRUE to use Tahoma font. */ CString m_strOfficeFont; /**< Office font. */ int m_nTextHeight; /**< Regular text field height (not font height). */ protected: CXTPFont m_xtpFontRegular; /**< Regular font. */ CXTPFont m_xtpFontRegularBold; /**< Regular bold font. */ CXTPFont m_xtpFontVert; /**< Vertical font. */ CXTPFont m_xtpFontVertBold; /**< Vertical font. */ XTP_SUBSTITUTE_GDI_MEMBER_WITH_CACHED(CFont, m_fontRegular, m_xtpFontRegular, GetRegularFontHandle); XTP_SUBSTITUTE_GDI_MEMBER_WITH_CACHED(CFont, m_fontRegularBold, m_xtpFontRegularBold, GetRegularBoldFontHandle); XTP_SUBSTITUTE_GDI_MEMBER_WITH_CACHED(CFont, m_fontVert, m_xtpFontVert, GetVertFontHandle); XTP_SUBSTITUTE_GDI_MEMBER_WITH_CACHED(CFont, m_fontVertBold, m_xtpFontVertBold, GetVertBoldFontHandle); int m_nEditHeight; /**< Edit text height. */ int m_nFontHeight; /**< Custom font height (optional). */ BOOL m_bUseStandardFont; /**< TRUE to use system font. */ BOOL m_bEmbossedDisabledText; /**< TRUE to draw disabled text embossed. */ CXTPWinThemeWrapper* m_themeStatusBar; /**< StatusBar theme helper. */ CXTPWinThemeWrapper* m_themeButton; /**< Buttons theme helper. */ XTPPaintTheme m_themeCurrent; /**< Current theme. */ /** @cond */ _XTP_DEPRECATED_IN_FAVOR2(GetGlobalPaintManager, SetGlobalPaintManager) static CXTPPaintManager* s_pInstance; /**< Instance of the manager. */ /** @endcond */ XTP_COMMANDBARS_ICONSINFO m_iconsInfo; /**< Specific icons options. */ int m_nAnimationSteps; /**< Steps of the animation. */ int m_nAnimationTime; /**< Time of the animation. */ BOOL m_bShowKeyboardCues; /**< TRUE to show keyboard cues - deprecated. */ CXTPPaintManagerColor m_arrColor[XPCOLOR_LAST + 1]; /**< Self colors array. */ XTPCurrentSystemTheme m_systemTheme; /**< Current system theme. */ CXTPShadowManager* m_pShadowManager; /**< Shadow manager */ protected: /** * @brief * Constructs a CXTPPaintManager object. */ CXTPPaintManager(); /** * @brief * Destroys a CXTPPaintManager object, handles cleanup and deallocation. */ virtual ~CXTPPaintManager(); public: /** * @brief * CLogFont is a self initializing LOGFONT derived class. It * will allow you to create or copy a LOGFONT object, and defines the * attributes of a font. */ struct _XTP_EXT_CLASS CLogFont : public LOGFONT { /** * @brief * Constructs a CLogFont object. */ CLogFont(); }; /** @cond */ _XTP_DEPRECATED_IN_FAVOR(CXTPNonClientMetrics) typedef CXTPNonClientMetrics CNonClientMetrics; /** @endcond */ # ifdef _XTP_COMMANDBARS_ACTIVEX /** @cond */ // x64 #ifdef below is a fix for OLE_HANDLE. While HBITMAP/HICON are still 32-bit on 64-bit // Windows, OLE_HANDLE (long) can still be used. But OLE_HANDLE cannot be used as HMODULE which // is always 64-bit # ifndef _WIN64 # define MODULE_HANDLE OLE_HANDLE # define MODULE_HANDLE_TYPE VTS_I4 # else # define MODULE_HANDLE LONG64 # define MODULE_HANDLE_TYPE VTS_I8 # endif DECLARE_DISPATCH_MAP() DECLARE_OLETYPELIB_EX(CXTPPaintManager); DECLARE_INTERFACE_MAP() void OleLoadFrameIcon(MODULE_HANDLE Module, LPCTSTR pszFileName, long Width, long Height); void OleRefreshMetrics(); void OleFillWorkspace(OLE_HANDLE hDC, int x, int y, int cx, int cy); void OleDrawRectangle(OLE_HANDLE hDC, int x, int y, int cx, int cy, BOOL bSelected, BOOL bPressed, BOOL bEnabled, BOOL bChecked, BOOL bPopuped, XTPBarType barType, XTPBarPosition barPosition); COLORREF OleGetRectangleTextColor(BOOL bSelected, BOOL bPressed, BOOL bEnabled, BOOL bChecked, BOOL bPopuped, XTPBarType barType, XTPBarPosition barPosition); /** @endcond */ # endif friend class CCommandBarsCtrl; friend class CXTPCommandBarsOptions; friend class CXTPCommandBars; friend class CXTPRibbonPaintManager; friend class CXTPStatusBarPaintManager; friend class CXTPStatusBarThemeVisualStudio2010; friend class CXTPStatusBarThemeOffice2003; }; /** * @brief * Call this function to access CXTPPaintManager members. * Since this class is designed as a single instance object you can * only access version info through this method. You cannot * directly instantiate an object of type CXTPPaintManager. * If no global paint manager has been previously set, the function * enables and sets a default paint manager that corresponds to xtpThemeOffice2000. * @details * Implementers of custom themes or other classes that access a global * paint manager by a call to XTPPaintManager() must ensure they increment * global paint manager's reference counter before making the call to XTPPaintManager() * by calling CXTPPaintManager::GetInstanceAddRef(), and then decrement * its reference counter by calling CXTPPaintManager::ReleaseInstance(). * The natural places for those steps are constructors and destructor * of a class from which a call to XTPPaintManager() is to be made. * @return * A pointer to the only instance of CXTPPaintManager object. * * Example: *
XTPPaintManager()->GetIconsInfo()->bIconsWithShadow = FALSE;*/ _XTP_EXT_CLASS CXTPPaintManager* AFX_CDECL XTPPaintManager(); /** * @brief * The CXTPReBarPaintManager template class is used to enable a * ReBar theme for Command Bars. * @see * CXTPPaintManager::SetTheme */ template