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.

Syntax

class CPaneContainer : public CObject

Members

Public Constructors

Name Description
CPaneContainer::CPaneContainer Default constructor.

Public Methods

Name Description
CPaneContainer::AddPane
CPaneContainer::AddRef
CPaneContainer::AddSubPaneContainer
CPaneContainer::CalcAvailablePaneSpace
CPaneContainer::CalcAvailableSpace
CPaneContainer::CalculateRecentSize
CPaneContainer::CheckPaneDividerVisibility
CPaneContainer::Copy
CPaneContainer::DeletePane
CPaneContainer::FindSubPaneContainer
CPaneContainer::FindTabbedPane
CPaneContainer::GetAssociatedSiblingPaneIDs
CPaneContainer::GetLeftPane
CPaneContainer::GetLeftPaneContainer
CPaneContainer::GetMinSize
CPaneContainer::GetMinSizeLeft
CPaneContainer::GetMinSizeRight
CPaneContainer::GetNodeCount
CPaneContainer::GetPaneDivider
CPaneContainer::GetParentPaneContainer
CPaneContainer::GetRecentPaneDividerRect
CPaneContainer::GetRecentPaneDividerStyle
CPaneContainer::GetRecentPercent
CPaneContainer::GetRefCount
CPaneContainer::GetResizeStep
CPaneContainer::GetRightPane
CPaneContainer::GetRightPaneContainer
CPaneContainer::GetTotalReferenceCount
CPaneContainer::GetWindowRect
CPaneContainer::IsDisposed
CPaneContainer::IsEmpty
CPaneContainer::IsLeftPane
CPaneContainer::IsLeftPaneContainer
CPaneContainer::IsLeftPartEmpty
CPaneContainer::IsRightPartEmpty
CPaneContainer::IsVisible
CPaneContainer::Move
CPaneContainer::OnDeleteHidePane
CPaneContainer::OnMoveInternalPaneDivider
CPaneContainer::OnShowPane
CPaneContainer::Release
CPaneContainer::ReleaseEmptyPaneContainer
CPaneContainer::RemoveNonValidPanes
CPaneContainer::RemovePane
CPaneContainer::Resize
CPaneContainer::ResizePane
CPaneContainer::ResizePartOfPaneContainer
CPaneContainer::Serialize Reads or writes this object from or to an archive. (Overrides CObject::Serialize.)
CPaneContainer::SetPane
CPaneContainer::SetPaneContainer
CPaneContainer::SetPaneDivider
CPaneContainer::SetParentPaneContainer
CPaneContainer::SetRecentPercent
CPaneContainer::SetUpByID
CPaneContainer::StoreRecentDockSiteInfo
CPaneContainer::StretchPaneContainer

Remarks

CPaneContainer objects are created automatically by the framework.

Example

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);

Inheritance Hierarchy

CObject

CPaneContainer

Requirements

Header: afxpanecontainer.h

CPaneContainer::AddPane

CDockablePane* AddPane(CDockablePane* pBar);

Parameters

[in] pBar

Return Value

Remarks

CPaneContainer::AddRef

void AddRef();

Remarks

CPaneContainer::AddSubPaneContainer

BOOL AddSubPaneContainer(
    CPaneContainer* pContainer,
    BOOL bRightNodeNew);

Parameters

[in] pContainer
[in] bRightNodeNew

Return Value

Remarks

CPaneContainer::CalcAvailablePaneSpace

virtual int CalcAvailablePaneSpace(
    int nRequiredOffset,
    CPane* pBar,
    CPaneContainer* pContainer,
    BOOL bLeftBar);

Parameters

[in] nRequiredOffset
[in] pBar
[in] pContainer
[in] bLeftBar

Return Value

Remarks

CPaneContainer::CalcAvailableSpace

virtual CSize CalcAvailableSpace(
    CSize sizeStretch,
    BOOL bLeftBar);

Parameters

[in] sizeStretch
[in] bLeftBar

Return Value

Remarks

CPaneContainer::CalculateRecentSize

void CalculateRecentSize();

Remarks

CPaneContainer::CheckPaneDividerVisibility

void CheckPaneDividerVisibility();

Remarks

CPaneContainer::Copy

virtual CPaneContainer* Copy(CPaneContainer* pParentContainer);

Parameters

[in] pParentContainer

Return Value

Remarks

CPaneContainer::CPaneContainer

CPaneContainer(
    CPaneContainerManager* pManager = NULL,
    CDockablePane* pLeftBar = NULL,
    CDockablePane* pRightBar = NULL,
    CPaneDivider* pSlider = NULL);

Parameters

[in] pManager
[in] pLeftBar
[in] pRightBar
[in] pSlider

Remarks

CPaneContainer::DeletePane

virtual void DeletePane(
    CDockablePane* pBar,
    BC_FIND_CRITERIA barType);

Parameters

[in] pBar
[in] barType

Remarks

CPaneContainer::FindSubPaneContainer

CPaneContainer* FindSubPaneContainer(
    const CObject* pObject,
    BC_FIND_CRITERIA findCriteria);

Parameters

[in] pObject
[in] findCriteria

Return Value

Remarks

CPaneContainer::FindTabbedPane

CDockablePane* FindTabbedPane(UINT nID);

Parameters

[in] nID

Return Value

Remarks

CPaneContainer::GetAssociatedSiblingPaneIDs

CList<UINT, UINT>* GetAssociatedSiblingPaneIDs(CDockablePane* pBar);

Parameters

[in] pBar

Return Value

Remarks

CPaneContainer::GetLeftPane

const CDockablePane* GetLeftPane() const;

Return Value

Remarks

CPaneContainer::GetLeftPaneContainer

const CPaneContainer* GetLeftPaneContainer() const;

Return Value

Remarks

CPaneContainer::GetMinSize

virtual void GetMinSize(CSize& size) const;

Parameters

[in] size

Remarks

CPaneContainer::GetMinSizeLeft

virtual void GetMinSizeLeft(CSize& size) const;

Parameters

[in] size

Remarks

CPaneContainer::GetMinSizeRight

virtual void GetMinSizeRight(CSize& size) const;

Parameters

[in] size

Remarks

CPaneContainer::GetNodeCount

int GetNodeCount() const;

Return Value

Remarks

CPaneContainer::GetPaneDivider

const CPaneDivider* GetPaneDivider() const;

Return Value

Remarks

CPaneContainer::GetParentPaneContainer

CPaneContainer* GetParentPaneContainer() const;

Return Value

Remarks

CPaneContainer::GetRecentPaneDividerRect

CRect GetRecentPaneDividerRect() const;

Return Value

Remarks

CPaneContainer::GetRecentPaneDividerStyle

DWORD GetRecentPaneDividerStyle() const;

Return Value

Remarks

CPaneContainer::GetRecentPercent

int GetRecentPercent();

Return Value

Remarks

CPaneContainer::GetRefCount

LONG GetRefCount();

Return Value

Remarks

CPaneContainer::GetResizeStep

virtual int GetResizeStep() const;

Return Value

Remarks

CPaneContainer::GetRightPane

const CDockablePane* GetRightPane() const;

Return Value

Remarks

CPaneContainer::GetRightPaneContainer

const CPaneContainer* GetRightPaneContainer() const;

Return Value

Remarks

CPaneContainer::GetTotalReferenceCount

int GetTotalReferenceCount() const;

Return Value

Remarks

CPaneContainer::GetWindowRect

virtual void GetWindowRect(
    CRect& rect,
    BOOL bIgnoreVisibility = FALSE) const;

Parameters

[in] rect
[in] bIgnoreVisibility

Remarks

CPaneContainer::IsDisposed

BOOL IsDisposed() const;

Return Value

Remarks

CPaneContainer::IsEmpty

BOOL IsEmpty() const;

Return Value

Remarks

CPaneContainer::IsLeftPane

BOOL IsLeftPane(CDockablePane* pBar) const;

Parameters

[in] pBar

Return Value

Remarks

CPaneContainer::IsLeftPaneContainer

BOOL IsLeftPaneContainer() const;

Return Value

Remarks

CPaneContainer::IsLeftPartEmpty

BOOL IsLeftPartEmpty(BOOL bCheckVisibility = FALSE) const;

Parameters

[in] bCheckVisibility

Return Value

Remarks

CPaneContainer::IsRightPartEmpty

BOOL IsRightPartEmpty(BOOL bCheckVisibility = FALSE) const;

Parameters

[in] bCheckVisibility

Return Value

Remarks

CPaneContainer::IsVisible

BOOL IsVisible() const;

Return Value

Remarks

CPaneContainer::Move

virtual void Move(CPoint ptNewLeftTop);

Parameters

[in] ptNewLeftTop

Remarks

CPaneContainer::OnDeleteHidePane

void OnDeleteHidePane(
    CDockablePane* pBar,
    BOOL bHide);

Parameters

[in] pBar
[in] bHide

Remarks

CPaneContainer::OnMoveInternalPaneDivider

virtual int OnMoveInternalPaneDivider(
    int nOffset,
    HDWP& hdwp);

Parameters

[in] nOffset
[in] hdwp

Return Value

Remarks

CPaneContainer::OnShowPane

virtual void OnShowPane(
    CDockablePane* pBar,
    BOOL bShow);

Parameters

[in] pBar
[in] bShow

Remarks

CPaneContainer::Release

DWORD Release();

Return Value

Remarks

CPaneContainer::ReleaseEmptyPaneContainer

void ReleaseEmptyPaneContainer();

Remarks

CPaneContainer::RemoveNonValidPanes

void RemoveNonValidPanes();

Remarks

CPaneContainer::RemovePane

virtual void RemovePane(CDockablePane* pBar);

Parameters

[in] pBar

Remarks

CPaneContainer::Resize

virtual void Resize(
    CRect rect,
    HDWP& hdwp,
    BOOL bRedraw = FALSE);

Parameters

[in] rect
[in] hdwp
[in] bRedraw

Remarks

CPaneContainer::ResizePane

virtual void ResizePane(
    int nOffset,
    CPane* pBar,
    CPaneContainer* pContainer,
    BOOL bHorz,
    BOOL bLeftBar,
    HDWP& hdwp);

Parameters

[in] nOffset
[in] pBar
[in] pContainer
[in] bHorz
[in] bLeftBar
[in] hdwp

Remarks

CPaneContainer::ResizePartOfPaneContainer

virtual void ResizePartOfPaneContainer(
    int nOffset,
    BOOL bLeftPart,
    HDWP& hdwp);

Parameters

[in] nOffset
[in] bLeftPart
[in] hdwp

Remarks

CPaneContainer::Serialize

void Serialize(CArchive& ar);

Parameters

[in] ar

Remarks

CPaneContainer::SetPane

void SetPane(
    CDockablePane* pBar,
    BOOL bLeft);

Parameters

[in] pBar
[in] bLeft

Remarks

CPaneContainer::SetPaneContainer

void SetPaneContainer(
    CPaneContainer* pContainer,
    BOOL bLeft);

Parameters

[in] pContainer
[in] bLeft

Remarks

CPaneContainer::SetPaneDivider

void SetPaneDivider(CPaneDivider* pSlider);

Parameters

[in] pSlider

Remarks

CPaneContainer::SetParentPaneContainer

void SetParentPaneContainer(CPaneContainer* p);

Parameters

[in] p

Remarks

CPaneContainer::SetRecentPercent

void SetRecentPercent(int nRecentPercent);

Parameters

[in] nRecentPercent

Remarks

CPaneContainer::SetUpByID

BOOL SetUpByID(
    UINT nID,
    CDockablePane* pBar);

Parameters

[in] nID
[in] pBar

Return Value

Remarks

CPaneContainer::StoreRecentDockSiteInfo

virtual void StoreRecentDockSiteInfo(CDockablePane* pBar);

Parameters

[in] pBar

Remarks

CPaneContainer::StretchPaneContainer

virtual int StretchPaneContainer(
    int nOffset,
    BOOL bStretchHorz,
    BOOL bLeftBar,
    BOOL bMoveSlider,
    HDWP& hdwp);

Parameters

[in] nOffset
[in] bStretchHorz
[in] bLeftBar
[in] bMoveSlider
[in] hdwp

Return Value

Remarks

See also

Hierarchy Chart
Classes
CObject Class
CPaneContainerManager Class