CAutoHideDockSite Class

 

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

The CAutoHideDockSite extends the CDockSite Class to implement auto-hide dock panes.

class CAutoHideDockSite : public CDockSite  

Public Constructors

NameDescription
CAutoHideDockSite::CAutoHideDockSiteConstructs a CAutoHideDockSite object.
CAutoHideDockSite::~CAutoHideDockSiteDestructor.

Public Methods

NameDescription
CAutoHideDockSite::AllowShowOnPaneMenuIndicates whether the CAutoHideDockSite is shown on the pane menu.
CAutoHideDockSite::CanAcceptPaneDetermines whether a base pane object is derived from the CMFCAutoHideBar Class.
CAutoHideDockSite::DockPaneDocks a pane to this CAuotHideDockSite object.
CAutoHideDockSite::GetAlignRectRetrieves the size of the dock site in screen coordinates.
CAutoHideDockSite::RepositionPanesRedraws the pane on the CAutoHideDockSite with the global margins and button spacing.
CAutoHideDockSite::SetOffsetLeftSets the margin on the left side of the docking bar.
CAutoHideDockSite::SetOffsetRightSets the margin on the right side of the docking bar.
CAutoHideDockSite::UnSetAutoHideModeCalls CMFCAutoHideBar::UnSetAutoHideMode for objects on the CAutoHideDockSite.

Data Members

NameDescription
CAutoHideDockSite::m_nExtraSpaceDefines the size of the space between the toolbars and the edge of the docking bar. This space is measured from either the left edge or the top edge, depending on the alignment for the dock space.

When you call CFrameWndEx::EnableAutoHidePanes, the framework automatically creates a CAutoHideDockSite object. In most cases, you should not have to instantiate or use this class directly.

The docking bar is the gap between the left side of the dock pane and the left side of the CMFCAutoHideButton Class.

CObject

CCmdTarget

CWnd

CBasePane

CDockSite

The following example demonstrates how to retrieve a CAutoHideDockSite object from a CMFCAutoHideBar object, and how to set the left and right margins of the docking bar.

	CAutoHideDockSite* pParentDockBar = DYNAMIC_DOWNCAST(CAutoHideDockSite, pParentBar->GetParentDockSite());
    pParentDockBar->SetOffsetLeft(10);
	pParentDockBar->SetOffsetRight(10);

Header: afxautohidedocksite.h

Determines whether a base pane is a CMFCAutoHideBar object or derived from CMFCAutoHideBar.

virtual BOOL CanAcceptPane(const CBasePane* pBar) const;  

Parameters

ParameterDescription
[in] pBarThe base pane that the framework tests.

Return Value

TRUE if pBar is derived from CMFCAutoHideBar; FALSE otherwise.

Remarks

If a base pane object is derived from CMFCAutoHideBar, it can contain a CAutoHideDockSite.

Docks a pane to this CAutoHideDockSite object.

virtual void DockPane(
    CPane* pWnd,  
    AFX_DOCK_METHOD dockMethod,  
    LPRECT lpRect = NULL);

Parameters

ParameterDescription
[in] pWndThe pane that the framework docks.
[in] dockMethodDocking options for the pane.
[in] lpRectA rectangle that specifies the boundaries for the docked pane.

Remarks

The default implementation does not use the parameter dockMethod, which is provided for future use.

If lpRect is NULL, the framework puts the pane in the default location on the dock site. If the dock site is horizontal, the default location is at the far left of the dock site. Otherwise, the default location is at the top of the dock site.

Retrieves the size of the dock site in screen coordinates.

void GetAlignRect(CRect& rect) const;  

Parameters

ParameterDescription
[in] rectA reference to a rectangle. The method stores the size of the dock site in this rectangle.

Remarks

The rectangle is adjusted for the offset margins so that they are not included.

The size of the space between the edges of the CAutoHideDockSite Class and the CMFCAutoHideBar Class objects.

static int m_nExtraSpace;  

Remarks

When a CMFCAutoHideBar is docked at a CAutoHideDockSite, it should not occupy the whole dock site. This global variable controls the extra space between the left or top border of the CMFCAutoHideBar and the corresponding CAutoHideDockSite edge. Whether the top or left edge is used depends on the current alignment.

Sets the margin on the left side of the docking bar.

void SetOffsetLeft(int nOffset);

Parameters

[in] nOffset
The new offset.

Remarks

CMFCAutoHideBar objects are positioned statically on the CAutoHideDockSite object. This means that the user cannot manually change the location of CMFCAutoHideBar objects. The SetOffsetLeft method controls the spacing between the left side of the left-most CMFCAutoHideBar and the left side of the CAutoHideDockSite.

Sets the margin on the right side of the docking bar.

void SetOffsetRight(int nOffset);

Parameters

[in] nOffset
The new offset.

Remarks

CMFCAutoHideBar objects are positioned statically on the CAutoHideDockSite object. This means that the user cannot manually change the location of the CMFCAutoHideBar objects. The SetOffsetRight method controls the spacing between the right side of the right-most CMFCAutoHideBar and the right side of the CAutoHideDockSite.

Redraws the panes on the CAutoHideDockSite.

virtual void RepositionPanes(CRect& rectNewClientArea);

Parameters

ParameterDescription
[in] rectNewClientAreaA reserved value.

Remarks

The default implementation does not use rectNewClientArea. It redraws the panes with the global toolbar margins and button spacing.

Calls CMFCAutoHideBar::UnSetAutoHideMode for objects on the dock site.

void UnSetAutoHideMode(CMFCAutoHideBar* pAutoHideToolbar);

Parameters

ParameterDescription
[in] pAutoHideToolbarA pointer to a CMFCAutoHideBar object pane located on the CAutoHideDockSite.

Remarks

This method searches for the row that contains pAutoHideToolbar. It calls CMFCAutoHideBar.UnSetAutoHideMode for all the CMFCAutoHideBar objects on that row. If pAutoHideToolbar is not found or it is NULL, this method calls CMFCAutoHideBar.UnSetAutoHideMode for all the CMFCAutoHideBar objects on the CAutoHideDockSite.

Hierarchy Chart
Classes
CDockSite Class

Show: