| | |
| | | #include "pch.h"
|
| | | #include "framework.h"
|
| | | #include "ViewTree.h"
|
| | | #include "MTerm1.h"
|
| | |
|
| | | #ifdef _DEBUG
|
| | | #define new DEBUG_NEW
|
| | |
| | | }
|
| | |
|
| | | BEGIN_MESSAGE_MAP(CViewTree, CTreeCtrl)
|
| | | // ON_NOTIFY_REFLECT(NM_DBLCLK, &CViewTree::OnDblClkTree)
|
| | | // ON_NOTIFY_REFLECT(NM_CLICK, &CViewTree::OnClkTree)
|
| | |
|
| | | END_MESSAGE_MAP()
|
| | |
|
| | | /////////////////////////////////////////////////////////////////////////////
|
| | |
| | |
|
| | | return bRes;
|
| | | }
|
| | |
|
| | | void CViewTree::OnClkTree(NMHDR* pNMHDR, LRESULT* pResult)
|
| | | {
|
| | |
|
| | | HTREEITEM hTreeItem = GetSelectedItem();
|
| | | //以GetItemText()函数为例: |
| | | CString S1 = GetItemText(hTreeItem);
|
| | | // AfxMessageBox(_T("You have selected ") + S1);
|
| | |
|
| | | *pResult = 0;
|
| | |
|
| | | }
|
| | |
|
| | | void CViewTree::OnDblClkTree(NMHDR* pNMHDR, LRESULT* pResult)
|
| | | {
|
| | | LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
|
| | |
|
| | | HTREEITEM hTreeItem = GetSelectedItem();
|
| | | //以GetItemText()函数为例: |
| | | CString s2 = GetItemText(hTreeItem);
|
| | | //AfxMessageBox(_T("You have selected ") + s1);
|
| | | CString s1;
|
| | | DWORD_PTR dw = GetItemData(hTreeItem);
|
| | | s1.Format(_T("dbclk action %d, id %d oldid %d data %d x %d y %d text %s "),
|
| | | pNMTreeView->action, hTreeItem, pNMTreeView->itemOld.hItem, dw, pNMTreeView->ptDrag.x, pNMTreeView->ptDrag.y,s2);
|
| | | |
| | | SysLog(s1);
|
| | |
|
| | | *pResult = 0;
|
| | | }
|