/** * @file XTPGridDragDrop.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(__XTPGRIDDRAGDROP_H__) # define __XTPGRIDDRAGDROP_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPGridHeader; class CXTPGridPaintManager; class CXTPGridColumn; /** * @brief * CXTPGridHeaderDragWnd is a CWnd derived class. It is used * internally to represent a dragging column window. */ class _XTP_EXT_CLASS CXTPGridHeaderDragWnd : public CWnd { public: /** * @brief * Creates a CXTPGridHeaderDragWnd object. */ CXTPGridHeaderDragWnd(); /** * @brief * Destroys a CXTPGridHeaderDragWnd object, handles cleanup and deallocation. */ virtual ~CXTPGridHeaderDragWnd(); public: /** * @brief * Creates a dragging window with the specified parameters. * @param rect Drawing rectangle position. * @param pHeader Pointer to the parent grid header object. * @param pPaintManager Paint manager for performing draw operations. * @param pColumn Pointer to the associated column. * @return * TRUE if the dragging window was created successfully, otherwise FALSE. */ virtual BOOL Create(CRect rect, CXTPGridHeader* pHeader, CXTPGridPaintManager* pPaintManager, CXTPGridColumn* pColumn); protected: /** * @brief * Called by the framework to draw the contents of the window using * the specified device context. * @param pDC Pointer to the device context in which the drawing occurs. * @param rcClient Coordinates of the client window position. */ virtual void OnDraw(CDC* pDC, CRect rcClient); protected: /** @cond */ //{{AFX_MSG(CXTPGridHeaderDragWnd) afx_msg void OnPaint(); afx_msg BOOL OnEraseBkgnd(CDC* pDC); afx_msg void OnTimer(UINT_PTR nIDEvent); //}}AFX_MSG //{{AFX_VIRTUAL(CXTPGridHeaderDragWnd) virtual void PostNcDestroy(); //}}AFX_VIRTUAL /** @endcond */ private: BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL); /** @cond */ DECLARE_MESSAGE_MAP() /** @endcond */ protected: CXTPGridHeader* m_pHeader; /**< Pointer to the associated grid header object. */ CXTPGridPaintManager* m_pPaintManager; /**< Pointer to the associated paint manager object. */ CXTPGridColumn* m_pColumn; /**< Pointer to the associated grid column object. */ }; /** * @brief * CXTPGridHeaderDropWnd is a CWnd derived class. It is used * internally to represent drop target arrows. */ class _XTP_EXT_CLASS CXTPGridHeaderDropWnd : public CWnd { public: /** * @brief * Creates a CXTPGridHeaderDropWnd object. * @param crColor Drop window color. */ CXTPGridHeaderDropWnd(COLORREF crColor); /** * @brief * Destroys a CXTPGridHeaderDropWnd object, handles cleanup and deallocation. */ virtual ~CXTPGridHeaderDropWnd(); public: /** * @brief * Changes the window position. * @param xPos New horizontal position. * @param yPos New vertical position. */ void SetWindowPos(int xPos, int yPos); /** * @brief * Creates a drop window with a specified gap inside. * @param pParentWnd Pointer to the parent window. * @param nHeight Height of the gap between two arrows, in pixels. * @return * TRUE if the drop window was created successfully, otherwise FALSE. */ virtual BOOL Create(CWnd* pParentWnd, int nHeight); protected: /** @cond */ //{{AFX_VIRTUAL(CXTPGridHeaderDropWnd) virtual void PostNcDestroy(); //}}AFX_VIRTUAL //{{AFX_MSG(CXTPGridHeaderDropWnd) afx_msg BOOL OnEraseBkgnd(CDC* pDC); //}}AFX_MSG /** @endcond */ private: BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL); /** @cond */ DECLARE_MESSAGE_MAP() /** @endcond */ protected: COLORREF m_clr; /**< Drawing brush. */ CRgn m_rgn; /**< Arrows region. */ int m_nHeight; /**< Height of the gap between two arrows. */ }; ////////////////////////////////////////////////////////////////////////// AFX_INLINE BOOL CXTPGridHeaderDragWnd::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) { return CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext); } AFX_INLINE BOOL CXTPGridHeaderDropWnd::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) { return CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext); } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPGRIDDRAGDROP_H__) /** @endcond */