CPaneContainer 类

CPaneContainer 类是 MFC 实现的停靠模型的基本组件。 此类的对象存储指向两个停靠窗格或 CPaneContainer 的两个实例的指针。 它还存储指向分隔窗格(或容器)的分隔条的指针。 通过嵌套容器内部的容器,框架可以生成表示复杂停靠布局的二叉树。 二叉树的根存储在 CPaneContainerManager 对象中。

有关详细信息,请参阅所安装的 Visual Studio 的 C\atlmfc\src\mfc 文件夹中的源代码。

语法

class CPaneContainer : public CObject

成员

公共构造函数

名称 描述
CPaneContainer::CPaneContainer 默认构造函数。

公共方法

名称 描述
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 从存档读取该对象或将该对象写入存档。 (重写 CObject::Serialize。)
CPaneContainer::SetPane
CPaneContainer::SetPaneContainer
CPaneContainer::SetPaneDivider
CPaneContainer::SetParentPaneContainer
CPaneContainer::SetRecentPercent
CPaneContainer::SetUpByID
CPaneContainer::StoreRecentDockSiteInfo
CPaneContainer::StretchPaneContainer

备注

CPaneContainer 对象由框架自动创建。

示例

以下示例演示如何构造 CPaneContainer 类的实例。 此代码段是设置窗格大小示例的一部分。

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

继承层次结构

CObject

CPaneContainer

要求

标头:afxpanecontainer.h

CPaneContainer::AddPane

CDockablePane* AddPane(CDockablePane* pBar);

参数

[in] pBar

返回值

备注

CPaneContainer::AddRef

void AddRef();

备注

CPaneContainer::AddSubPaneContainer

BOOL AddSubPaneContainer(
    CPaneContainer* pContainer,
    BOOL bRightNodeNew);

参数

[in] pContainer
[in] bRightNodeNew

返回值

备注

CPaneContainer::CalcAvailablePaneSpace

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

参数

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

返回值

注解

CPaneContainer::CalcAvailableSpace

virtual CSize CalcAvailableSpace(
    CSize sizeStretch,
    BOOL bLeftBar);

参数

[in] sizeStretch
[in] bLeftBar

返回值

注解

CPaneContainer::CalculateRecentSize

void CalculateRecentSize();

备注

CPaneContainer::CheckPaneDividerVisibility

void CheckPaneDividerVisibility();

备注

CPaneContainer::Copy

virtual CPaneContainer* Copy(CPaneContainer* pParentContainer);

参数

[in] pParentContainer

返回值

备注

CPaneContainer::CPaneContainer

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

参数

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

备注

CPaneContainer::DeletePane

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

参数

[in] pBar
[in] barType

备注

CPaneContainer::FindSubPaneContainer

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

参数

[in] pObject
[in] findCriteria

返回值

注解

CPaneContainer::FindTabbedPane

CDockablePane* FindTabbedPane(UINT nID);

参数

[in] nID

返回值

注解

CPaneContainer::GetAssociatedSiblingPaneIDs

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

参数

[in] pBar

返回值

备注

CPaneContainer::GetLeftPane

const CDockablePane* GetLeftPane() const;

返回值

备注

CPaneContainer::GetLeftPaneContainer

const CPaneContainer* GetLeftPaneContainer() const;

返回值

备注

CPaneContainer::GetMinSize

virtual void GetMinSize(CSize& size) const;

参数

[in] size

备注

CPaneContainer::GetMinSizeLeft

virtual void GetMinSizeLeft(CSize& size) const;

参数

[in] size

注解

CPaneContainer::GetMinSizeRight

virtual void GetMinSizeRight(CSize& size) const;

参数

[in] size

备注

CPaneContainer::GetNodeCount

int GetNodeCount() const;

返回值

注解

CPaneContainer::GetPaneDivider

const CPaneDivider* GetPaneDivider() const;

返回值

备注

CPaneContainer::GetParentPaneContainer

CPaneContainer* GetParentPaneContainer() const;

返回值

注解

CPaneContainer::GetRecentPaneDividerRect

CRect GetRecentPaneDividerRect() const;

返回值

备注

CPaneContainer::GetRecentPaneDividerStyle

DWORD GetRecentPaneDividerStyle() const;

返回值

备注

CPaneContainer::GetRecentPercent

int GetRecentPercent();

返回值

注解

CPaneContainer::GetRefCount

LONG GetRefCount();

返回值

注解

CPaneContainer::GetResizeStep

virtual int GetResizeStep() const;

返回值

备注

CPaneContainer::GetRightPane

const CDockablePane* GetRightPane() const;

返回值

备注

CPaneContainer::GetRightPaneContainer

const CPaneContainer* GetRightPaneContainer() const;

返回值

备注

CPaneContainer::GetTotalReferenceCount

int GetTotalReferenceCount() const;

返回值

备注

CPaneContainer::GetWindowRect

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

参数

[in] rect
[in] bIgnoreVisibility

备注

CPaneContainer::IsDisposed

BOOL IsDisposed() const;

返回值

注解

CPaneContainer::IsEmpty

BOOL IsEmpty() const;

返回值

备注

CPaneContainer::IsLeftPane

BOOL IsLeftPane(CDockablePane* pBar) const;

参数

[in] pBar

返回值

注解

CPaneContainer::IsLeftPaneContainer

BOOL IsLeftPaneContainer() const;

返回值

备注

CPaneContainer::IsLeftPartEmpty

BOOL IsLeftPartEmpty(BOOL bCheckVisibility = FALSE) const;

参数

[in] bCheckVisibility

返回值

注解

CPaneContainer::IsRightPartEmpty

BOOL IsRightPartEmpty(BOOL bCheckVisibility = FALSE) const;

参数

[in] bCheckVisibility

返回值

注解

CPaneContainer::IsVisible

BOOL IsVisible() const;

返回值

备注

CPaneContainer::Move

virtual void Move(CPoint ptNewLeftTop);

参数

[in] ptNewLeftTop

注解

CPaneContainer::OnDeleteHidePane

void OnDeleteHidePane(
    CDockablePane* pBar,
    BOOL bHide);

参数

[in] pBar
[in] bHide

备注

CPaneContainer::OnMoveInternalPaneDivider

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

参数

[in] nOffset
[in] hdwp

返回值

注解

CPaneContainer::OnShowPane

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

参数

[in] pBar
[in] bShow

备注

CPaneContainer::Release

DWORD Release();

返回值

备注

CPaneContainer::ReleaseEmptyPaneContainer

void ReleaseEmptyPaneContainer();

备注

CPaneContainer::RemoveNonValidPanes

void RemoveNonValidPanes();

备注

CPaneContainer::RemovePane

virtual void RemovePane(CDockablePane* pBar);

参数

[in] pBar

备注

CPaneContainer::Resize

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

参数

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

备注

CPaneContainer::ResizePane

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

注解

CPaneContainer::ResizePartOfPaneContainer

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

参数

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

备注

CPaneContainer::Serialize

void Serialize(CArchive& ar);

参数

[in] ar

备注

CPaneContainer::SetPane

void SetPane(
    CDockablePane* pBar,
    BOOL bLeft);

参数

[in] pBar
[in] bLeft

注解

CPaneContainer::SetPaneContainer

void SetPaneContainer(
    CPaneContainer* pContainer,
    BOOL bLeft);

参数

[in] pContainer
[in] bLeft

注解

CPaneContainer::SetPaneDivider

void SetPaneDivider(CPaneDivider* pSlider);

参数

[in] pSlider

备注

CPaneContainer::SetParentPaneContainer

void SetParentPaneContainer(CPaneContainer* p);

参数

[in] p

注解

CPaneContainer::SetRecentPercent

void SetRecentPercent(int nRecentPercent);

参数

[in] nRecentPercent

备注

CPaneContainer::SetUpByID

BOOL SetUpByID(
    UINT nID,
    CDockablePane* pBar);

参数

[in] nID
[in] pBar

返回值

注解

CPaneContainer::StoreRecentDockSiteInfo

virtual void StoreRecentDockSiteInfo(CDockablePane* pBar);

参数

[in] pBar

备注

CPaneContainer::StretchPaneContainer

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

参数

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

返回值

注解

另请参阅

层次结构图

CObject 类
CPaneContainerManager 类