CDockSite Class
The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.
The latest version of this topic can be found at CDockSite Class.
INCLUDEcpp_fp_under_construction]
Provides functionality for arranging panes that are derived from the CPane Class into sets of rows.
class CDockSite: public CBasePane
Public Methods
The framework creates CDockSite objects automatically when you call CFrameWndEx::EnableDocking. Dock site windows are positioned at the edge of the client area on the main frame window.
You usually do not have to call the services provided by the dock site because CFrameWndEx Class handles these services.
The following example demonstrates how to create an object of the CDockSite class.
AFX_DOCKSITE_INFO info; CDockSite* pDockBar = (CDockSite*) info.pDockBarRTC->CreateObject();
Header: afxDockSite.h
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
CDockingPanesRow* AddRow(
POSITION pos,
int nHeight);
Parameters
[in] pos
[in] nHeight
Return Value
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual void AdjustDockingLayout();
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual void AdjustLayout();
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
void AlignDockSite(
const CRect& rectToAlignBy,
CRect& rectResult,
BOOL bMoveImmediately);
Parameters
[in] rectToAlignBy
[in] rectResult
[in] bMoveImmediately
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual CSize CalcFixedLayout(
BOOL bStretch,
BOOL bHorz);
Parameters
[in] bStretch
[in] bHorz
Return Value
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual BOOL CanAcceptPane(const CBasePane* pBar) const;
Parameters
[in] pBar
Return Value
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual BOOL CreateEx(
DWORD dwStyleEx,
DWORD dwStyle,
const RECT& rect,
CWnd* pParentWnd,
DWORD dwControlBarStyle,
CCreateContext* pContext = NULL);
Parameters
[in] dwStyleEx
[in] dwStyle
[in] rect
[in] pParentWnd
[in] dwControlBarStyle
[in] pContext
Return Value
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual CDockingPanesRow* CreateRow(
CDockSite* pParentDockBar,
int nOffset,
int nRowHeight);
Parameters
[in] pParentDockBar
[in] nOffset
[in] nRowHeight
Return Value
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual void DockPane(
CPane* pWnd,
AFX_DOCK_METHOD dockMethod,
LPCRECT lpRect = NULL);
Parameters
[in] pWnd
[in] dockMethod
[in] lpRect
Remarks
Docks a pane to the left of another pane.
virtual BOOL DockPaneLeftOf(
CPane* pBarToDock,
CPane* pTargetBar);
Parameters
[in] [out] pBarToDock
A pointer to the pane to be docked to the left of pTargetBar.
[in] [out] pTargetBar
A pointer to the target pane.
Return Value
TRUE if the pane is docked successfully; otherwise, FALSE.
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual BOOL DoesAllowDynInsertBefore() const;
Return Value
Remarks
Returns the pane with the given ID.
CPane* FindPaneByID(UINT nID);
Parameters
[in] nID
The command ID of the pane to be found.
Return Value
A pointer to the pane with the specified command ID, or NULL if the pane is not found.
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
int FindRowIndex(CDockingPanesRow* pRow);
Parameters
[in] pRow
Return Value
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual void FixupVirtualRects();
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual UINT GetDockSiteID() const;
Return Value
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
const CObList& GetDockSiteRowsList() const;
Return Value
Remarks
Returns a list of panes that are docked in the dock site.
const CObList& GetPaneList() const;
Return Value
A read-only reference to the list of panes currently docked in the docking bar.
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual BOOL IsAccessibilityCompatible();
Return Value
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual BOOL IsDragMode() const;
Return Value
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
bool IsLastRow(CDockingPanesRow* pRow) const;
Parameters
[in] pRow
Return Value
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
BOOL IsRectWithinDockSite(
CRect rect,
CPoint& ptDelta);
Parameters
[in] rect
[in] ptDelta
Return Value
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual BOOL IsResizable() const;
Return Value
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual BOOL MovePane(
CPane* pWnd,
UINT nFlags,
CPoint ptOffset);
Parameters
[in] pWnd
[in] nFlags
[in] ptOffset
Return Value
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual void OnInsertRow(POSITION pos);
Parameters
[in] pos
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual void OnRemoveRow(
POSITION pos,
BOOL bByShow = FALSE);
Parameters
[in] pos
[in] bByShow
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual int OnResizeRow(
CDockingPanesRow* pRowToResize,
int nOffset);
Parameters
[in] pRowToResize
[in] nOffset
Return Value
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual void OnSizeParent(
CRect& rectAvailable,
UINT nSide,
BOOL bExpand,
int nOffset);
Parameters
[in] rectAvailable
[in] nSide
[in] bExpand
[in] nOffset
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual BOOL OnSetWindowPos(
const CWnd* pWndInsertAfter,
const CRect& rectWnd,
UINT nFlags);
Parameters
[in] pWndInsertAfter
[in] rectWnd
[in] nFlags
Return Value
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual void OnShowRow(
POSITION pos,
BOOL bShow);
Parameters
[in] pos
[in] bShow
Remarks
Returns a pane that is docked in the dock site at the point specified by the given parameter.
virtual CPane* PaneFromPoint(CPoint pt);
Parameters
[in] pt
A point, in screen coordinates, for the pane to retrieve.
Return Value
A pointer to the pane located at the specified point or NULL if no pane was present at the specified point.
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
static int __stdcall RectSideFromPoint(
const CRect& rect,
const CPoint& point);
Parameters
[in] rect
[in] point
Return Value
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual void RemovePane(
CPane* pWnd,
AFX_DOCK_METHOD dockMethod);
Parameters
[in] pWnd
[in] dockMethod
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
void RemoveRow(CDockingPanesRow* pRow);
Parameters
[in] pRow
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
BOOL ReplacePane(
CPane* pOldBar,
CPane* pNewBar);
Parameters
[in] pOldBar
[in] pNewBar
Return Value
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
virtual void RepositionPanes(CRect& rectNewClientArea);
Parameters
[in] rectNewClientArea
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
void ResizeDockSite(
int nNewWidth,
int nNewHeight);
Parameters
[in] nNewWidth
[in] nNewHeight
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
int ResizeRow(
CDockingPanesRow* pRow,
int nNewSize,
BOOL bAdjustLayout = TRUE);
Parameters
[in] pRow
[in] nNewSize
[in] bAdjustLayout
Return Value
Remarks
Shows the pane.
virtual BOOL ShowPane(
CBasePane* pBar,
BOOL bShow,
BOOL bDelay,
BOOL bActivate);
Parameters
[in] [out] pBar
A pointer to the pane to be shown or hidden.
[in] bShowTRUE to specify that the pane is to be shown; FALSE to specify that the pane is to be hidden.
[in] bDelayTRUE to specify that the layout of the pane should be delayed until after the pane is shown; otherwise, FALSE.
[in] bActivate
This parameter is not used.
Return Value
TRUE if the pane was shown or hidden successfully. FALSE if the specified pane does not belong to this dock site.
Remarks
Call this method to show or hide docked panes. Normally, you do not have to call CDockSite::ShowPane directly, because it is called by the parent frame window or by the base pane.
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
void ShowRow(
CDockingPanesRow* pRow,
BOOL bShow,
BOOL bAdjustLayout);
Parameters
[in] pRow
[in] bShow
[in] bAdjustLayout
Remarks
This topic is included for completeness. For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
void SwapRows(
CDockingPanesRow* pFirstRow,
CDockingPanesRow* pSecondRow);
Parameters
[in] pFirstRow
[in] pSecondRow