/** * @file XTPDockingPaneBase.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(__XTPDOCKINGPANEBASE_H__) # define __XTPDOCKINGPANEBASE_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPDockingPaneBase; class CXTPDockingPane; class CXTPDockingPaneTabbedContainer; class CXTPDockingPaneLayout; class CXTPDockingPaneManager; class CXTPDockingPanePaintManager; class CXTPDockingPaneCaptionButton; class CXTPPropExchange; /** * @brief * CXTPDockingPaneCaptionButtons is a CArray derived class used to manipulate * Caption Buttons. */ class _XTP_EXT_CLASS CXTPDockingPaneCaptionButtons : public CArray { public: /** * @brief * Call this member to determine if the mouse pointer is positioned * over one of the buttons in the pane caption. * @param pt A CPoint object containing the coordinates of the mouse pointer. * @return * TRUE if the mouse pointer is positioned over a caption button, * otherwise FALSE. */ BOOL CheckForMouseOver(CPoint pt); }; /** * @brief * CXTPDockingPaneBase is a standalone class. It represents the parent * class for a docking pane and its containers. */ class _XTP_EXT_CLASS CXTPDockingPaneBase { protected: /** * @brief * Protected constructor. You cannot create this class. * @param type Docking Pane type. Can be any of the values listed in the * Remarks section. * @param pLayout Pointer to a CXTPDockingPaneLayout object. * @details * Docking Pane type can be one of the following: * xtpPaneTypeDockingPane: Indicates the pane's style is a docking pane. * xtpPaneTypeTabbedContainer: Indicates the pane's style is a tabbed * container for a pane. * xtpPaneTypeSplitterContainer: Indicates the pane's style is a splitter * container. * xtpPaneTypeMiniWnd: Indicates the pane's style is a floating window * container. * xtpPaneTypeClient: Indicates the pane's style is a container for * client area. * xtpPaneTypeAutoHidePanel: Indicates the pane's style is an auto-hide * panel container. */ CXTPDockingPaneBase(XTPDockingPaneType type, CXTPDockingPaneLayout* pLayout); /** * @brief * Destroys a CXTPDockingPaneBase object, handles cleanup and * deallocation. */ virtual ~CXTPDockingPaneBase(); public: /** * @brief * Determines if the frame is active. * @return * TRUE if the frame is active. */ virtual BOOL IsActive() const; /** * @brief * Determines if the caption is drawn vertically. * @return * TRUE if the caption is drawn vertically. */ virtual BOOL IsCaptionVertical() const; /** * @brief * Call this member to get the text in the caption for the tabbed container * (group of panes). * @return * The text in the caption for the tabbed container (group of panes). */ virtual CString GetTitle() const; public: /** * @brief * Call this member to determine the type of the pane. * @return * The type of the pane. It can be one of the following: * xtpPaneTypeDockingPane: Indicates the pane's style is a docking pane. * xtpPaneTypeTabbedContainer: Indicates the pane's style is a tabbed * container for a pane. * xtpPaneTypeSplitterContainer: Indicates the pane's style is a splitter * container. * xtpPaneTypeMiniWnd: Indicates the pane's style is a floating window * container. * xtpPaneTypeClient: Indicates the pane's style is a container for * client area. * xtpPaneTypeAutoHidePanel: Indicates the pane's style is an auto-hide * panel container. */ XTPDockingPaneType GetType() const; /** * @brief * The GetPaneWindowRect function retrieves the dimensions of the * bounding rectangle of the pane. * @return * The visible rectangle of the pane. */ CRect GetPaneWindowRect() const; /** * @brief * Call this member function to retrieve the parent container of * the pane. * @return * The parent container of the pane. */ CXTPDockingPaneBase* GetContainer() const; /** * @brief * Call this member function to retrieve the pane manager. * @return * A pointer to a CXTPDockingPaneManager object. */ CXTPDockingPaneManager* GetDockingPaneManager() const; /** * @brief * Call this member function to retrieve the paint manager. * @return * A pointer to a CXTPDockingPanePaintManager object. */ CXTPDockingPanePaintManager* GetPaintManager() const; /** * @brief * Call this member to find the specified caption button. * @param nID Identifier of the button. * @return * The CXTPDockingPaneCaptionButton object if successful, otherwise NULL. */ CXTPDockingPaneCaptionButton* FindCaptionButton(int nID) const; /** * @brief * Call this member to get a reference to the caption's close/pop-up button. * @return * A reference to a CXTPDockingPaneCaptionButtons object. */ CXTPDockingPaneCaptionButtons* GetCaptionButtons() const; /** * @brief * Call this member to redraw the pane. */ virtual void RedrawPane(); /** * @brief * Call this member to determine if one pane is contained in the * collection of another. * @param pPane Pointer to a CXTPDockingPaneBase object. * @return * POSITION of the pane in the collection if successful, * otherwise NULL. */ virtual POSITION ContainPane(CXTPDockingPaneBase* pPane) const; /** * @brief * Call this member to retrieve a collection of the panes with a * specified type. * @param type Type of the panes to find. * @param pList Pointer to a CXTPDockingPaneBaseList object that will * contain found panes. * @see * CXTPDockingPaneBaseList */ virtual void FindPane(XTPDockingPaneType type, CXTPDockingPaneBaseList* pList) const; /** * @brief * Call this member to fill the pMinMaxInfo structure with the * minimum and maximum width and height of the container. * This will look at the MinMaxInfo for each pane in the * container and set the appropriate minimum and maximum width * and height for the container. * @param pMinMaxInfo Pointer to a MINMAXINFO structure. */ virtual void GetMinMaxInfo(LPMINMAXINFO pMinMaxInfo) const; /** * @brief * Call this member to determine if there are no children panes. * @return * TRUE if there are no children panes, otherwise FALSE. */ virtual BOOL IsEmpty() const; /** * @brief * Call this member function to retrieve the parent window for the pane. * @return * A pointer to a parent window if successful, otherwise NULL. */ virtual CWnd* GetDockingSite() const; /** * @brief * Call this member to check if the pane is hidden. * @return * TRUE if the pane is hidden. */ virtual BOOL IsHidden() const; /** * @brief * Retrieves the window handle for a window. * @return * The window handle for a window if successful. NULL if the HWND is not * attached to a window or if it is used with a NULL HWND pointer. */ virtual HWND GetPaneHwnd() const; /** * @brief * This member is called when a pane must be redrawn. * @param bSelectionChanged TRUE if the selected pane was changed. */ virtual void InvalidatePane(BOOL bSelectionChanged); protected: /** * @brief * This method is called to set the position of the pane. * @param pParent Pointer to a CWnd object. * @param rect Rectangle of the pane to be set. * @param lParam Pointer to an AFX_SIZEPARENTPARAMS structure. */ virtual void OnSizeParent(CWnd* pParent, CRect rect, LPVOID lParam); /** * @brief * This method is called to update the state of the pane. */ virtual void OnFocusChanged(); /** * @brief * Call this member to set the parent frame of the pane. * @param pFrame Pointer to a CWnd object. */ virtual void SetDockingSite(CWnd* pFrame); /** * @brief * Call this method to set the parent container of the pane. * @param pContainer Pointer to a CXTPDockingPaneBase object. */ virtual void SetParentContainer(CXTPDockingPaneBase* pContainer); /** * @brief * This member is called when a child pane collection is changed. * @param pContainer Pointer to the CXTPDockingPaneBase object that was changed. */ virtual void OnChildContainerChanged(CXTPDockingPaneBase* pContainer); /** * @brief * This member is called when the parent pane collection is changed. * @param pContainer Pointer to the CXTPDockingPaneBase object that was changed. */ virtual void OnParentContainerChanged(CXTPDockingPaneBase* pContainer); /** * @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 returns FALSE. */ virtual BOOL DoPropExchange(CXTPPropExchange* pPX); /** * @brief * This member is called to clone the pane. * @param pLayout Pointer to a CXTPDockingPaneLayout object. * @param pMap Pointer to a CXTPPaneToPaneMap object. * @param dwIgnoredOptions Options that must be skipped. * @return * A pointer to a CXTPDockingPaneBase object. * @see * CXTPPaneToPaneMap */ virtual CXTPDockingPaneBase* Clone(CXTPDockingPaneLayout* pLayout, CXTPPaneToPaneMap* pMap, DWORD dwIgnoredOptions = 0); /** * @brief * This member is called to copy a pane. * @param pClone Pointer to a CXTPDockingPaneBase object. * @param pMap Pointer to a CXTPPaneToPaneMap object. * @param dwIgnoredOptions Options that must be skipped. * @see * CXTPPaneToPaneMap */ virtual void Copy(CXTPDockingPaneBase* pClone, CXTPPaneToPaneMap* pMap, DWORD dwIgnoredOptions); /** * @brief * Call this member to remove a pane from the collection. * @param pPane Pointer to a CXTPDockingPaneBase object. */ virtual void RemovePane(CXTPDockingPaneBase* pPane); /** * @brief * This member is called when the dimensions of the caption button * are changed. * @param pButton Caption button pointer. */ virtual void OnCaptionButtonRectChanged(CXTPDockingPaneCaptionButton* pButton); /** * @brief * Call this member to determine if a caption button is visible. * @param pButton Caption button pointer. * @return * TRUE if the caption button is visible, otherwise FALSE. */ virtual BOOL IsCaptionButtonVisible(CXTPDockingPaneCaptionButton* pButton); /** * @brief * This method is called to destroy a pane. */ virtual void DeletePane() = 0; /** * @brief * This member is called to create a pane. */ virtual void CreateContainer(); # ifdef _XTP_ACTIVEX /** @cond */ public: virtual LPDISPATCH OleGetDispatch(BOOL bAddRef) = 0; /** @endcond */ # endif protected: CSize m_szDocking; /**< Size of the pane. */ CXTPDockingPaneLayout* m_pLayout; /**< Parent layout. */ CXTPDockingPaneBase* m_pParentContainer; /**< Parent container. */ CWnd* m_pDockingSite; /**< Parent frame. */ XTPDockingPaneType m_type; /**< Type of the pane. */ CRect m_rcWindow; /**< Position of the pane. */ CXTPDockingPaneCaptionButtons* m_pCaptionButtons; /**< Collection of caption buttons. */ private: int m_nLength; int m_nIndex; private: friend class CXTPDockingPaneManager; friend class CXTPDockingPaneSplitterContainer; friend class CXTPDockingPaneTabbedContainer; friend class CXTPDockingPaneMiniWnd; friend class CXTPDockingPaneSplitterWnd; friend class CXTPDockingPaneContext; friend class CXTPDockingPane; friend class CXTPDockingPaneLayout; friend class CXTPDockingPaneAutoHidePanel; friend class CXTPDockingPaneAutoHideWnd; friend class CXTPDockingPaneCaptionButton; friend class CXTPDockingPaneSidePanel; }; /** @cond */ class _XTP_EXT_CLASS CXTPDockingPaneClientContainer : public CXTPCmdTarget , public CXTPDockingPaneBase { public: CXTPDockingPaneClientContainer(CXTPDockingPaneLayout* pLayout); protected: virtual void DeletePane(); # ifdef _XTP_ACTIVEX private: DECLARE_DISPATCH_MAP() DECLARE_OLETYPELIB_EX(CXTPDockingPaneClientContainer); DECLARE_INTERFACE_MAP() LPDISPATCH OleGetDispatch(BOOL /*bAddRef*/); afx_msg LPDISPATCH OleGetItem(int nIndex); afx_msg int OleGetItemCount(); afx_msg LPDISPATCH OleGetContainer(); afx_msg int OleGetType(); afx_msg LPDISPATCH OleGetPane(int nIndex); afx_msg HWND OleGetHwnd(); afx_msg BOOL OleIsEmpty(); afx_msg int OleGetPosition(); # endif }; /** @endcond */ AFX_INLINE BOOL CXTPDockingPaneBase::IsActive() const { return FALSE; } AFX_INLINE BOOL CXTPDockingPaneBase::IsCaptionVertical() const { return FALSE; } AFX_INLINE CString CXTPDockingPaneBase::GetTitle() const { return CString(_T("")); } AFX_INLINE XTPDockingPaneType CXTPDockingPaneBase::GetType() const { return m_type; } AFX_INLINE CXTPDockingPaneBase* CXTPDockingPaneBase::GetContainer() const { return m_pParentContainer; } AFX_INLINE void CXTPDockingPaneBase::SetDockingSite(CWnd* pFrame) { m_pDockingSite = pFrame; } AFX_INLINE void CXTPDockingPaneBase::SetParentContainer(CXTPDockingPaneBase* pContainer) { m_pParentContainer = pContainer; } AFX_INLINE void CXTPDockingPaneBase::OnCaptionButtonRectChanged(CXTPDockingPaneCaptionButton*) { } AFX_INLINE BOOL CXTPDockingPaneBase::IsCaptionButtonVisible(CXTPDockingPaneCaptionButton* /*pButton*/) { return TRUE; } AFX_INLINE CWnd* CXTPDockingPaneBase::GetDockingSite() const { return m_pDockingSite; } AFX_INLINE HWND CXTPDockingPaneBase::GetPaneHwnd() const { return 0; } AFX_INLINE CXTPDockingPaneCaptionButtons* CXTPDockingPaneBase::GetCaptionButtons() const { return m_pCaptionButtons; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // #if !defined(__XTPDOCKINGPANEBASE_H__) /** @endcond */