description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: CAutoHideDockSite Class |
CAutoHideDockSite Class |
11/04/2016 |
|
|
2a0f6bec-c369-4ab7-977d-564e7946ebad |
The CAutoHideDockSite
extends the CDockSite Class to implement auto-hide dock panes.
class CAutoHideDockSite : public CDockSite
Name | Description |
---|---|
Name | Description |
CAutoHideDockSite::CAutoHideDockSite |
Constructs a CAutoHideDockSite object. |
CAutoHideDockSite::~CAutoHideDockSite |
Destructor. |
Name | Description |
---|---|
Name | Description |
CAutoHideDockSite::AllowShowOnPaneMenu |
Indicates whether the CAutoHideDockSite is shown on the pane menu. |
CAutoHideDockSite::CanAcceptPane | Determines whether a base pane object is derived from the CMFCAutoHideBar Class. |
CAutoHideDockSite::DockPane | Docks a pane to this CAuotHideDockSite object. |
CAutoHideDockSite::GetAlignRect | Retrieves the size of the dock site in screen coordinates. |
CAutoHideDockSite::RepositionPanes | Redraws the pane on the CAutoHideDockSite with the global margins and button spacing. |
CAutoHideDockSite::SetOffsetLeft | Sets the margin on the left side of the docking bar. |
CAutoHideDockSite::SetOffsetRight | Sets the margin on the right side of the docking bar. |
CAutoHideDockSite::UnSetAutoHideMode | Calls CMFCAutoHideBar::UnSetAutoHideMode for objects on the CAutoHideDockSite . |
Name | Description |
---|---|
Name | Description |
CAutoHideDockSite::m_nExtraSpace | Defines 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.
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.
[!code-cppNVC_MFC_RibbonApp#29]
Header: afxautohidedocksite.h
Determines whether a base pane is a CMFCAutoHideBar object or derived from CMFCAutoHideBar
.
virtual BOOL CanAcceptPane(const CBasePane* pBar) const;
pBar
[in] The base pane that the framework tests.
TRUE if pBar is derived from CMFCAutoHideBar
; FALSE otherwise.
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);
pWnd
[in] The pane that the framework docks.
dockMethod
[in] Docking options for the pane.
lpRect
[in] A rectangle that specifies the boundaries for the docked pane.
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;
rect
[in] A reference to a rectangle. The method stores the size of the dock site in this rectangle.
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;
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);
nOffset
[in] The new offset.
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);
nOffset
[in] The new offset.
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);
rectNewClientArea
[in] A reserved value.
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);
pAutoHideToolbar
[in] A pointer to a CMFCAutoHideBar object pane located on the CAutoHideDockSite
.
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
.