注册 登录
编程论坛 VC++/MFC

VC 对视图切分了一次 再选某一视图对其切分

a315010225 发布于 2011-06-08 15:52, 395 次点击
急急急
1 回复
#2
duliningmiss2011-06-10 20:12
这是一个视图分割的例子,看看吧!  
        CRect rect;
    GetClientRect(rect);

    m_wndSplitter1.CreateStatic(this,2,1,WS_CHILD|WS_VISIBLE);
    m_wndSplitter2.CreateStatic(&m_wndSplitter1,1,2,WS_CHILD|WS_VISIBLE,m_wndSplitter1.IdFromRowCol(0,0));
    m_wndSplitter2.CreateView(0,0,RUNTIME_CLASS(CContainerView),CSize(0,0),pContext);
    m_wndSplitter3.CreateStatic(&m_wndSplitter2,2,1,WS_CHILD|WS_VISIBLE,m_wndSplitter2.IdFromRowCol(0,1));
    m_wndSplitter3.CreateView(0,0,RUNTIME_CLASS(CChangePoint),CSize(0,0),pContext);
    m_wndSplitter3.CreateView(1,0,RUNTIME_CLASS(CTextPackInfo),CSize(0,0),pContext);
    m_wndSplitter1.CreateView(1,0,RUNTIME_CLASS(CListPackInfo),CSize(0,0),pContext);

    m_wndSplitter1.SetRowInfo(0,static_cast<int>(rect.Height()*0.7),100);
    m_wndSplitter1.SetRowInfo(1,static_cast<int>(rect.Height()*0.3),100);
    m_wndSplitter2.SetColumnInfo(0,static_cast<int>(rect.Width()*0.8),100);
    m_wndSplitter2.SetColumnInfo(1,static_cast<int>(rect.Width()*0.2),100);
    m_wndSplitter3.SetRowInfo(0,static_cast<int>(rect.Height()*0.7*0.3),100);
    m_wndSplitter3.SetRowInfo(1,static_cast<int>(rect.Height()*0.3*0.7),100);

    m_wndSplitter1.RecalcLayout();
    m_wndSplitter2.RecalcLayout();
    m_wndSplitter3.RecalcLayout();
1