/** * @file XTPDockingPanePaintManager.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(__XTPDOCKINGPANEPAINTMANAGER_H__) # define __XTPDOCKINGPANEPAINTMANAGER_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPTabPaintManager; class CXTPDockingPane; class CXTPDockingPaneBase; class CXTPDockingPaneTabbedContainer; class CXTPDockingPaneMiniWnd; class CXTPDockingPaneSplitterWnd; class CXTPDockingPaneCaptionButton; class CXTPDockingPaneCaptionButtons; class CXTPDockingPaneSidePanel; class CXTPWinThemeWrapper; /** * @brief * CXTPDockingPaneTabPaintManager is a CXTPTabPaintManager derived * class that is used to store the color and appearance information * of the tabs in the tab manager. */ class _XTP_EXT_CLASS CXTPDockingPaneTabPaintManager : public CXTPTabPaintManager { public: /** * @brief * Call this member to apply one of the "built-in" color sets to * the tabs. * @param tabColor An XTPTabColorStyle to apply to the tabs. * @return * A pointer to the CXTPTabPaintManagerColorSet object applied. * @see * XTPTabColorStyle, SetColorSet, GetColor, GetColorSet, * XTPTabAppearanceStyle, SetAppearanceSet, SetAppearance, * GetAppearance, GetAppearanceSet */ virtual CXTPTabPaintManagerColorSet* SetColor(XTPTabColorStyle tabColor); /** * @brief * Call this member to apply one of the "built-in" appearances to * the tabs. * @param tabAppearance An XTPTabAppearanceStyle to apply to the tabs. * @return * A pointer to the CXTPTabPaintManagerTheme object applied. * @details * Use SetAppearance to apply a "Built-In" theme. To apply a * custom theme, use the SetAppearanceSet member. * @see * XTPTabAppearanceStyle, SetAppearanceSet, GetAppearance, * GetAppearanceSet, SetColor, GetColor, GetColorSet, SetColorSet */ virtual CXTPTabPaintManagerTheme* SetAppearance(XTPTabAppearanceStyle tabAppearance); }; /** * @brief * CXTPDockingPanePanelPaintManager is a CXTPTabPaintManager derived * class that is used to store the color and appearance information * of the tabs in the tab manager. */ class _XTP_EXT_CLASS CXTPDockingPanePanelPaintManager : public CXTPTabPaintManager { public: /** * @brief * Call this member to apply one of the "built-in" color sets to * the tabs. * @param tabColor An XTPTabColorStyle to apply to the tabs. * @return * A pointer to the CXTPTabPaintManagerColorSet object applied. * @see * XTPTabColorStyle, SetColorSet, GetColor, GetColorSet, * XTPTabAppearanceStyle, SetAppearanceSet, SetAppearance, * GetAppearance, GetAppearanceSet */ virtual CXTPTabPaintManagerColorSet* SetColor(XTPTabColorStyle tabColor); /** * @brief * Call this member to apply one of the "built-in" appearances to * the tabs. * @param tabAppearance An XTPTabAppearanceStyle to apply to the tabs. * @return * A pointer to the CXTPTabPaintManagerTheme object applied. * @details * Use SetAppearance to apply a "Built-In" theme. To apply a * custom theme, use the SetAppearanceSet member. * @see * XTPTabAppearanceStyle, SetAppearanceSet, GetAppearance, * GetAppearanceSet, SetColor, GetColor, GetColorSet, SetColorSet */ virtual CXTPTabPaintManagerTheme* SetAppearance(XTPTabAppearanceStyle tabAppearance); }; /** * @brief * Enumeration of the pin button state. * @see * CXTPDockingPaneCaptionButton::GetState, * CXTPDockingPaneCaptionButton::SetState, * xtpPanePinVisible, xtpPanePinPushed */ enum XTPDockingPanePinState { xtpPanePinVisible = 1, /**< Pin button is visible.*/ xtpPanePinPushed = 2 /**< Pin button is pushed.*/ }; /** * @brief * Enumeration of the splitter styles. * * Example: * m_paneManager.GetPaintManager()->SetSplitterStyle(xtpPaneSplitterSoft3D + * xtpPaneSplitterGripperOffice2003); * @see * CXTPDockingPanePaintManager::SetSplitterStyle, * xtpPaneSplitterFlat, xtpPaneSplitter3D, xtpPaneSplitterSoft3D, * xtpPaneSplitterGripperOfficeXP, xtpPaneSplitterGripperOffice2003 */ enum XTPDockingPaneSplitterStyle { xtpPaneSplitterFlat = 0, /**< Flat splitter style. */ xtpPaneSplitter3D = 1, /**< 3D splitter style. */ xtpPaneSplitterSoft3D = 2, /**< Soft splitter style. */ xtpPaneSplitterGradient = 4, /**< Gradient splitter style. */ xtpPaneSplitterGradientVert = 8, /**< Gradient splitter style. */ xtpPaneSplitterGripperOfficeXP = 0x100, /**< Splitter has an Office XP gripper. */ xtpPaneSplitterGripperOffice2003 = 0x200 /**< Splitter has an Office 2003 gripper.*/ }; /** * @brief * Enumeration of the caption button styles. * * Example: * m_paneManager.GetPaintManager()->SetCaptionButtonStyle(xtpPaneCaptionButtonThemedExplorerBar); * @see * CXTPDockingPanePaintManager::SetCaptionButtonStyle */ enum XTPDockingPaneCaptionButtonStyle { xtpPaneCaptionButtonDefault, /**< Default caption button style. */ xtpPaneCaptionButtonOffice, /**< Office XP caption button style. */ xtpPaneCaptionButtonOffice2003, /**< Office 2003 caption button style.*/ xtpPaneCaptionButtonThemedExplorerBar, /**< Explorer button style. */ xtpPaneCaptionButtonThemedButton, /**< Windows XP Button style. */ xtpPaneCaptionButtonThemedToolBar, /**< Windows XP Toolbar style. */ xtpPaneCaptionButtonThemedToolWindow, /**< Window XP Tool Window style. */ }; _XTP_EXT_CLASS void AFX_CDECL XTPDeflateRectDirection(CRect& rc, int left, int top, int right, int bottom, BOOL bVertical); _XTP_EXT_CLASS int AFX_CDECL XTPGetRectDirectionHeight(const CRect& rc, BOOL bVertical); _XTP_EXT_CLASS void AFX_CDECL XTPFillFramePartRect(CDC* pDC, CRect rc, CWnd* pWnd, CWnd* pParentFrame, const CXTPPaintManagerColorGradient& clrHeaderFace, BOOL bHoriz); /** * @brief * CXTPDockingPanePaintManager is a standalone class. * Override some virtual functions to get a new visual theme. */ class _XTP_EXT_CLASS CXTPDockingPanePaintManager : public CXTPCmdTarget { protected: /** * @brief * Constructs a CXTPDockingPanePaintManager object. */ CXTPDockingPanePaintManager(); /** * @brief * Destroys a CXTPDockingPanePaintManager object, handles cleanup * and deallocation. */ virtual ~CXTPDockingPanePaintManager(); public: /** * @brief * Override this member function to draw a tabbed container. * @param pDC Reference to the device context in which to draw. * @param pPane Pointer to the tabbed container. * @param rc Client rectangle of the tabbed container. */ virtual void DrawPane(CDC* pDC, CXTPDockingPaneTabbedContainer* pPane, CRect rc); /** * @brief * Override this member function to draw the side panel. * @param pDC Reference to the device context in which to draw. * @param pPane Pointer to the side panel. * @param rc Client rectangle of the side panel. */ virtual void DrawSidePanel(CDC* pDC, CXTPDockingPaneSidePanel* pPane, CRect rc); /** * @brief * Call this method to get the pane's caption rectangle. * @param pPane Side panel container to get caption CRect. * @return * Bounding rectangle of the side panel's caption. */ virtual CRect GetPaneCaptionRect(const CXTPDockingPaneSidePanel* pPane); /** * @brief * Call this method to draw the frame of a floating window. * @param pDC Pointer to a valid device context. * @param pPane Floating window pointer. * @param rc Client rectangle of the floating frame. */ virtual void DrawFloatingFrame(CDC* pDC, CXTPDockingPaneMiniWnd* pPane, CRect rc); /** * @brief * Override this method to draw a splitter. * @param pDC Pointer to a valid device context. * @param pSplitter Pointer to a splitter window. */ virtual void DrawSplitter(CDC* pDC, CXTPDockingPaneSplitterWnd* pSplitter); /** * @brief * Override this member function to draw a caption. * @param pDC Reference to the device context in which to draw. * @param pPane Pointer to the tabbed container. * @param rc Client rectangle of the tabbed container. */ virtual void DrawCaption(CDC* pDC, CXTPDockingPaneTabbedContainer* pPane, CRect rc) = 0; /** * @brief * Override this member function to draw buttons for a tabbed caption. * @param pDC Pointer to a valid device context. * @param pButtons Pointer to a collection of buttons to draw. * @param rcCaption Caption rectangle. * @param clr Color of the buttons' text. * @param nButtonSize Size of the buttons. * @param nButtonGap Distance between buttons. * @param bVertical TRUE if the caption is drawn vertically. */ virtual void DrawCaptionButtons(CDC* pDC, CXTPDockingPaneCaptionButtons* pButtons, CRect& rcCaption, COLORREF clr, int nButtonSize, int nButtonGap, BOOL bVertical = FALSE); /** * @brief * Override this member function to draw a button for a tabbed caption. * @param pDC Pointer to a valid device context. * @param pButton Pointer to the button to draw. * @param clrButton Color of the button's text. */ virtual void DrawCaptionButton(CDC* pDC, CXTPDockingPaneCaptionButton* pButton, COLORREF clrButton); /** * @brief * This method is called to refresh the visual metrics of the manager. */ virtual void RefreshMetrics(); /** * @brief * Override this member to change the client rectangle of the child * docking pane. * @param pPane Pointer to the tabbed container or side panel. * @param rect Client rectangle to be changed. */ virtual void AdjustClientRect(CXTPDockingPaneSidePanel* pPane, CRect& rect); /** * @brief * Override this member to change the client rectangle of the child * docking pane. * @param pPane Pointer to the tabbed container or side panel. * @param rect Client rectangle to be changed. * @param bApply TRUE to update tabs inside the client area. */ virtual void AdjustClientRect(CXTPDockingPaneTabbedContainer* pPane, CRect& rect, BOOL bApply); /** * @brief * Override this member to change the caption rectangle of the child * docking pane. * @param pPane Pointer to a CXTPDockingPaneTabbedContainer object * or CXTPDockingPaneSidePanel object. * @param rc Caption rectangle to be changed. */ virtual void AdjustCaptionRect(const CXTPDockingPaneSidePanel* pPane, CRect& rc); /** * @brief * Override this member to change the caption rectangle of the child * docking pane. * @param pPane Pointer to a CXTPDockingPaneTabbedContainer object * or CXTPDockingPaneSidePanel object. * @param rc Caption rectangle to be changed. */ virtual void AdjustCaptionRect(const CXTPDockingPaneTabbedContainer* pPane, CRect& rc); /** * @brief * Call this method to get a caption rectangle. * @param pPane Tabbed container to get caption CRect. * @param rc Caption rectangle to store caption CRect. */ virtual void GetCaptionRect(const CXTPDockingPaneTabbedContainer* pPane, CRect& rc); /** * @brief * Call this method to get a caption gripper for a tabbed container. * @param pPane Tabbed container to test. * @return * Bounding rectangle of the gripper to set the size cursor. */ virtual CRect GetCaptionGripperRect(const CXTPDockingPaneTabbedContainer* pPane); public: /** * @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 color used to paint the line. */ void Line(CDC* pDC, int x0, int y0, int x1, int y1, 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. */ void Line(CDC* pDC, int x0, int y0, int x1, int y1); /** * @brief * Draws the text of a pane caption. * @param pDC Reference to a valid device context. * @param strTitle Text to draw in the caption. * @param rc Client rectangle of the tabbed container. * @param bVertical TRUE to draw the caption vertically. * @param bCalcWidth TRUE to calculate width. * @return * The width of the text that was drawn in the pane caption bar. */ int DrawCaptionText(CDC* pDC, const CString& strTitle, CRect rc, BOOL bVertical, BOOL bCalcWidth = FALSE); /** * @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 * Draws a rectangle. * @param pDC Pointer to a valid device context. * @param rc Specifies the rectangle in logical units. * @param nPenEntry Specifies the color used to paint the rectangle. * @param nPenBorder Specifies the color used to fill the rectangle. */ void Rectangle(CDC* pDC, CRect rc, int nPenEntry, int nPenBorder); /** * @brief * Call this member to use Office (Tahoma) font. * @param bUseOfficeFont TRUE to use Office font. */ void UseOfficeFont(BOOL bUseOfficeFont); /** * @brief * Call this method to set the caption's font. * @param pLogFont LOGFONT to be set for the caption. * @param bUseStandardFont Must be FALSE. */ void SetCaptionFontIndirect(LOGFONT* pLogFont, BOOL bUseStandardFont = FALSE); /** * @brief * Call this method to set the paint manager used to draw tabs of a * tabbed container. * @param pManager New CXTPTabPaintManager pointer. * @return * A pointer to the CXTPTabPaintManager that will be used. * @see * GetTabPaintManager, SetPanelPaintManager */ CXTPTabPaintManager* SetTabPaintManager(CXTPTabPaintManager* pManager); /** * @brief * Call this method to set the paint manager used to draw tabs of an * auto-hide panel. * @param pManager New CXTPTabPaintManager pointer. * @return * A pointer to the CXTPTabPaintManager that will be used. * @see * GetPanelPaintManager, SetTabPaintManager */ CXTPTabPaintManager* SetPanelPaintManager(CXTPTabPaintManager* pManager); /** * @brief * Retrieves the paint manager used to draw tabs of a tabbed container. * @return * A pointer to the CXTPTabPaintManager used to draw tabs of a tabbed * container. * @see * SetTabPaintManager, GetPanelPaintManager */ CXTPTabPaintManager* GetTabPaintManager() const; /** * @brief * Retrieves the paint manager used to draw tabs of an auto-hide panel. * @return * A pointer to the CXTPTabPaintManager used to draw tabs of an * auto-hide panel. * @see * SetPanelPaintManager, GetTabPaintManager */ CXTPTabPaintManager* GetPanelPaintManager() const; /** * @brief * Retrieves the current color of the specified XP display element. * @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 * 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. *
	 * 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 in an array to * the colors in a specified color array. * @param cElements Number of elements in the array. * @param lpaElements Array of elements. * @param lpaRgbValues Array of RGB values. * @see * SetColor */ void SetColors(int cElements, CONST INT* lpaElements, CONST COLORREF* lpaRgbValues); /** * @brief * Call this member to get the caption height of the tabbed container. * @return * The caption height of the tabbed container. * @see * GetTabsHeight */ int GetCaptionHeight() const; /** * @brief * Call this member to get tabs height of the tabbed container. * @return * The tabs height of the tabbed container. * @see * GetCaptionHeight */ int GetTabsHeight() const; /** * @brief * Call this member to set the splitter style. * @param dwStyle New style to be used for splitters. * @details * dwStyle parameter can be one or more of the following: * xtpPaneSplitterFlat * xtpPaneSplitter3D * xtpPaneSplitterSoft3D * xtpPaneSplitterGripperOfficeXP * xtpPaneSplitterGripperOffice2003 * * Example: * m_paneManager.GetPaintManager()->SetSplitterStyle(xtpPaneSplitterSoft3D + * xtpPaneSplitterGripperOffice2003); */ void SetSplitterStyle(DWORD dwStyle); /** * @brief * Call this method to get the splitter style. * @return * The style used for splitters. * @see * XTPDockingPaneSplitterStyle, SetSplitterStyle */ DWORD GetSplitterStyle() const; /** * @brief * Call this member to set the caption button style. * @param nStyle New style to be used for caption buttons. * @details * dwStyle parameter can be one or more of the following: * xtpPaneCaptionButtonDefault * xtpPaneCaptionButtonOffice * xtpPaneCaptionButtonOffice2003 * xtpPaneCaptionButtonThemeExplorerBar * xtpPaneCaptionButtonThemeButton * xtpPaneCaptionButtonThemeToolBar * * Example: * m_paneManager.GetPaintManager()->SetCaptionButtonStyle(xtpPaneCaptionButtonOffice2003); * @see * XTPDockingPaneCaptionButtonStyle, GetCaptionButtonStyle */ void SetCaptionButtonStyle(XTPDockingPaneCaptionButtonStyle nStyle); /** * @brief * Call this method to get the caption button style. * @return * The style used for caption buttons. * @see * XTPDockingPaneCaptionButtonStyle, SetCaptionButtonStyle */ XTPDockingPaneCaptionButtonStyle GetCaptionButtonStyle() const; /** * @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() const; /** * @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 * This mmethod is called by the framework to draw the docking pane * auto-hide panel background and splitter. * @param pDC Pointer to the auto-hide pane's device context. * @param rc Size of the area to draw. * @param direction Docking direction (either xtpPaneDockLeft, xtpPaneDockRight, * xtpPaneDockTop, or xtpPaneDockBottom). */ virtual void DrawAutoHidePanel(CDC* pDC, CRect rc, XTPDockingPaneDirection direction); /** * @brief * Sets custom title brushes. * @param hbrActiveTitleHorz Active horizontal title brush handle. NULL to * use default title background drawing. * @param hbrInactiveTitleHorz Inactive horizontal title brush handle. NULL to * use hbrActiveTitleHorz value. * @param hbrActiveTitleVert Active horizontal title brush handle. NULL to * use hbrActiveTitleHorz value. * @param hbrInactiveTitleVert Inactive horizontal title brush handle. NULL to * use hbrInactiveTitleHorz value. * @param bDestroyOnCleanup If TRUE, then brushes will be destroyed on cleanup. */ void SetCustomTitleBrushes(HBRUSH hbrActiveTitleHorz, HBRUSH hbrInactiveTitleHorz = NULL, HBRUSH hbrActiveTitleVert = NULL, HBRUSH hbrInactiveTitleVert = NULL, BOOL bDestroyOnCleanup = FALSE); /** * @brief * Obtains the custom title brush. * @param bActive Determines whether to obtain the active or inactive * title brush. * @param bVertical Determines whether to obtain the vertical or horizontal * title brush. * @return * The custom title brush. */ HBRUSH GetCustomTitleBrush(BOOL bActive, BOOL bVertical) const; protected: /** * @brief * Draws only the glyph of a button. For example, the cross of a Close Button. * @param pDC Pointer to the device context in which to draw. * @param pButton Pointer to the button to draw. * @param clrButton Color of glyph. * @param szOffset Glyph offset. */ virtual void DrawCaptionButtonEntry(CDC* pDC, CXTPDockingPaneCaptionButton* pButton, COLORREF clrButton, CSize szOffset); /** * @brief * Draws only the glyph of a button. For example, the cross of a Close Button. * @param pDC Pointer to the device context in which to draw. * @param pButton Pointer to the button to draw. * @param pt Glyph center point. * @param clrButton Color of glyph. */ virtual void DrawCaptionButtonEntry(CDC* pDC, CXTPDockingPaneCaptionButton* pButton, CPoint pt, COLORREF clrButton); /** * @brief * Clip string and add ellipsis if its width less than nCaptionWidth. * @param pDC Pointer to the device context in which to draw. * @param strTitle Text to process. * @param nCaptionWidth Caption width. * @details * DT_END_ELLIPSIS doesn't work with rotated text. * @see * DrawCaptionText */ void ClipAndAddEllipsisIfNeeded(CDC* pDC, CString& strTitle, int nCaptionWidth) const; /** @cond */ void DrawCaptionIcon(CDC* pDC, CXTPDockingPaneBase* pPane, CRect& rcCaption, BOOL bVertical); public: static CXTPDockingPane* AFX_CDECL GetSelectedPane(CXTPDockingPaneBase* pPane); BOOL IsCaptionEnabled(CXTPDockingPaneBase* pPane); /** @endcond */ public: BOOL m_bUseBoldCaptionFont; /**< TRUE to use bold font for caption. */ BOOL m_bHighlightActiveCaption; /**< TRUE to highlight active caption. */ int m_nSplitterSize; /**< Splitter size. */ BOOL m_bShowCaption; /**< TRUE to draw captions of tabbed containers. */ BOOL m_bDrawSingleTab; /**< TRUE to draw single tab. */ BOOL m_bDrawCaptionIcon; /**< TRUE to draw caption icon. */ BOOL m_bAutoHidePanelHighlightSelected; int m_nSplitterIndent; /**< Size of splitter indent. */ CXTPPaintManagerColor m_clrBackground; /**< Background color. */ CXTPPaintManagerColor m_clrSplitterGripper; /**< Splitter gripper color. */ CXTPPaintManagerColor m_clrSplitter; /**< Splitter color. */ CXTPPaintManagerColorGradient m_clrSplitterGradient; /**< Splitter gradient color. */ CXTPPaintManagerColorGradient m_clrNormalCaption; /**< Color of pane caption when inactive. */ CXTPPaintManagerColorGradient m_clrActiveCaption; /**< Color of pane caption when active. */ CXTPPaintManagerColor m_clrNormalCaptionText; /**< Color of pane caption text when the caption is inactive. */ CXTPPaintManagerColor m_clrActiveCaptionText; /**< Active caption text. */ CXTPPaintManagerColor m_clrDisabledCaptionText; /**< Disabled caption text. */ protected: XTPDockingPaneCaptionButtonStyle m_nCaptionButtonStyle; /**< Caption button style. */ DWORD m_dwSplitterStyle; /**< Splitter style. */ int m_nTitleHeight; /**< Title's height. */ int m_nCaptionFontGap; /**< Additional gap of font. */ int m_nTabsHeight; /**< Tab bar's height. */ CXTPFont m_xtpFontTitle; /**< Title font. */ CXTPFont m_xtpFontTitleVertical; /**< Title vertical font. */ XTP_SUBSTITUTE_GDI_MEMBER_WITH_CACHED(CFont, m_fntTitle, m_xtpFontTitle, GetTitleFontHandle); XTP_SUBSTITUTE_GDI_MEMBER_WITH_CACHED(CFont, m_fntTitleVertical, m_xtpFontTitleVertical, GetVerticalTitleFontHandle); BOOL m_bUseOfficeFont; /**< TRUE to use Tahoma font. */ BOOL m_bUseStandardFont; /**< TRUE to use system icon font. */ BOOL m_bDestroyCustomTitleBrushes; /**< If TRUE, custom title bushes will be destroyed on cleanup. */ HBRUSH m_hbrActiveTitleHorz; /**< Optional user specified active horizontal title brush. */ HBRUSH m_hbrInactiveTitleHorz; /**< Optional user specified inactive horizontal title brush. */ HBRUSH m_hbrActiveTitleVert; /**< Optional user specified active vertical title brush. */ HBRUSH m_hbrInactiveTitleVert; /**< Optional user specified inactive vertical title brush. */ protected: CXTPTabPaintManager* m_pTabPaintManager; /**< Paint Manager used to draw tabs for a tabbed container. */ CXTPTabPaintManager* m_pPanelPaintManager; /**< Paint Manager used to draw tabs for an auto-hide panel. */ COLORREF m_arrColor[XPCOLOR_LAST + 1]; /**< Self colors array. */ XTPDockingPanePaintTheme m_themeCurrent; /**< Current theme. */ CString m_strOfficeFont; /**< Office font name. */ CRect m_rcCaptionMargin; /**< Margins of caption. */ XTPCurrentSystemTheme m_systemTheme; /**< Current system theme. */ CXTPWinThemeWrapper* m_themeToolbar; /**< Toolbar theme helper */ CXTPWinThemeWrapper* m_themeExplorer; /**< WinXP Explorer theme helper */ CXTPWinThemeWrapper* m_themeButton; /**< WinXP Button theme helper */ CXTPWinThemeWrapper* m_themeWindow; /**< WinXP Window Theme helper. */ CXTPWinThemeWrapper* m_themeRebar; /**< Rebar theme helper */ BOOL m_bLunaTheme; /**< TRUE if luna colors are used. */ private: friend class CXTPDockingPaneManager; # ifdef _XTP_ACTIVEX /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPDockingPanePaintManager); LPFONTDISP OleGetFont(); void OleSetFont(LPFONTDISP pFontDisp); BOOL OleGetUseCustomTitleColors(); void OleSetUseCustomTitleColors(BOOL fUse); void OleSetCustomTitleColors(OLE_COLOR clrActiveHorz, OLE_COLOR clrInactiveHorz, OLE_COLOR clrActiveVert, OLE_COLOR clrInactiveVert); OLE_COLOR OleGetCustomTitleColor(BOOL fActive, BOOL fVert); COLORREF OleGetSplitterColor(); void OleSetSplitterColor(OLE_COLOR clr); void OleRefreshMetrics(); BOOL m_bAxUseCustomTitleColors; OLE_COLOR m_clrAxTitleActiveHorz; OLE_COLOR m_clrAxTitleInactiveHorz; OLE_COLOR m_clrAxTitleActiveVert; OLE_COLOR m_clrAxTitleInactiveVert; /** @endcond */ # endif }; AFX_INLINE int CXTPDockingPanePaintManager::GetCaptionHeight() const { return m_nTitleHeight; } AFX_INLINE int CXTPDockingPanePaintManager::GetTabsHeight() const { return m_nTabsHeight; } AFX_INLINE CXTPTabPaintManager* CXTPDockingPanePaintManager::GetTabPaintManager() const { return m_pTabPaintManager; } AFX_INLINE CXTPTabPaintManager* CXTPDockingPanePaintManager::GetPanelPaintManager() const { return m_pPanelPaintManager; } AFX_INLINE void CXTPDockingPanePaintManager::DrawFloatingFrame(CDC* /*pDC*/, CXTPDockingPaneMiniWnd* /*pPane*/, CRect /*rc*/) { } AFX_INLINE void CXTPDockingPanePaintManager::DrawSidePanel(CDC* /*pDC*/, CXTPDockingPaneSidePanel* /*pPane*/, CRect /*rc*/) { } AFX_INLINE void CXTPDockingPanePaintManager::SetCaptionButtonStyle(XTPDockingPaneCaptionButtonStyle nStyle) { m_nCaptionButtonStyle = nStyle; } AFX_INLINE XTPDockingPaneCaptionButtonStyle CXTPDockingPanePaintManager::GetCaptionButtonStyle() const { return m_nCaptionButtonStyle; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // #if !defined(__XTPDOCKINGPANEPAINTMANAGER_H__) /** @endcond */