/** * @file XTPTabClientSticker.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(__XTPTABCLIENTSTICKER_H__) # define __XTPTABCLIENTSTICKER_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CWorkspace; class CXTPImageManager; /** * @brief * Identifies tab client sticker part. */ enum XTPTabClientStickerPart { xtpTabClientStickerNone = 0, /**< No docking stickers are displayed*/ xtpTabClientStickerLeft = 1, /**< Display the docking sticker indicating the tab can be docked to the left. */ xtpTabClientStickerRight = 2, /**< Display the docking sticker indicating the tab can be docked to the right. */ xtpTabClientStickerTop = 4, /**< Display the docking sticker indicating the tab can be docked on the top. */ xtpTabClientStickerBottom = 8, /**< Display the docking sticker indicating the tab can be docked on the bottom. */ xtpTabClientStickerCenter = 16, /**< Display the docking sticker indicating the tab can be docked in the center. */ }; /** * @brief * A sticker base control. */ class CXTPStickerBase : public CWnd { DECLARE_DYNAMIC(CXTPStickerBase); public: /** * @brief * Construct a sticker object. */ CXTPStickerBase(); /** * @brief * Handles resource cleanup. */ virtual ~CXTPStickerBase(); /** * @brief * Creates a sticker control. * @return * TRUE if the control is successfully create, FALSE otherwise. */ BOOL Create(); using CWnd::Create; void SetTarget(CWnd* pTarget); CWnd* GetTarget() const; protected: /** @cond */ DECLARE_MESSAGE_MAP() //{{AFX_MSG(CXTPTabClientSticker) afx_msg BOOL OnEraseBkgnd(CDC* pDC); afx_msg void OnPaint(); //}}AFX_MSG /** @endcond */ virtual void OnDraw(CDC& dc) = 0; virtual int InitStickers() = 0; virtual CRect GetTargetRect() = 0; void IncludeRgnPart(CRgn* pRgn, int x1, int y, int x2); void RegionFromBitmap(CRgn* pRgn, CDC* pDC, CRect rc); void InitColors(); void InitSize(); CWnd* m_pTarget; CXTPMarkupContext* m_pMarkupContext; CXTPMarkupThemePart m_partBackNormal; CXTPMarkupThemePart m_partBackSelected; CXTPMarkupThemePart m_partLeftNormal; CXTPMarkupThemePart m_partLeftSelected; CXTPMarkupThemePart m_partTopNormal; CXTPMarkupThemePart m_partTopSelected; CXTPMarkupThemePart m_partRightNormal; CXTPMarkupThemePart m_partRightSelected; CXTPMarkupThemePart m_partBottomNormal; CXTPMarkupThemePart m_partBottomSelected; CXTPMarkupThemePart m_partCenterNormal; CXTPMarkupThemePart m_partCenterSelected; CSize m_szIcon; int m_delimeterX; int m_delimeterY; CRect m_rcSticker; CRect m_rcBack; CRect m_rcLeft; CRect m_rcTop; CRect m_rcRight; CRect m_rcBottom; CRect m_rcCenter; int m_stickers; /**< Allowed stickers for tab client */ }; /** * @brief * A tab client sticker control. */ class CXTPTabClientSticker : public CXTPStickerBase { DECLARE_DYNCREATE(CXTPTabClientSticker); CXTPTabClientSticker(); public: /** * @brief * Construct a sticker object. * @param pTabClientWnd A pointer to the associated tab client window. * @param nTabWorkspace An index of the tab workspace. */ CXTPTabClientSticker(CXTPTabClientWnd* pTabClientWnd, int nTabWorkspace); /** * @brief * Handles resource cleanup. */ virtual ~CXTPTabClientSticker(); /** * @brief * Determines which part of the sticker is under the specified point. * @param pt A screen point to determine sticker part under. * @return * Sticker part identifier. * @see * XTPTabClientStickerPart */ XTPTabClientStickerPart HitTest(POINT pt) const; /** * @brief * Gets the target tab client window pointer. * @return * Target tab client window pointer or NULL if no target is provided. */ CXTPTabClientWnd* GetTargetTabClientWnd() const; protected: /** @cond */ DECLARE_MESSAGE_MAP() //{{AFX_MSG(CXTPTabClientSticker) //}}AFX_MSG /** @endcond */ private: virtual void OnDraw(CDC& dc); virtual CRect GetTargetRect(); virtual int InitStickers(); void InitIcons(); int m_nTargetWorkspace; }; # ifndef _XTP_COMMANDBARS_ACTIVEX # ifdef _XTP_INCLUDE_DOCKINGPANE /** * @brief * A dockpane sticker control. */ class CXTPDockPaneSticker : public CXTPStickerBase { DECLARE_DYNCREATE(CXTPDockPaneSticker); CXTPDockPaneSticker(); public: /** * @brief * Construct a sticker object. * @param pDockPane A pointer to the associated dockpane client window. */ CXTPDockPaneSticker(CXTPDockingPaneTabbedContainer* pDockPane); /** * @brief * Handles resource cleanup. */ virtual ~CXTPDockPaneSticker(); /** * @brief * Determines which part of the sticker is under the specified point. * @param pt A screen point to determine sticker part under. * @return * Sticker part identifier. * @see * XTPDockingPaneStickerType */ XTPDockingPaneStickerType HitTest(POINT pt) const; /** * @brief * Gets the target dockpane client window pointer. * @param pTarget A pointer to the new target tab client window. * @return * Target tab client window pointer or NULL if no target is provided. */ CXTPDockingPaneTabbedContainer* GetTargetDockPaneWnd() const; protected: /** @cond */ DECLARE_MESSAGE_MAP() //{{AFX_MSG(CXTPDockPaneSticker) //}}AFX_MSG /** @endcond */ private: virtual void OnDraw(CDC& dc); virtual CRect GetTargetRect(); virtual int InitStickers(); void InitIcons(); }; # endif # endif /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(__XTPTABCLIENTSTICKER_H__) /** @endcond */