资源简介
该代码提供了一个类,可以帮助你灵活的将视图拆分为3个窗口,共有6个模式。使用起来灵活方便。
代码片段和文件信息
// ExSplitter3Wnd.cpp: implementation of the CExSplitter3Wnd class.
//
//////////////////////////////////////////////////////////////////////
#include “stdafx.h“
#include “TestSplit.h“
#include “ExSplitter3Wnd.h“
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CExSplitter3Wnd::CExSplitter3Wnd()
{
CSplitterWnd::CSplitterWnd();
m_FirstViewSize = CSize(00);
m_SecViewSize = CSize(00);
m_ThirdViewSize= CSize(00);
}
CExSplitter3Wnd::~CExSplitter3Wnd()
{
CSplitterWnd::~CSplitterWnd();
if (m_pwndSplitter!=NULL)
delete m_pwndSplitter;
}
void CExSplitter3Wnd ::SetPattern(CWnd* pParentSPLIT_PATTERN SplitPatternCRuntimeClass* pFirstViewCRuntimeClass* pSecViewCRuntimeClass* pThirdViewCCreateContext* pContext)
{
m_pFirstView = pFirstView;
m_pSecView = pSecView;
m_pThirdView = pThirdView;
m_pContext = pContext;
m_SplitPattern = SplitPattern ;
switch (m_SplitPattern)
{
case PATTERN_1:
SetPattern1(pParent);
break;
case PATTERN_2:
SetPattern2(pParent);
break;
case PATTERN_3:
SetPattern3(pParent);
break;
case PATTERN_4:
SetPattern4(pParent);
break;
case PATTERN_5:
SetPattern5(pParent);
break;
case PATTERN_6:
SetPattern6(pParent);
break;
}
}
void CExSplitter3Wnd ::SetPattern1(CWnd* pParent)
{
CreateStatic(pParent12);
CreateView(00m_pFirstView m_FirstViewSizem_pContext);
m_pwndSplitter = new CSplitterWnd;
VERIFY(m_pwndSplitter->CreateStatic(this 2 1m_dwstyle // style WS_BORDER is needed
this->IdFromRowCol(0 1))); // For portrait
VERIFY(m_pwndSplitter->CreateView(00m_pSecViewm_SecViewSizem_pContext));
VERIFY(m_pwndSplitter->CreateView(10m_pThirdView m_ThirdViewSizem_pContext));
}
void CExSplitter3Wnd ::SetPattern2(CWnd* pParent)
{
CreateStatic(pParent12);
m_pwndSplitter = new CSplitterWnd;
m_pwndSplitter->CreateStatic(this 2 1m_dwstyle // style WS_BORDER is needed
this->IdFromRowCol(00)); // For portrait
VERIFY(CreateView(01m_pFirstView m_ThirdViewSizem_pContext));
VERIFY(m_pwndSplitter->CreateView(00m_pSecViewm_SecViewSizem_pContext));
VERIFY(m_pwndSplitter->CreateView(10m_pThirdView m_ThirdViewSizem_pContext));
SetColumnInfo(0m_SecViewSize.cx10);
RecalcLayout();
}
void CExSplitter3Wnd ::SetPattern3(CWnd* pParent)
{
CreateStatic(pParent21);
m_pwndSplitter = new CSplitterWnd;
VERIFY(m_pwndSplitter->CreateStatic(this 1 2m_dwstyle // style WS_BORDER is needed
this->IdFromRowCol(10))); // For portrait
VERIFY(CreateView(00m_pFirstView m_FirstViewSizem_pContext));
VERIFY(m_pwndSplitter->CreateView(00m_pSecViewm_SecViewSizem
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2001-03-14 15:22 TestSplit\
文件 1376 2001-03-15 12:33 TestSplit\SecView.h
文件 1597 2001-03-18 13:22 TestSplit\MainFrm.h
文件 1269 2001-03-15 12:38 TestSplit\SecView.cpp
文件 541 2001-03-14 19:10 TestSplit\TestSplit.dsw
文件 2520 2001-03-18 13:32 TestSplit\TestSplit.clw
文件 4065 2001-03-14 15:22 TestSplit\ReadMe.txt
文件 1389 2001-03-14 15:22 TestSplit\TestSplit.h
文件 3995 2001-03-14 15:22 TestSplit\TestSplit.cpp
文件 1054 2001-03-14 15:22 TestSplit\StdAfx.h
文件 211 2001-03-14 15:22 TestSplit\StdAfx.cpp
文件 4947 2001-03-15 13:11 TestSplit\TestSplit.dsp
文件 10608 2001-03-18 13:10 TestSplit\TestSplit.rc
文件 1508 2001-03-14 15:22 TestSplit\TestSplitDoc.h
文件 1802 2001-03-14 15:22 TestSplit\TestSplitDoc.cpp
文件 642 2001-03-18 13:10 TestSplit\Resource.h
目录 0 2001-03-14 15:22 TestSplit\res\
文件 401 2001-03-14 15:22 TestSplit\res\TestSplit.rc2
文件 1078 2001-03-14 15:22 TestSplit\res\TestSplitDoc.ico
文件 1078 2001-03-14 15:22 TestSplit\res\TestSplit.ico
文件 2989 2001-03-18 13:22 TestSplit\MainFrm.cpp
文件 6158 2001-03-18 13:17 TestSplit\ExSplitter3Wnd.cpp
文件 2590 2001-03-18 13:01 TestSplit\ExSplitter3Wnd.h
文件 1414 2001-03-14 15:27 TestSplit\ThirdView.h
文件 1791 2001-03-14 15:28 TestSplit\TestSplitView.h
文件 1249 2001-03-14 15:35 TestSplit\ThirdView.cpp
文件 2016 2001-03-14 15:35 TestSplit\TestSplitView.cpp
评论
共有 条评论