做了一个单文档界面,并在菜单中添加了一选项。
当程序启动后,点击该选项,弹出一对话框,当关闭对话框后,单文档的界面将被切分(切分功能已完成)。想知道如何连接这个过程:关闭对话框->切分界面?
求教高手!!!!
当程序启动后,点击该选项,弹出一对话框,当关闭对话框后,单文档的界面将被切分(切分功能已完成)。想知道如何连接这个过程:关闭对话框->切分界面?
求教高手!!!!
解决方案 »
- 为何错误会跑到VC提供的头文件中去?
- 求一个连接web服务器并发送一个GET请求的小例子
- 如何做成QQ游戏大厅那样可拖拉和隐藏的树型控件?
- ADO与SQL SERVER数据源连接问题!!!一直连不上!!高手指教
- 求一条直线和一个矩形的交点的算法/提示,百分相酬
- 在调用dll结束时,发生错误。急
- 一個很簡單的問題,關于MFC中AcitveX控件Size控制的.
- 在MFC中遇到的问题
- 如何修改已插入到RichEdit里面的对象的属性?
- 如何制作工程文件?
- 一个视图的问题!!!!
- 我定义了一个TIMER(1,600,NULL),但是编译时,却说“error C2660: 'SetTimer' : function does not take 3 parameters”,为什么啊,
{
if(dlg.DoModal()==IDOK)
{
切分
}
}
if (!m_wndSplitter.CreateStatic(this, 1, 2))
{
TRACE0("Failed to create splitter window\n");
}
// Get the client rect first for calc left pane size
CRect rect;
GetClientRect(&rect); CCreateContext pContext;
//pContext.m_pNewViewClass=RUNTIME_CLASS(CLeftPaneView);
pContext.m_pCurrentDoc=((CSdiApp*)AfxGetApp())->m_pDoc;
pContext.m_pCurrentFrame=this;
pContext.m_pNewDocTemplate=pContext.m_pCurrentDoc->GetDocTemplate();
pContext.m_pLastView=(CView*)m_wndSplitter.GetPane(0,0);
/*
CCreateContext pContext1;
pContext1.m_pNewViewClass=RUNTIME_CLASS(CRightPaneFrame);
pContext1.m_pCurrentDoc=((CSdiApp*)AfxGetApp())->m_pDoc;
pContext1.m_pCurrentFrame=this;
pContext1.m_pNewDocTemplate=pContext1.m_pCurrentDoc->GetDocTemplate();
pContext1.m_pLastView=(CView*)m_wndSplitter.GetPane(0,1);
*/ // create the left tree view first.
if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftPaneView), CSize(rect.Width()/3, 0), &pContext))
{
TRACE0("Failed to create left pane view\n");
} // The right pane is a frame which and contain several different views.
// The is can be set to active or non-active
if (!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CRightPaneFrame), CSize(0, 0), &pContext))
{
TRACE0("Failed to create right pane frame\n");
} CLeftPaneView* pLeftPaneView = (CLeftPaneView*) m_wndSplitter.GetPane(0,0);
pLeftPaneView->m_pRightPaneFrame = (CRightPaneFrame*) m_wndSplitter.GetPane(0,1);
// Set the left pane as the active view
SetActiveView((CView*) m_wndSplitter.GetPane(0, 0));pContext.m_pLastView=(CView*)m_wndSplitter.GetPane(0,0);有问题
求教是什么原因?
比如说一个简单的左右切分:
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/,
CCreateContext* pContext)
{
if (!m_wndSplitter.CreateStatic(this, 1, 2))
return FALSE;if (!m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CLeftView), CSize(200, 100), pContext) ||
!m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CRightView), CSize(100, 100), pContext))
{
m_wndSplitter.DestroyWindow();
return FALSE;
}
return TRUE;
}就这样了……m_wndSplitter是个CSplitterWnd,CLeftView CRightView是你的两个View
if(m_userdlg.DoModal==IDOK) // add by me
{
//Splitter your windows
}