/** * @file XTPDockingPaneMiniWnd.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(__XTPDOCKINGPANEMINIWND_H__) # define __XTPDOCKINGPANEMINIWND_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * CXTPDockingPaneMiniWnd is a multiple inheritance class derived from * CMiniFrameWnd and CXTPDockingPaneBase. It is used internally as a * MiniWnd container for CXTPDockingPaneBase derived classes. */ class _XTP_EXT_CLASS CXTPDockingPaneMiniWnd : public CMiniFrameWnd , public CXTPDockingPaneBase { protected: /** * @brief * Constructs a CXTPDockingPaneMiniWnd object. * @param pLayout Parent layout pointer. */ CXTPDockingPaneMiniWnd(CXTPDockingPaneLayout* pLayout); /** * @brief * Destroys a CXTPDockingPaneMiniWnd object, handles cleanup and deallocation. */ ~CXTPDockingPaneMiniWnd(); public: /** * @brief * Determines if the frame is active. * @return * TRUE if the frame is active. */ 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 method to expand a collapsed frame. */ void Expand(); /** * @brief * Retrieves the top-level container of a floating frame. * @return * A pointer to the top-level container of a floating frame. */ CXTPDockingPaneSplitterContainer* GetTopPane() const; /** * @brief * Determines if the frame is collapsed. * @return True if collapse, false otherwise */ BOOL IsCollapsed() const; /** * @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 * 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). */ CString GetTitle() const; protected: /** * @brief * Copies self data from another pane. * @param pMap Internal parameter to map a pane to the copied pane. * @param dwIgnoredOptions Options that must be skipped. * @param pClone Pointer to a CXTPDockingPaneSidePanel object. * @see * CXTPPaneToPaneMap */ virtual void Copy(CXTPDockingPaneBase* pClone, CXTPPaneToPaneMap* pMap, DWORD dwIgnoredOptions); /** * @brief * Initializes the frame window. * @param pPane Child pane that will be placed to the frame. * @param rc Rectangle of the floating frame. */ virtual void Init(CXTPDockingPaneBase* pPane, CRect rc); protected: /** * @brief * Call this member to remove a pane from the collection. * @param pPane Pointer to a CXTPDockingPaneBase object to remove. */ virtual void RemovePane(CXTPDockingPaneBase* pPane); /** * @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 * 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. */ virtual BOOL DoPropExchange(CXTPPropExchange* pPX); /** * @brief * Creates a frame window. * @param rc Specifies the size and position of the window. * @return * Nonzero if initialization was successful, otherwise 0. */ virtual BOOL Create(CRect rc); /** * @brief * This member is called by the framework when a caption button * is clicked. * @param pButton Caption button that was clicked. */ virtual void OnCaptionButtonClick(CXTPDockingPaneCaptionButton* pButton); /** * @brief * This member is called by the framework when the mouse button is * pressed on a caption button. * @param pButton Caption button that is being clicked. * @return True when caption button is pressed, false otherwise */ virtual BOOL OnCaptionButtonDown(CXTPDockingPaneCaptionButton* pButton); /** * @brief * Call this member to determine the currently selected pane. * @return * A pointer to the currently selected pane. */ CXTPDockingPane* GetSelectedPane() const; /** * @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 * Call this member to determine if themed floating panes are used. * @return * TRUE is themed floating panes are used, otherwise FALSE. */ BOOL IsThemed() const; /** * @brief * This member is called when the theme is changed. */ void OnThemedChanged(); /** * @brief * Call this member to redraw the pane. */ void RedrawPane(); /** * @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 * Call this member to get the min/max information for the pane window. * @param pMinMaxInfo LPMINMAXINFO to fill with the min/max information. */ void GetMinMaxInfo(LPMINMAXINFO pMinMaxInfo) 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(); /** * @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 member is called to update the opacity of a floating frame. * @see * CXTPDockingPaneManager::SetFloatingFramesOpacity */ virtual void UpdateWindowOpacity(); /** * @brief * This method is called when focus is changed inside the application. */ void OnFocusChanged(); /** * @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 * This method is called if some action occurs. * @param action Docking pane action. * @return * TRUE if the action was canceled. */ BOOL OnAction(XTPDockingPaneAction action); /** * @brief * Creates a docking container. */ void CreateContainer(); /** @cond */ DECLARE_MESSAGE_MAP() //{{AFX_VIRTUAL(CXTPDockingPaneMiniWnd) public: virtual void RecalcLayout(BOOL bNotify = TRUE); protected: virtual void PostNcDestroy(); BOOL OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult); INT_PTR OnToolHitTest(CPoint point, TOOLINFO* pTI) const; void DeletePane(); void OnFinalRelease(); //}}AFX_VIRTUAL //{{AFX_MSG(CXTPDockingPaneMiniWnd) afx_msg void OnClose(); afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point); afx_msg void OnNcLButtonDblClk(UINT nHitTest, CPoint point); afx_msg void OnDestroy(); afx_msg LRESULT OnNcHitTest(CPoint point); afx_msg void OnNcPaint(); afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp); afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point); afx_msg void OnTimer(UINT_PTR nIDEvent); afx_msg void OnIdleUpdateCmdUI(); afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI); afx_msg void OnSetFocus(CWnd* pOldWnd); afx_msg void OnNcRButtonUp(UINT nHitTest, CPoint point); afx_msg void OnContextMenu(CWnd* pWnd, CPoint pos); afx_msg BOOL OnNcActivate(BOOL bActive); afx_msg void OnSizing(UINT nSide, LPRECT lpRect); //}}AFX_MSG /** @endcond */ # ifdef _XTP_ACTIVEX /** @cond */ private: DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() XTP_DECLARE_CMDTARGETPROVIDER_INTERFACE() DECLARE_OLETYPELIB_EX(CXTPDockingPaneMiniWnd); DECLARE_ENUM_VARIANT(CXTPDockingPaneMiniWnd); 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 private: BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL); BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle = WS_OVERLAPPEDWINDOW, const RECT& rect = rectDefault, CWnd* pParentWnd = NULL, LPCTSTR lpszMenuName = NULL, DWORD dwExStyle = 0, CCreateContext* pContext = NULL); BOOL Create(LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd = NULL, UINT nID = 0); void UpdatePosition(); public: static BOOL m_bShowPinButton; /**< TRUE to show pin button of the frame. */ protected: CXTPDockingPaneSplitterContainer* m_pTopContainer; /**< Top-level container. */ BOOL m_bCloseEnabled; /**< Close button of frame is enabled. */ int m_nExpandedHeight; /**< Expanded height of the frame. */ int m_nStepsCount; /**< Total steps of animation process. */ int m_nSlideStep; /**< Current step of the 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. */ BOOL m_bDelayInvalidate; /**< TRUE to redraw the frame after a small delay. */ DECLARE_DYNAMIC(CXTPDockingPaneMiniWnd) friend class CXTPDockingPaneManager; friend class CXTPDockingPaneLayout; }; AFX_INLINE CString CXTPDockingPaneMiniWnd::GetTitle() const { CString strTitle; GetWindowText(strTitle); return strTitle; } AFX_INLINE CXTPDockingPaneSplitterContainer* CXTPDockingPaneMiniWnd::GetTopPane() const { return m_pTopContainer; } AFX_INLINE BOOL CXTPDockingPaneMiniWnd::IsActive() const { return m_bActive; } AFX_INLINE BOOL CXTPDockingPaneMiniWnd::IsCaptionVertical() const { return FALSE; /**< Floating pane always has horizontal caption */ } AFX_INLINE BOOL CXTPDockingPaneMiniWnd::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) { return CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext); } AFX_INLINE BOOL CXTPDockingPaneMiniWnd::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, LPCTSTR lpszMenuName, DWORD dwExStyle, CCreateContext* pContext) { return CFrameWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, lpszMenuName, dwExStyle, pContext); } AFX_INLINE BOOL CXTPDockingPaneMiniWnd::Create(LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID) { return CMiniFrameWnd::Create(lpClassName, lpWindowName, dwStyle, rect, pParentWnd, nID); } AFX_INLINE BOOL CXTPDockingPaneMiniWnd::IsCollapsed() const { return m_bCollapsed; } AFX_INLINE HWND CXTPDockingPaneMiniWnd::GetPaneHwnd() const { return CWnd::GetSafeHwnd(); } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // #if !defined(__XTPDOCKINGPANEMINIWND_H__) /** @endcond */