我有一个单文档程序,里面有几的视图,然后每个视图里面想拆分成几个窗口.
但是一般拆分窗口是在CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) 里面做,怎么为每一个视图拆成不同的窗口呢?然后等我想切换视图时show一下就行了.
谢谢.
但是一般拆分窗口是在CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) 里面做,怎么为每一个视图拆成不同的窗口呢?然后等我想切换视图时show一下就行了.
谢谢.
CSplitterWnd m_wndSplitter,m_wndSplitterWnd1;
if(!m_wndSplitter.CreateStatic(this,2,1))
{
TRACE0("Failed to CreateStaticSplitter\n");
return FALSE;
}
if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CRetrieverExView),
CSize(0, 30), pContext))
{
TRACE0("Failed to create first pane\n");
return FALSE;
}
if(!m_wndSplitter1.CreateStatic(&m_wndSplitter,1,2,WS_CHILD | WS_VISIBLE
| WS_BORDER,m_wndSplitter.IdFromRowCol(1,0)))
{
TRACE("Create Second view pane failed!");
return FALSE;
}
if(!m_wndSplitter1.CreateView(0,0,RUNTIME_CLASS(CRetrieverExView),CSize(150,100),pContext))
{
TRACE("Create Second view,first pane failed!");
return FALSE;
}
if(!m_wndSplitter1.CreateView(0,1,RUNTIME_CLASS(CRetrieverExView),CSize(50,100),pContext))
{
TRACE("Create Second view,second pane failed!");
return FALSE;
}
CCreateContext context;
context.m_pCurrentDoc = GetActiveView()->GetDocument();
context.m_pNewViewClass = RUNTIME_CLASS(CCaiView);
context.m_pCurrentFrame = NULL;
context.m_pLastView = NULL;
context.m_pNewDocTemplate = ((CCaiApp *)AfxGetApp())->p; m_wndSplitter.ShowWindow(SW_HIDE);
this->m_wndSplitter2.CreateStatic(this,2,1);
this->m_wndSplitter2.CreateView(0,0,RUNTIME_CLASS(View3),CSize(0,300),&context);
this->m_wndSplitter2.CreateView(1,0,RUNTIME_CLASS(View2),CSize(0,0),&context); m_wndSplitter2.ShowWindow(SW_SHOW);
谢谢.