/** * @file XTPDockingPaneSidePanel.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(__XTPDOCKINGPANESIDEPANEL_H__) # define __XTPDOCKINGPANESIDEPANEL_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPDockingPaneLayout; class CXTPDockingPaneSidePanel; /** * @brief * CXTPDockingPaneSidePanel is a multiple inheritance class derived from * CWnd and CXTPDockingPaneBase. It is used internally as an auto-hide container * for CXTPDockingPaneBase derived classes. */ class _XTP_EXT_CLASS CXTPDockingPaneSidePanel : public CMiniFrameWnd , public CXTPDockingPaneBaseContainer { /** @cond */ DECLARE_DYNAMIC(CXTPDockingPaneSidePanel) /** @endcond */ protected: /** * @brief * Constructs a CXTPDockingPaneAutoHidePanel object. * Protected constructor. Internally constructed only. * @param pLayout Pointer to a CXTPDockingPaneLayout object. */ CXTPDockingPaneSidePanel(CXTPDockingPaneLayout* pLayout); /** * @brief * Destroys a CXTPDockingPaneAutoHidePanel object, handles cleanup and * deallocation. */ ~CXTPDockingPaneSidePanel(); public: /** * @brief * Retrieves a CXTPDockingPaneTabbedContainer object that points to the * parent container for this container. * @return * A CXTPDockingPaneTabbedContainer object that points to the parent * container for this container. */ CXTPDockingPaneTabbedContainer* GetTopContainer() const; /** * @brief * Call this member function to determine the direction of the * auto-hide panel. * @return * The auto-hide panel's direction. */ XTPDockingPaneDirection GetDirection() const; /** * @brief * Call this member function to determine if a child pane is active. * @return * TRUE if a child pane is active. */ BOOL IsActive() const; /** * @brief * Call this member to get the title of the pane. * @return * The title of the pane. */ CString GetTitle() const; /** * @brief * Call this member to determine the currently selected pane in the side panel. * @return * A pointer to the currently selected pane in the side panel. */ CXTPDockingPane* GetSelectedPane() const; public: /** * @brief * This method is called to collapse the frame. * @param bDelay TRUE to collapse the frame after a small delay with an animation. */ void Collapse(BOOL bDelay = FALSE); /** * @brief * Determines if the frame is collapsed. * @return * TRUE if the frame is collapsed, FALSE if the frame is visible. */ BOOL IsCollapsed() const; /** * @brief * Call this method to expand a collapsed frame. */ void Expand(); /** * @brief * Moves the side panel to the desired location. * @param direction The panel's direction. * @param rect Position of the side panel. */ void MovePanel(XTPDockingPaneDirection direction, CRect rect); /** * @brief * Determines if the caption is drawn vertically. * @return * TRUE if the caption is drawn vertically. */ virtual BOOL IsCaptionVertical() const; protected: /** * @brief * Constructs a CXTPDockingPaneSidePanel object. * Protected constructor. Internally constructed only. * @param pPane Child pane. * @param direction Direction to dock. * @param rc Position of the side panel. * @return * TRUE if successful, otherwise FALSE. */ BOOL Init(CXTPDockingPaneBase* pPane, XTPDockingPaneDirection direction, CRect rc); /** * @brief * Creates a frame window. * @param rc Specifies the size and position of the window. * @return * Nonzero if initialization was successful, otherwise 0. */ BOOL Create(CRect rc); # if _MSC_VER > 1200 using CFrameWnd::Create; using CMiniFrameWnd::Create; using CWnd::Create; # endif /** @cond */ static void AFX_CDECL OnSizeParentEx(CXTPDockingPaneManager* pManager, CWnd* pParent, CRect rect); protected: void DeletePane(); void OnFinalRelease(); void PostNcDestroy(); void OnFocusChanged(); void RecalcLayout(BOOL bNotify = TRUE); void RemovePane(CXTPDockingPaneBase* pPane); void OnChildContainerChanged(CXTPDockingPaneBase* pContainer); void CreateContainer(); /** @endcond */ /** * @brief * Copies a CXTPDockingPaneSidePanel object. * @param pClone Pointer to a CXTPDockingPaneSidePanel object. * @param pMap Pointer to a CXTPPaneToPaneMap object. * @param dwIgnoredOptions Options that must be skipped. * @see * CXTPPaneToPaneMap */ void Copy(CXTPDockingPaneBase* pClone, CXTPPaneToPaneMap* pMap, DWORD dwIgnoredOptions); /** * @brief * Call this member to insert a pane into the collection. * @param pPane Pointer to a CXTPDockingPaneBase object. */ void _InsertPane(CXTPDockingPaneBase* pPane); /** * @brief * Call this member to fill the pMinMaxInfo structure with the * minimum and maximum width and height of the splitter container. * This will look at the MinMaxInfo for each pane in the splitter * container and set the appropriate minimum and maximum width * and height for the splitter container. * @param pMinMaxInfo Pointer to a MINMAXINFO structure. */ void GetMinMaxInfo(LPMINMAXINFO pMinMaxInfo) const; /** * @brief * Call this member to determine if the side panel orientation * is horizontal. * @return * TRUE if the side panel orientation is horizontal, otherwise FALSE. */ BOOL IsHorizontal() const; /** * @brief * The framework calls this member function to determine whether * a point is in the bounding rectangle of the specified tool. * @param point Specifies the x- and y- coordinates of the cursor. These * coordinates are always relative to the upper-left * corner of the window. * @param pTI A pointer to a TOOLINFO structure. * @return * If the tooltip control was found, then the window control ID is returned. * If the tooltip control was not found, then a value of -1 is returned. */ INT_PTR OnToolHitTest(CPoint point, TOOLINFO* pTI) const; /** @cond */ BOOL OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult); /** @endcond */ /** * @brief * This member is called to save/restore the settings of the pane. * @param pPX Pointer to a CXTPPropExchange object. * @return * TRUE if successful, otherwise FALSE. */ virtual BOOL DoPropExchange(CXTPPropExchange* pPX); /** * @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); /** * @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. */ HWND GetPaneHwnd() const; protected: /** * @brief * This method is called to animate a collapsed frame. * @param bActivate TRUE to activate the frame. */ void DoSlideStep(BOOL bActivate = FALSE); /** * @brief * This member is called when the "pin" caption button is clicked. */ void OnPinButtonClick(); private: typedef CArray CSidePanelArray; static void AFX_CDECL OnSizeParentEx(CSidePanelArray& arrSide, CWnd* pParent, CRect rect); static int AFX_CDECL CompareLength(const void* arg1, const void* arg2); struct LENGTH; static void AFX_CDECL SortLength(LENGTH* pLength, int nFirstIndex, int nLastIndex); private: CXTPDockingPaneCaptionButton* HitTestCaptionButton(CPoint point) const; void OnCaptionButtonClick(CXTPDockingPaneCaptionButton* pButton); void OnCaptionLButtonDown(CPoint point); void _RestoreFocus(); BOOL IsCaptionButtonVisible(CXTPDockingPaneCaptionButton* pButton); void MovePanel(LENGTH* pLength, CRect rect); int GetMinHeight(); protected: /** @cond */ DECLARE_MESSAGE_MAP() //{{AFX_VIRTUAL(CXTPDockingPaneSidePanel) //}}AFX_VIRTUAL //{{AFX_MSG(CXTPDockingPaneSidePanel) afx_msg void OnPaint(); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg void OnMouseMove(UINT nFlags, CPoint point); afx_msg void OnMouseLeave(); afx_msg void OnTimer(UINT_PTR nIDEvent); afx_msg LRESULT OnMouseHover(WPARAM, LPARAM lParam); afx_msg LRESULT OnNcHitTest(CPoint point); afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint pt); afx_msg void OnRButtonUp(UINT /*nFlags*/, CPoint point); //}}AFX_MSG BOOL IsResizable(int nHit); /** @endcond */ # ifdef _XTP_ACTIVEX /** @cond */ private: DECLARE_DISPATCH_MAP() DECLARE_OLETYPELIB_EX(CXTPDockingPaneSidePanel); DECLARE_ENUM_VARIANT(CXTPDockingPaneSidePanel); DECLARE_INTERFACE_MAP() XTP_DECLARE_CMDTARGETPROVIDER_INTERFACE() 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(); /** @endcond */ # endif protected: XTPDockingPaneDirection m_direction; /**< Location of side panel. */ int m_nLengthIndex; int m_nStepsCount; /**< Total steps of animation process. */ int m_nSlideStep; /**< Current step of animation process. */ int m_nDeactivationCount; /**< Deactivation counter. */ BOOL m_bCollapsed; /**< Pane is collapsed. */ BOOL m_bExpanded; /**< Pane is expanded. */ BOOL m_bSlideOut; /**< Pane is currently expanding. */ friend class CXTPDockingPaneManager; friend class CXTPDockingPaneLayout; }; AFX_INLINE HWND CXTPDockingPaneSidePanel::GetPaneHwnd() const { return CWnd::GetSafeHwnd(); } AFX_INLINE XTPDockingPaneDirection CXTPDockingPaneSidePanel::GetDirection() const { return m_direction; } AFX_INLINE BOOL CXTPDockingPaneSidePanel::IsActive() const { return m_bActive; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // #if !defined(__XTPDOCKINGPANESIDEPANEL_H__) /** @endcond */