CPaneContainer Class
The CPaneContainer
class is a basic component of the docking model implemented by MFC. An object of this class stores pointers to two docking panes or to two instances of CPaneContainer
. It also stores a pointer to the divider that separates the panes (or the containers). By nesting containers inside containers, the framework can build a binary tree that represents complex docking layouts. The root of the binary tree is stored in a CPaneContainerManager object.
For more detail see the source code located in the VC\atlmfc\src\mfc folder of your Visual Studio installation.
class CPaneContainer : public CObject
Name | Description |
---|---|
CPaneContainer::CPaneContainer | Default constructor. |
CPaneContainer
objects are created automatically by the framework.
The following example demonstrates how to construct an instance of the CPaneContainer
class. This code snippet is part of the Set Pane Size sample.
CPaneDialog m_wndDlgBar;
CPaneDivider *pDefaultPaneDivider = m_wndDlgBar.GetDefaultPaneDivider();
if (pDefaultPaneDivider == NULL)
{
AfxMessageBox(_T ("The DialogBar is not docked."));
return;
}
BOOL bLeftBar = FALSE;
CPaneContainer *pContainer = pDefaultPaneDivider->FindPaneContainer(&m_wndDlgBar, bLeftBar);
Header: afxpanecontainer.h
CDockablePane* AddPane(CDockablePane* pBar);
[in] pBar
void AddRef();
BOOL AddSubPaneContainer(
CPaneContainer* pContainer,
BOOL bRightNodeNew);
[in] pContainer
[in] bRightNodeNew
virtual int CalcAvailablePaneSpace(
int nRequiredOffset,
CPane* pBar,
CPaneContainer* pContainer,
BOOL bLeftBar);
[in] nRequiredOffset
[in] pBar
[in] pContainer
[in] bLeftBar
virtual CSize CalcAvailableSpace(
CSize sizeStretch,
BOOL bLeftBar);
[in] sizeStretch
[in] bLeftBar
void CalculateRecentSize();
void CheckPaneDividerVisibility();
virtual CPaneContainer* Copy(CPaneContainer* pParentContainer);
[in] pParentContainer
CPaneContainer(
CPaneContainerManager* pManager = NULL,
CDockablePane* pLeftBar = NULL,
CDockablePane* pRightBar = NULL,
CPaneDivider* pSlider = NULL);
[in] pManager
[in] pLeftBar
[in] pRightBar
[in] pSlider
virtual void DeletePane(
CDockablePane* pBar,
BC_FIND_CRITERIA barType);
[in] pBar
[in] barType
CPaneContainer* FindSubPaneContainer(
const CObject* pObject,
BC_FIND_CRITERIA findCriteria);
[in] pObject
[in] findCriteria
CDockablePane* FindTabbedPane(UINT nID);
[in] nID
CList<UINT, UINT>* GetAssociatedSiblingPaneIDs(CDockablePane* pBar);
[in] pBar
const CDockablePane* GetLeftPane() const;
const CPaneContainer* GetLeftPaneContainer() const;
virtual void GetMinSize(CSize& size) const;
[in] size
virtual void GetMinSizeLeft(CSize& size) const;
[in] size
virtual void GetMinSizeRight(CSize& size) const;
[in] size
int GetNodeCount() const;
const CPaneDivider* GetPaneDivider() const;
CPaneContainer* GetParentPaneContainer() const;
CRect GetRecentPaneDividerRect() const;
DWORD GetRecentPaneDividerStyle() const;
int GetRecentPercent();
LONG GetRefCount();
virtual int GetResizeStep() const;
const CDockablePane* GetRightPane() const;
const CPaneContainer* GetRightPaneContainer() const;
int GetTotalReferenceCount() const;
virtual void GetWindowRect(
CRect& rect,
BOOL bIgnoreVisibility = FALSE) const;
[in] rect
[in] bIgnoreVisibility
BOOL IsDisposed() const;
BOOL IsEmpty() const;
BOOL IsLeftPane(CDockablePane* pBar) const;
[in] pBar
BOOL IsLeftPaneContainer() const;
BOOL IsLeftPartEmpty(BOOL bCheckVisibility = FALSE) const;
[in] bCheckVisibility
BOOL IsRightPartEmpty(BOOL bCheckVisibility = FALSE) const;
[in] bCheckVisibility
BOOL IsVisible() const;
virtual void Move(CPoint ptNewLeftTop);
[in] ptNewLeftTop
void OnDeleteHidePane(
CDockablePane* pBar,
BOOL bHide);
[in] pBar
[in] bHide
virtual int OnMoveInternalPaneDivider(
int nOffset,
HDWP& hdwp);
[in] nOffset
[in] hdwp
virtual void OnShowPane(
CDockablePane* pBar,
BOOL bShow);
[in] pBar
[in] bShow
DWORD Release();
void ReleaseEmptyPaneContainer();
void RemoveNonValidPanes();
virtual void RemovePane(CDockablePane* pBar);
[in] pBar
virtual void Resize(
CRect rect,
HDWP& hdwp,
BOOL bRedraw = FALSE);
[in] rect
[in] hdwp
[in] bRedraw
virtual void ResizePane(
int nOffset,
CPane* pBar,
CPaneContainer* pContainer,
BOOL bHorz,
BOOL bLeftBar,
HDWP& hdwp);
[in] nOffset
[in] pBar
[in] pContainer
[in] bHorz
[in] bLeftBar
[in] hdwp
virtual void ResizePartOfPaneContainer(
int nOffset,
BOOL bLeftPart,
HDWP& hdwp);
[in] nOffset
[in] bLeftPart
[in] hdwp
void Serialize(CArchive& ar);
[in] ar
void SetPane(
CDockablePane* pBar,
BOOL bLeft);
[in] pBar
[in] bLeft
void SetPaneContainer(
CPaneContainer* pContainer,
BOOL bLeft);
[in] pContainer
[in] bLeft
void SetPaneDivider(CPaneDivider* pSlider);
[in] pSlider
void SetParentPaneContainer(CPaneContainer* p);
[in] p
void SetRecentPercent(int nRecentPercent);
[in] nRecentPercent
BOOL SetUpByID(
UINT nID,
CDockablePane* pBar);
[in] nID
[in] pBar
virtual void StoreRecentDockSiteInfo(CDockablePane* pBar);
[in] pBar
virtual int StretchPaneContainer(
int nOffset,
BOOL bStretchHorz,
BOOL bLeftBar,
BOOL bMoveSlider,
HDWP& hdwp);
[in] nOffset
[in] bStretchHorz
[in] bLeftBar
[in] bMoveSlider
[in] hdwp
Hierarchy Chart
Classes
CObject Class
CPaneContainerManager Class