/** * @file XTPDockContext.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(__XTPDOCKCONTEXT_H__) # define __XTPDOCKCONTEXT_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPToolBar; /** * @brief * CXTPDockContext is a standalone class. * It is used internally by CXTPToolBar. */ class _XTP_EXT_CLASS CXTPDockContext { public: /** * @brief * Constructs a CXTPDockContext object. * @param pBar Pointer to a CXTPToolBar object. */ CXTPDockContext(CXTPToolBar* pBar); /** * @brief * Destroys a CXTPDockContext object, handles cleanup and deallocation. */ virtual ~CXTPDockContext(); public: /** * @brief * This method is called when the user starts to move the toolbar. * @param pt Initial cursor position. */ virtual void StartDrag(CPoint pt); /** * @brief * This method is called when the user starts to resize the toolbar. * @param nHitTest Specifies the hit-test area code. * @param pt Initial cursor position. */ virtual void StartResize(int nHitTest, CPoint pt); /** * @brief * This method is called to switch the docking position of the toolbar. * @return * TRUE if successful, otherwise FALSE. */ virtual BOOL ToggleDocking(); protected: /** * @brief * This method is called to start the tracking loop. */ virtual void Track(); /** * @brief * This method is called to stretch the child toolbar. * @param pt CPoint object that specifies xy coordinates. */ void Stretch(CPoint pt); /** * @brief * This method is called to move the child toolbar to the specified position. * @param pt CPoint object that specifies xy coordinates. */ void Move(CPoint pt); /** * @brief * This method is called to move the child toolbar to resize the child dialog bar. * @param pt CPoint object that specifies xy coordinates. */ void Resize(CPoint pt); private: static void AFX_CDECL AdjustRectangle(CRect& rect, CPoint pt); void EnsureVisible(CRect& rectDragFrame); protected: CXTPToolBar* m_pBar; /**< Child toolbar. */ int m_nHitTest; /**< Hit Test code. */ CPoint m_ptLast; /**< Last mouse position. */ XTPBarPosition m_uMRUDockPosition; /**< Last docking position. */ CRect m_rectMRUDockPos; /**< Last docking rectangle. */ CPoint m_ptMRUFloatPos; /**< Last floating rectangle. */ CRect m_rectDragDock; /**< Current docking rectangle. */ CRect m_rectDragFrame; /**< Current floating rectangle. */ private: friend class CXTPToolBar; friend class CXTPDockBar; }; /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPDOCKCONTEXT_H__) /** @endcond */