description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: CDockSite Class |
CDockSite Class |
10/18/2018 |
|
|
0fcfff79-5f50-4281-b2de-a55653bbea40 |
For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
Provides functionality for arranging panes that are derived from the CPane Class into sets of rows.
class CDockSite: public CBasePane
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.
[!code-cppNVC_MFC_RibbonApp#27]
CObject
└ CCmdTarget
└ CWnd
└ CBasePane
└ CDockSite
Header: afxDockSite.h
CDockingPanesRow* AddRow(
POSITION pos,
int nHeight);
[in] pos
[in] nHeight
virtual void AdjustDockingLayout();
virtual void AdjustLayout();
void AlignDockSite(
const CRect& rectToAlignBy,
CRect& rectResult,
BOOL bMoveImmediately);
[in] rectToAlignBy
[in] rectResult
[in] bMoveImmediately
virtual CSize CalcFixedLayout(
BOOL bStretch,
BOOL bHorz);
[in] bStretch
[in] bHorz
virtual BOOL CanAcceptPane(const CBasePane* pBar) const;
[in] pBar
virtual BOOL CreateEx(
DWORD dwStyleEx,
DWORD dwStyle,
const RECT& rect,
CWnd* pParentWnd,
DWORD dwControlBarStyle,
CCreateContext* pContext = NULL);
[in] dwStyleEx
[in] dwStyle
[in] rect
[in] pParentWnd
[in] dwControlBarStyle
[in] pContext
virtual CDockingPanesRow* CreateRow(
CDockSite* pParentDockBar,
int nOffset,
int nRowHeight);
[in] pParentDockBar
[in] nOffset
[in] nRowHeight
virtual void DockPane(
CPane* pWnd,
AFX_DOCK_METHOD dockMethod,
LPCRECT lpRect = NULL);
[in] pWnd
[in] dockMethod
[in] lpRect
Docks a pane to the left of another pane.
virtual BOOL DockPaneLeftOf(
CPane* pBarToDock,
CPane* pTargetBar);
pBarToDock
[in, out] A pointer to the pane to be docked to the left of pTargetBar.
pTargetBar
[in, out] A pointer to the target pane.
TRUE if the pane is docked successfully; otherwise, FALSE.
virtual BOOL DoesAllowDynInsertBefore() const;
Returns the pane with the given ID.
CPane* FindPaneByID(UINT nID);
nID
[in] The command ID of the pane to be found.
A pointer to the pane with the specified command ID, or NULL if the pane is not found.
int FindRowIndex(CDockingPanesRow* pRow);
[in] pRow
virtual void FixupVirtualRects();
virtual UINT GetDockSiteID() const;
const CObList& GetDockSiteRowsList() const;
Returns a list of panes that are docked in the dock site.
const CObList& GetPaneList() const;
A read-only reference to the list of panes currently docked in the docking bar.
virtual BOOL IsAccessibilityCompatible();
virtual BOOL IsDragMode() const;
bool IsLastRow(CDockingPanesRow* pRow) const;
[in] pRow
BOOL IsRectWithinDockSite(
CRect rect,
CPoint& ptDelta);
[in] rect
[in] ptDelta
virtual BOOL IsResizable() const;
virtual BOOL MovePane(
CPane* pWnd,
UINT nFlags,
CPoint ptOffset);
[in] pWnd
[in] nFlags
[in] ptOffset
virtual void OnInsertRow(POSITION pos);
[in] pos
virtual void OnRemoveRow(
POSITION pos,
BOOL bByShow = FALSE);
[in] pos
[in] bByShow
virtual int OnResizeRow(
CDockingPanesRow* pRowToResize,
int nOffset);
[in] pRowToResize
[in] nOffset
virtual void OnSizeParent(
CRect& rectAvailable,
UINT nSide,
BOOL bExpand,
int nOffset);
[in] rectAvailable
[in] nSide
[in] bExpand
[in] nOffset
virtual BOOL OnSetWindowPos(
const CWnd* pWndInsertAfter,
const CRect& rectWnd,
UINT nFlags);
[in] pWndInsertAfter
[in] rectWnd
[in] nFlags
virtual void OnShowRow(
POSITION pos,
BOOL bShow);
[in] pos
[in] bShow
Returns a pane that is docked in the dock site at the point specified by the given parameter.
virtual CPane* PaneFromPoint(CPoint pt);
pt
[in] A point, in screen coordinates, for the pane to retrieve.
A pointer to the pane located at the specified point or NULL if no pane was present at the specified point.
static int __stdcall RectSideFromPoint(
const CRect& rect,
const CPoint& point);
[in] rect
[in] point
virtual void RemovePane(
CPane* pWnd,
AFX_DOCK_METHOD dockMethod);
[in] pWnd
[in] dockMethod
void RemoveRow(CDockingPanesRow* pRow);
[in] pRow
BOOL ReplacePane(
CPane* pOldBar,
CPane* pNewBar);
[in] pOldBar
[in] pNewBar
virtual void RepositionPanes(CRect& rectNewClientArea);
[in] rectNewClientArea
void ResizeDockSite(
int nNewWidth,
int nNewHeight);
[in] nNewWidth
[in] nNewHeight
int ResizeRow(
CDockingPanesRow* pRow,
int nNewSize,
BOOL bAdjustLayout = TRUE);
[in] pRow
[in] nNewSize
[in] bAdjustLayout
Shows the pane.
virtual BOOL ShowPane(
CBasePane* pBar,
BOOL bShow,
BOOL bDelay,
BOOL bActivate);
pBar
[in, out] A pointer to the pane to be shown or hidden.
bShow
[in] TRUE to specify that the pane is to be shown; FALSE to specify that the pane is to be hidden.
bDelay
[in] TRUE to specify that the layout of the pane should be delayed until after the pane is shown; otherwise, FALSE.
bActivate
[in] This parameter is not used.
TRUE if the pane was shown or hidden successfully. FALSE if the specified pane does not belong to this dock site.
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.
void ShowRow(
CDockingPanesRow* pRow,
BOOL bShow,
BOOL bAdjustLayout);
[in] pRow
[in] bShow
[in] bAdjustLayout
void SwapRows(
CDockingPanesRow* pFirstRow,
CDockingPanesRow* pSecondRow);
[in] pFirstRow
[in] pSecondRow