示例#1
0
BOOL CMyFrameWnd::OnCreateClient(LPCREATESTRUCT lpcs,CCreateContext* pContext){

#if 0  // 创建动态切分窗口 
	//1 指定所需要的视图类
	CCreateContext cxt;
	cxt.m_pNewViewClass = RUNTIME_CLASS(CMyView);
	//2 创建动态切分
	m_wndSplit.Create(this,2,2,CSize(200,200),&cxt);	
#else  //静态切分窗口的创建
	//1 创建静态切分
	m_wndSplit.CreateStatic(this,2,1);
	//这里最后参数填写的是默认id,即充满与客户区窗口
	m_wndSplit.CreateView(0,0,RUNTIME_CLASS(CHtmlView),CSize(200,200),pContext);
//	m_wndSplit.CreateView(1,0,RUNTIME_CLASS(CHtmlView),CSize(200,200),pContext);

	m_wndSplit2.CreateStatic(&m_wndSplit,1,2,WS_CHILD|WS_VISIBLE,
		m_wndSplit.IdFromRowCol(1,0));
	m_wndSplit2.CreateView(0,0,RUNTIME_CLASS(CMyView),CSize(100,100),pContext);
	m_wndSplit2.CreateView(0,1,RUNTIME_CLASS(CMyView),CSize(100,100),pContext);
	
	m_wndSplit2.SetColumnInfo(0,200,10);
	/*
	for(int i=0;i<3;++i){
		for(int j=0;j<3;++j)
		m_wndSplit.CreateView(i,j,RUNTIME_CLASS(CEditView),CSize(200,200),pContext);
	}
	*/
	//2 获取创建好的视图
	CHtmlView* pHtmlView = (CHtmlView*) m_wndSplit.GetPane(0,0);
	pHtmlView -> Navigate("D:/");
#endif
	return true;	
}
示例#2
0
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
	// TODO: 여기에 특수화된 코드를 추가 및/또는 기본 클래스를 호출합니다.

	if (!m_wndSplitter.CreateStatic(this, 1, 2)) {
		TRACE0("Fail to create splitter.\n");
		return FALSE;
	}

	m_wndSplitter.CreateView(0, 0, RUNTIME_CLASS(CProject3View), CSize(300, 300), pContext);
	m_wndSplitter.CreateView(0, 1, RUNTIME_CLASS(CProject3View), CSize(300, 300), pContext);

	return TRUE;

	return CFrameWnd::OnCreateClient(lpcs, pContext);
}