/** * @file XTPTearOffFrame.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(__XTPTEAROFFFRAMEWND_H__) # define __XTPTEAROFFFRAMEWND_H__ /** @endcond */ # if _MSC_VER > 1000 # pragma once # endif // _MSC_VER > 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** @cond */ class CXTPMultiDocTemplate : public CMultiDocTemplate { friend class CXTPTearOffFrame; friend class CXTPTabClientWnd; # ifndef _XTP_COMMANDBARS_ACTIVEX # ifdef _XTP_INCLUDE_DOCKINGPANE friend class CXTPDockingPaneManager; # endif # endif CXTPMultiDocTemplate(); }; // //{{AFX_MSG_MAP(CChildFrame) // //}}AFX_MSG_MAP /** * @brief * The WM_XTP_TEAROFF_ACTIVATE message is sent to the main window to * inform about last active TearOff frame. * * Example: * Here is an example of how an application would process the WM_XTP_TEAROFF_ACTIVATE * message. *
 * BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
 *     //{{AFX_MSG_MAP(CChildFrame)
 *     ON_MESSAGE(WM_XTP_TEAROFF_ACTIVATE, OnTearoffActivate)
 *     //}}AFX_MSG_MAP
 * END_MESSAGE_MAP()
 *
 * LRESULT CMainFrame::OnTearoffActivate(WPARAM wParam, LPARAM lParam)
 * {
 * 	  CXTPTearOffFrame* pFrame = (CXTPTearOffFrame*)wParam;
 *
 * 	  m_pPrevActiveFrame = m_pLastActiveFrame;
 * 	  m_pLastActiveFrame = pFrame;
 *
 * 	  return 0;
 * }
 * 
*/ const UINT WM_XTP_TEAROFF_ACTIVATE = (WM_XTP_COMMANDBARS_BASE + 33); /** @endcond */ /** * @brief * The class represents a floating torn off frame. */ class CXTPTearOffFrame : public CXTPMDIFrameWnd , CXTPCommandBarsFrameHook { DECLARE_DYNCREATE(CXTPTearOffFrame); public: /** * @brief * Construct frame object. */ CXTPTearOffFrame(); /** * @brief * Handles resources cleanup. */ virtual ~CXTPTearOffFrame(); /** * @brief * Handles frame window destruction. * @return TRUE if the window is destroyed successfully, FALSE otherwise. */ virtual BOOL DestroyWindow(); /** * @brief * Initializes frame object. * @param pTabClient A pointer to the associated tab client object. * @param pTabItem A pointer to the initial tab item object. */ void Init(CXTPTabClientWnd* pTabClient, CXTPTabManagerItem* pTabItem); /** * @brief * Updates an associated tab client object and and all related frame states. * @param pTabClient A pointer to the new associated tab client object. */ void Update(CXTPTabClientWnd* pTabClient); /** * @brief * Obtains an associated tab client object pointer. * @return * An associated tab client object pointer. */ CXTPTabClientWnd* GetTabClient() const; /** * @brief * Determines if the frame is being dragged. * @return * TRUE if the frame is being dragged or FALSE otherwise. */ BOOL IsFrameBeingDragged() const; virtual HMENU GetWindowMenuPopup(HMENU hMenuBar); private: afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); afx_msg void OnEnterSizeMove(); afx_msg void OnMove(int x, int y); afx_msg void OnExitSizeMove(); afx_msg LRESULT OnEnterSizeMove(WPARAM wParam, LPARAM lParam); afx_msg LRESULT OnExitSizeMove(WPARAM wParam, LPARAM lParam); afx_msg void OnClose(); afx_msg LRESULT OnTabbarMouseMsg(WPARAM wParam, LPARAM lParam); afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized); afx_msg LRESULT OnTabbarNewItem(WPARAM wParam, LPARAM lParam); afx_msg LRESULT OnSetActiveWorkspace(WPARAM wParam, LPARAM lParam); /** @cond */ DECLARE_MESSAGE_MAP() /** @endcond */ private: BOOL m_bIsFrameDragging; HCURSOR m_hCursor; HCURSOR m_hCursorNew; CXTPTabClientWnd m_wndTabClient; CRect m_rcPrev; CXTPTabClientContext* m_pTabClientContext; CRect m_rcDragRect; CXTPTabClientWnd* pTargetTabPrev; void UpdateDragRect(); void ChangeMDIChildFrame(CXTPTabClientWnd* pTarget, int nOldWorkspace, int nSticker); CXTPTabClientWnd::CWorkspace* ChangeItemWorkspace(CXTPTabClientWnd* pTarget, int nOldWorkspace, int nSticker, CXTPTabClientWnd::CWorkspace* pExistingWorkspace = NULL); friend class CXTPMDIFrameWndEx; }; /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // !defined(__XTPTEAROFFFRAMEWND_H__) /** @endcond */