我在OnCreateClient里面分割窗体,
结果框架里面怎么显示只有一个View呢??没有见到什么分割。请剖析剖析,
其中testview继承自CScrollView
BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
m_spilter1.CreateStatic(this,1,2);
CRect rect;
GetClientRect(&rect); m_spilter1.CreateView(0,0,RUNTIME_CLASS(CTESTView),
CSize(100,100),pContext);
m_spilter2.CreateStatic(&m_spilter1,2,1,
WS_CHILD|WS_VISIBLE,m_spilter1.IdFromRowCol(0,1));
m_spilter2.CreateView(0,0,RUNTIME_CLASS(CView1),
CSize(25,25),pContext);
m_spilter2.CreateView(1,0,RUNTIME_CLASS(CView2),
CSize(25,25),pContext);
SetActiveView((CView*) m_spilter1.GetPane(0,0)); return CMDIChildWnd::OnCreateClient(lpcs, pContext);
}
结果框架里面怎么显示只有一个View呢??没有见到什么分割。请剖析剖析,
其中testview继承自CScrollView
BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
m_spilter1.CreateStatic(this,1,2);
CRect rect;
GetClientRect(&rect); m_spilter1.CreateView(0,0,RUNTIME_CLASS(CTESTView),
CSize(100,100),pContext);
m_spilter2.CreateStatic(&m_spilter1,2,1,
WS_CHILD|WS_VISIBLE,m_spilter1.IdFromRowCol(0,1));
m_spilter2.CreateView(0,0,RUNTIME_CLASS(CView1),
CSize(25,25),pContext);
m_spilter2.CreateView(1,0,RUNTIME_CLASS(CView2),
CSize(25,25),pContext);
SetActiveView((CView*) m_spilter1.GetPane(0,0)); return CMDIChildWnd::OnCreateClient(lpcs, pContext);
}
bCreate = m_wndSplitter.CreateStatic(this, 1, 2);
ASSERT(bCreate);
if (!bCreate) {
return bCreate;
}
bCreate = m_wndSplitter.CreateView( 0, 0, RUNTIME_CLASS(CLeftTree), CSize(200, 200), pContext );
ASSERT(bCreate);
if (!bCreate) {
return bCreate;
} /*
bCreate = m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CDownLoadView), CSize(200, 200), pContext);
ASSERT(bCreate);
if (!bCreate) {
return bCreate;
}*/
bCreate = m_wndSplitterListView.CreateStatic(&m_wndSplitter,
2, 1,
WS_CHILD | WS_VISIBLE | WS_BORDER,
m_wndSplitter.IdFromRowCol(0, 1));
ASSERT(bCreate);
if (!bCreate) {
return bCreate;
} m_wndSplitterListView.CreateView(0, 0,
RUNTIME_CLASS(CTaskListView),
CSize(200, 200),
pContext);
if (!bCreate) {
return bCreate;
} m_wndSplitterListView.CreateView(1, 0,
RUNTIME_CLASS(CBottomView),
CSize(200, 200),
pContext);
if (!bCreate) {
return bCreate;
}
return bCreate = TRUE;
---------------------------------------------------------------
这句不对, 应该反正 TRUE, 不能调用缺省的实现了:BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
m_spilter1.CreatStatic(...);
m_spilter1.CreateView(...)
...
return TRUE;
}