/** * @file XTPDockBar.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(__XTPDOCKBAR_H__) # define __XTPDOCKBAR_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPToolBar; class CXTPCommandBars; /** * @brief * CXTPDockBar is a CWnd derived class. * It is used internally by CXTPCommandBars. */ class _XTP_EXT_CLASS CXTPDockBar : public CWnd { private: /** @cond */ DECLARE_DYNCREATE(CXTPDockBar) /** @endcond */ public: /** * @brief * Array of CXTPToolBar objects. */ typedef CArray CToolBarArray; private: class CDockInfoArray; struct DOCK_INFO; public: /** * @brief * Constructs a CXTPDockBar object. */ CXTPDockBar(); /** * @brief * Destroys a CXTPDockBar object, handles cleanup and deallocation. */ virtual ~CXTPDockBar(); public: /** * @brief * Retrieves the dockbar position. * @return * Position of the dock bar. */ XTPBarPosition GetPosition() const; /** * @brief * Checks if dockbar is vertical. * @return * TRUE if docked vertically, otherwise FALSE. */ BOOL IsVerticalPosition() const; CXTPCommandBars* GetCommandBars() const; protected: /** @cond */ // Implementation BOOL RemoveCommandBar(CXTPToolBar* pBar, int nPosExclude = -1); BOOL Create(CWnd* pParentWnd, DWORD dwStyle, UINT nID); BOOL PreCreateWindow(CREATESTRUCT& cs); BOOL DockCommandBar(CXTPToolBar* bBar); void DockCommandBar(CXTPToolBar* pBar, LPCRECT lpRect); CXTPToolBar* GetDockedCommandBar(int nPos) const; int GetDockedCount() const; int GetDockedVisibleCount() const; int FindBar(CXTPToolBar* pBar, int nPosExclude = -1); int Insert(CXTPToolBar* pBarIns, CRect rect, CPoint ptMid); void GetVisibleToolbars(int nPos, CToolBarArray& arrBars); void AdjustStretchBars(); int AdjustRow(CToolBarArray&, CPoint pt, int nLength, BOOL bHorz, AFX_SIZEPARENTPARAMS* lpLayout); int _AdjustRow(CToolBarArray&, CPoint pt, int nLength, BOOL bHorz, AFX_SIZEPARENTPARAMS* lpLayout, int& nRemove); int _GetMode(BOOL bHorz, CXTPToolBar* pBar); CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz, AFX_SIZEPARENTPARAMS* lpLayout); CSize CalcDynamicLayout(int, DWORD nMode, AFX_SIZEPARENTPARAMS* lpLayout); /** @endcond */ protected: /** @cond */ //{{AFX_MSG(CXTPDockBar) DECLARE_MESSAGE_MAP() afx_msg void OnPaint(); afx_msg LRESULT OnPrintClient(WPARAM wParam, LPARAM); afx_msg BOOL OnEraseBkgnd(CDC* pDC); afx_msg void OnRButtonDown(UINT nFlags, CPoint point); afx_msg LRESULT OnSizeParent(WPARAM, LPARAM lParam); afx_msg LRESULT OnNcHitTest(CPoint /*point*/); afx_msg void OnSize(UINT nType, int cx, int cy); //}}AFX_MSG /** @endcond */ private: BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL); protected: DWORD m_dwStyle; /**< Style of the control. */ CToolBarArray m_arrBars; /**< Toolbar list. */ CXTPCommandBars* m_pCommandBars; /**< Parent CommandBars object. */ friend class CXTPToolBar; friend class CXTPCommandBars; friend class CXTPReBar; }; AFX_INLINE BOOL CXTPDockBar::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 CXTPCommandBars* CXTPDockBar::GetCommandBars() const { return m_pCommandBars; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif // #if !defined(__XTPDOCKBAR_H__) /** @endcond */