예제 #1
0
파일: MainFram.cpp 프로젝트: blueocci/codes
BOOL CMainFram::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
	// TODO: Add your specialized code here and/or call the base class
	iniToolbar();
	iniDialogbar();
	//m_wndSplitter.Create(this,2,2,CSize(10, 10),pContext);
	m_wndSplitter.CreateStatic(this,1,2);
	m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CTreeView),CSize(200,0),pContext);
	m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CListView),CSize(0,0),pContext);
	CTreeView* treeView =NULL;//= (CTreeView*)m_wndSplitter.GetPane(0,0);
	CTreeCtrl treeCtrl = treeView->GetTreeCtrl();
	m_decTreeCtrl = new TreeCtrlDec(&treeCtrl);
	m_decTreeCtrl->appendItem(_T("L1I1"),NULL);
	m_decTreeCtrl->appendItem(_T("L1I2"),NULL);
	return CFrameWnd::OnCreateClient(lpcs, pContext);
}
예제 #2
0
CTreeCtrl *GetTreeCtrl(PyObject *self, bool bNeedValidHwnd = true)
{
	extern CTreeView *GetTreeViewPtr(PyObject *self);
	CTreeCtrl *rc;

	if (ui_base_class::is_uiobject(self, &PyCTreeView::type)) {
		CTreeView *pView = GetTreeViewPtr(self);
		if (pView)
			rc = &(pView->GetTreeCtrl());
		else
			rc = NULL;
	} else
		rc = (CTreeCtrl *)PyCWnd::GetPythonGenericWnd(self, &PyCTreeCtrl::type);
	if (rc && bNeedValidHwnd && !::IsWindow(rc->m_hWnd))
		RETURN_ERR((char *)szErrTreeRequiresWindow);
	return rc;
}