/** * @file Workspace.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(__XTPTABCLIENTWND_WORKSPACE_H__) # define __XTPTABCLIENTWND_WORKSPACE_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPTabClientContext; /** * @brief * CWorkspace is a CXTPTabManager derived class. internal used. */ class _XTP_EXT_CLASS CXTPTabClientWnd::CWorkspace : public CXTPTabManager { public: /** * @brief * Constructs a CWorkspace object */ CWorkspace(); /** * @brief * Destroys a CWorkspace object, handles cleanup and deallocation. */ virtual ~CWorkspace(); protected: /** * @brief * Retrieves the paint manager. * @return * A pointer to a CXTPTabPaintManager object. */ virtual CXTPTabPaintManager* GetPaintManager() const; /** * @brief * This member is called when a tab navigation button is clicked. * @param pButton the tab navigation button that was clicked. */ virtual void OnNavigateButtonClick(CXTPTabManagerNavigateButton* pButton); /** * @brief * This member is called when a tab navigation button is clicked. * @param nID An integer identifier. */ virtual void OnNavigateButtonClick(UINT nID); /** * @brief * This member is called when a tab button is clicked. This * will select the tab that was clicked. * @param pItem Pointer to the CXTPTabManagerItem tab that was clicked. */ virtual void OnItemClick(CXTPTabManagerItem* pItem); /** * @brief * This method is called before item click * @param pItem Pointer to item is about to be clicked * @return * TRUE if cancel process */ virtual BOOL OnBeforeItemClick(CXTPTabManagerItem* pItem); /** * @brief * This member recalculates the layout of the tab manager and * then repositions itself. This member must be overridden in * derived classes. */ virtual void Reposition(); /** * @brief * This member is called when the icon of the tab needs to be * drawn. * @param pDC Pointer to the destination device context. * @param pt Specifies the location of the image. * @param pItem CXTPTabManagerItem object to draw icon on. * @param bDraw TRUE if the icon needs to be drawn, I.e. the icon size * changed. FALSE if the icon does not need to be * drawn or redrawn. * @param szIcon Size of the tab icon. * @details * For example, on mouseover. This member is overridden by its * descendants. This member must be overridden in * derived classes. * @return * TRUE if the icon was successfully drawn, FALSE if the icon * was not drawn. */ virtual BOOL DrawIcon(CDC* pDC, CPoint pt, CXTPTabManagerItem* pItem, BOOL bDraw, CSize& szIcon) const; /** * @brief * Initiates redrawing of the control * @details * Call this member function if you want to initialize redrawing * of the control. The control will be redrawn taking into account * its latest state. * @param lpRect The rectangular area of the window that is invalid. * @param bAnimate TRUE to animate changes in bounding rectangle. */ virtual void RedrawControl(LPCRECT lpRect, BOOL bAnimate); /** * @brief * Call this member to select the specified item. * @param pItem Points to a CXTPTabManagerItem object. */ virtual void SetSelectedItem(CXTPTabManagerItem* pItem); /** * @brief * This member is called when a CXTPTabManagerItem is clicked * and dragged within the tab header. This will reorder the * selected tab to the location it is dragged to. * @param hWnd Handle to the CWnd object beneath the mouse cursor. * @param pt CPoint object specifies xy coordinates. * @param pItem Points to a CXTPTabManagerItem object */ virtual void ReOrder(HWND hWnd, CPoint pt, CXTPTabManagerItem* pItem); /** * @brief * Checks to see if the mouse is locked. * @return * TRUE if locked; otherwise returns FALSE. */ virtual BOOL IsMouseLocked() const; /** * @brief * Returns the tooltip associated with the specified item. * @param pItem Points to a CXTPTabManagerItem object. * @return * Associated tooltip */ virtual CString GetItemTooltip(const CXTPTabManagerItem* pItem) const; /** * @brief * Returns whether or not reorder is allowed. * @return * TRUE when reorder is allowed; FALSE otherwise. */ virtual BOOL IsAllowReorder() const; /** * @brief * Allows/disallows reorder. * @param bAllowReorder TRUE for allowing reorder; FALSE for disallowing. */ virtual void SetAllowReorder(BOOL bAllowReorder); /** * @brief * Determines if frame must be drawn. */ virtual BOOL IsDrawStaticFrame() const; /** * @brief * This method is called to get window handle of workspace */ virtual CWnd* GetWindow() const; protected: /** * @brief * Finds the tab item that corresponds to the specified window * @param hWnd Handle of MDI child window to find. * @return * Returns a pointer to the specified tab if it was found. */ CXTPTabManagerItem* FindItem(const HWND hWnd) const; /** * @brief * Adds new tab item for the specified window * @param pChildWnd Pointer to MDI child window to add. * @return * Returns a pointer to the newly added tab. */ CXTPTabManagerItem* AddItem(const CWnd* pChildWnd); /** * @brief * This member function gets the index for the current icon. * @param pItem Pointer to a CXTPTabManagerItem. * @return * An icon index for the current item. */ HICON GetItemIcon(const CXTPTabManagerItem* pItem) const; /** * @brief * This member function returns the RGB value for the referenced * item text or (COLORREF)-1, if the color was not set. * @param pItem Pointer to a CXTPTabManagerItem. * @return * The RGB value for the referenced item text, or (COLORREF)-1, * if the color was not set */ COLORREF GetItemColor(const CXTPTabManagerItem* pItem) const; /** * @brief * This method is called to recalculate layout of tab client */ virtual void OnRecalcLayout(); protected: /** * @brief Returns markup context. * @return Returns markup context. */ virtual CXTPMarkupContext* GetMarkupContext() const; virtual void AddNewWindowItem(); BOOL DrawParentBackground(CDC* pDC, CRect rc); int GetTabStickerAction(POINT pos, CWorkspace** pWorkspace); int GetTabStickerAction(); int GetTabSideAction(POINT pos, CXTPTabManagerItem* pItem, CWorkspace** pWorkspace, CRect& rcDragRect); int GetTabSideAction(CXTPTabClientWnd* pTarget, POINT pos, CRect& rcDragRect); # ifndef _XTP_COMMANDBARS_ACTIVEX # ifdef _XTP_INCLUDE_DOCKINGPANE int GetDockStickerAction(); int GetDockSideAction(CXTPDockingPaneTabbedContainer* pTarget, POINT pos, CRect& rcDragRect); # endif # endif protected: CXTPTabClientWnd* m_pTabClientWnd; /**< Parent tabbed client.*/ double m_dHeight; /**< Height of the workspace*/ CRect m_rcSplitter; /**< Splitter position.*/ CXTPTabManagerItem* m_pNewWindowItem; friend class CXTPTabClientWnd; friend class CXTPTearOffFrame; }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" /** @cond */ #endif //#if !defined(__XTPTABCLIENTWND_WORKSPACE_H__) /** @endcond */