15,980
社区成员




BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
// TODO: 在此添加专用代码和/或调用基类
CRect rct;
GetClientRect(&rct);
int nRcWidth = rct.Width();
int nRcHeight = rct.Height();
//用第一个分隔条分割成1行2列
if (m_spliter1.CreateStatic(this, 1, 2) == NULL) return FALSE;
//分割的第一行第一列指定动态创建CLeftView
m_spliter1.CreateView(0, 0, RUNTIME_CLASS(CLeftViet), CSize(nRcWidth / 4, nRcHeight), pContext);
//对m_spliter1分割的第二个区域再使用m_spliter2进行分割,分割成2*2区域
if (m_spliter2.CreateStatic(&m_spliter1, 2, 2, WS_CHILD | WS_VISIBLE, m_spliter1.IdFromRowCol(0, 1)) == NULL)return FALSE;
//和上述差不多,指定动态创建的对象为CLTView
m_spliter2.CreateView(0, 0, RUNTIME_CLASS(CLTView), CSize(nRcWidth / 8 * 3, nRcHeight / 2), pContext);
m_spliter2.CreateView(0, 1, RUNTIME_CLASS(CLTView), CSize(nRcWidth / 8 * 3, nRcHeight / 2), pContext);
m_spliter2.CreateView(1, 0, RUNTIME_CLASS(CLTView), CSize(nRcWidth / 8 * 3, nRcHeight / 2), pContext);
m_spliter2.CreateView(1, 1, RUNTIME_CLASS(CLTView), CSize(nRcWidth / 8 * 3, nRcHeight / 2), pContext);
return CFrameWndEx::OnCreateClient(lpcs, pContext);
}