BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext) { CRect rect; GetClientRect(&rect); m_wndSplitter1.CreateStatic(this,1,2); m_wndSplitter1.CreateView(0,0,RUNTIME_CLASS(CClassTreeView),CSize(150,150),pContext); m_wndSplitter2.CreateStatic(&m_wndSplitter1,2,1,WS_CHILD|WS_VISIBLE,m_wndSplitter1.IdFromRowCol(0,1)); m_wndSplitter2.CreateView(1,0,RUNTIME_CLASS(CDagDetialView),CSize(0,0),pContext); m_wndSplitter2.CreateView(0,0,RUNTIME_CLASS(CDagView),CSize(0,0),pContext); m_wndSplitter2.SetRowInfo(0,rect.Height()/2,0); return true; //重载时不能调用基类的OnCreateClient() } |
CDagDetialView* pDagDetialView =static_cast<CDagDetialView*>(pFrame->m_wndSplitter2.GetPane(1,0)); |
void CDagView::OnItemchanged(NMHDR* pNMHDR, LRESULT* pResult) { NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; // TODO: Add your control notification handler code here CListCtrl& refListCtrl=GetListCtrl(); if(pNMListView->uNewState&LVIS_SELECTED) …//选取列表项时,事件触发 pResult=0; } |
pRS->MoveFirst(); _variant_t var; CString strTableName,strTableCode; HTREEITEM hChildItem; while(!pRS->adoEOF) { var=pRS->GetCollect("menucode"); if(var.vt != VT_NULL) strTableCode = (LPCSTR)_bstr_t(var); //此即函数递归出口 if(!strTableCode.Find(strParent,0) && strTableCode.GetLength()==strParent.GetLength()+2) { hChildItem=refTree.InsertItem(strTableName,hTreeNode,TVI_LAST); InitTree(refTree,hChildItem,strTableCode); } pRS->MoveNext(); } |
void CClassTreeView::OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult) { NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR; // TODO: Add your control notification handler code here CTreeCtrl& refTreeCtrl=GetTreeCtrl(); HTREEITEM hSelected=pNMTreeView->itemNew.hItem; if(hSelected!=NULL) { m_strMenuName=refTreeCtrl.GetItemText(hSelected); if(AfxGetMainWnd()->IsWindowEnabled()) UpdateDagView(); } //----------- *pResult = 0; } |
int CDagView::GetColumnIndex(CListCtrl &ref,LPCTSTR strCol) { CHeaderCtrl * pHeader=ref.GetHeaderCtrl(); int nCount=pHeader->GetItemCount(); TCHAR lpBuffer[256]; bool fFound = false; HDITEM hdi; hdi.mask = HDI_TEXT; hdi.pszText = lpBuffer; hdi.cchTextMax = 256; int index=-1; for (int i=0;!fFound && (i < nCount);i++) { pHeader->GetItem(i, &hdi); if (strcmp(hdi.pszText, strCol) == 0) { index=i; fFound = true; } } return index; } iSubItem=GetColumnIndex(refListCtrl); CString strValue=refListCtrl.GetItemText(iCurrent,iSubItem); |
ASP编码教程:如何实现/使用缓存
[ASP]2015年4月15日ASP编码教程:asp缓存的分类
[ASP]2015年4月15日ASP编码教程:何谓ASP缓存/为什么要缓存
[ASP]2015年4月15日ASP编码教程:asp实现的sha1加密解密代码
[ASP]2015年4月15日ASP编码教程:asp执行带参数的sql语句实例
[ASP]2015年4月14日