/** * @file XTPDockingPaneLayout.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(__XTPDOCKINGPANELAYOUT_H__) # define __XTPDOCKINGPANELAYOUT_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPDockingPaneBase; class CXTPDockingPaneSplitterContainer; class CXTPDockingPaneBase; class CXTPDockingPaneAutoHidePanel; class CXTPDockingPaneManager; class CXTPPropExchange; class CXTPDockingPaneTabbedContainer; class CXTPDockingPaneSplitterWnd; class CXTPDockingPaneClientContainer; namespace XTPXML { struct IXMLDOMNode; }; /** * @brief * CXTPDockingPaneLayout is a standalone class. It is used to manipulate * a pane's layouts. */ class _XTP_EXT_CLASS CXTPDockingPaneLayout : public CXTPCmdTarget { DECLARE_DYNAMIC(CXTPDockingPaneLayout); public: /** * @brief * Constructs a CXTPDockingPaneLayout object. * @param pManager Pointer to a CXTPDockingPaneManager object. */ CXTPDockingPaneLayout(CXTPDockingPaneManager* pManager); /** * @brief * Destroys a CXTPDockingPaneLayout object, handles cleanup and deallocation. */ virtual ~CXTPDockingPaneLayout(); public: /** * @brief * Call this member function to copy one layout to another. * @param pLayout Source Layout. */ void Copy(const CXTPDockingPaneLayout* pLayout); /** * @brief * Call this member function to save the layout to the registry. * @param lpszSection Registry section. */ void Save(LPCTSTR lpszSection); /** * @brief * Call this member function to load the layout from the registry. * @param lpszSection Registry section. * @return * TRUE if successful, otherwise FALSE. */ BOOL Load(LPCTSTR lpszSection); /** * @brief * Retrieves a list of layout's panes. * @return * A list of the layout's panes. * @see * CXTPDockingPaneInfoList */ CXTPDockingPaneInfoList& GetPaneList() const; /** * @brief * Either reads this object from or writes this object to an archive. * @param ar A CArchive object to serialize to or from. */ void Serialize(CArchive& ar); # ifndef _XTP_EXCLUDE_XML /** * @brief * Call this member function to save the layout to the file. * @param lpszFileName The full path and file name. * @param lpszSection Registry section. */ void SaveToFile(LPCTSTR lpszFileName, LPCTSTR lpszSection); /** * @brief * Call this member function to load the layout from the file. * @param lpszFileName The full path and file name. * @param lpszSection Registry section. * @return * TRUE if successful, otherwise FALSE. */ BOOL LoadFromFile(LPCTSTR lpszFileName, LPCTSTR lpszSection); /** * @brief * Call this member function to save the layout to the XML node. * @param pNode Points to the node object. * @param lpszSection Registry section. */ void SaveToNode(XTPXML::IXMLDOMNode* pNode, LPCTSTR lpszSection); /** * @brief * Call this member function to load the layout from the XML node. * @param pNode Points to the node object. * @param lpszSection Registry section. * @return * TRUE if successful, otherwise FALSE. */ BOOL LoadFromNode(XTPXML::IXMLDOMNode* pNode, LPCTSTR lpszSection); # endif /** * @brief * Call this member to determine if the layout is a user created layout. * @return * TRUE if the layout is a user created layout. */ BOOL IsUserLayout() const; /** * @brief * Determines if the layout is valid. * @return * TRUE if the layout is valid. */ BOOL IsValid() const; public: void DestroyPane(CXTPDockingPane* pPane); CXTPDockingPane* FindPane(int nID) const; public: /** * @brief * Call this member function to save/restore the settings of the pane. * @param pPX Pointer to a CXTPPropExchange object. * @return * TRUE if successful, otherwise FALSE. */ BOOL DoPropExchange(CXTPPropExchange* pPX); private: void Push(CXTPDockingPaneBase* pPane) { m_lstStack.AddTail(pPane); } void HidePane(CXTPDockingPaneBase* pPane); void OnSizeParent(CWnd* pParent, CRect rect, LPVOID lParam); void Free(); void _FreeEmptyPanes(); XTPDockingPaneDirection _GetPaneDirection(const CXTPDockingPaneBase* pPane) const; void _Save(CXTPPropExchange* pPX); BOOL _Load(CXTPPropExchange* pPX); BOOL _FindTabbedPaneToHide(CXTPDockingPaneAutoHidePanel* pPanel, CXTPDockingPaneBase* pPane); void _AddPanesTo(CXTPDockingPaneTabbedContainer* pContainer, CXTPDockingPaneBaseList& lst, DWORD dwIgnoredOptions); void MoveToTail(CXTPDockingPaneBase* pBase); private: CXTPDockingPaneSplitterContainer* m_pTopContainer; CXTPDockingPaneBase* m_pClient; CXTPDockingPaneInfoList m_lstPanes; CXTPDockingPaneBaseList m_lstStack; XTP_DOCKINGPANE_INFO* FindPaneInfo(CXTPDockingPane* pPane); void RepositionMargins(CRect& rect, const CRect& lpszClientMargins); CXTPDockingPaneAutoHidePanel* m_wndPanels[4]; CXTPDockingPaneSplitterWnd* m_wndMargins[4]; BOOL m_bUserLayout; CXTPDockingPaneManager* m_pManager; # ifdef _XTP_ACTIVEX /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPDockingPaneLayout); DECLARE_ENUM_VARIANT(CXTPDockingPaneLayout); public: void OleDoPropExchange(LPDISPATCH lpPropExchage); long OleGetItemCount(); LPDISPATCH OleGetItem(int nIndex); LPDISPATCH OleGetPane(int nIndex); long CXTPDockingPaneLayout::OleGetContainersCount(); LPDISPATCH CXTPDockingPaneLayout::OleGetContainer(int nIndex); long OleGetPaneCount(); LPDISPATCH OleGetClientContainer(); LPDISPATCH OleGetTopContainer(); static CXTPDockingPaneLayout* AFX_CDECL FromDispatch(LPDISPATCH pDisp); /** @endcond */ # endif /*_XTP_ACTIVEX*/ private: friend class CXTPDockingPaneManager; friend class CXTPDockingPaneBase; friend class CXTPDockingPane; friend class CXTPDockingPaneAutoHidePanel; friend class CDockingPaneSite; friend class CDockingPaneCtrl; friend class CXTPDockingPaneSidePanel; }; AFX_INLINE BOOL CXTPDockingPaneLayout::IsUserLayout() const { return m_bUserLayout; } AFX_INLINE CXTPDockingPaneInfoList& CXTPDockingPaneLayout::GetPaneList() const { return (CXTPDockingPaneInfoList&)m_lstPanes; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // #if !defined(__XTPDOCKINGPANELAYOUT_H__) /** @endcond */