| 715 | } |
| 716 | |
| 717 | void JsonViewDlg::ShowContextMenu(int x, int y) |
| 718 | { |
| 719 | POINT p {.x = x, .y = y}; |
| 720 | |
| 721 | TVHITTESTINFO tvHitInfo {.pt = p, .flags = 0, .hItem = nullptr}; |
| 722 | |
| 723 | m_pTreeView->ScreenToTreeView(&(tvHitInfo.pt)); |
| 724 | |
| 725 | // Detect if the given position is on the element TVITEM |
| 726 | HTREEITEM hTreeItem = m_pTreeView->HitTest(&tvHitInfo); |
| 727 | |
| 728 | if (hTreeItem != nullptr) |
| 729 | { |
| 730 | // Make item selected |
| 731 | m_pTreeView->SelectItem(hTreeItem); |
| 732 | |
| 733 | if (tvHitInfo.flags & (TVHT_ONITEM | TVHT_ONITEMBUTTON)) |
| 734 | { |
| 735 | // Right click |
| 736 | UpdateNodePath(hTreeItem); |
| 737 | ShowContextMenu(hTreeItem, &p); |
| 738 | } |
| 739 | } |
| 740 | } |
| 741 | |
| 742 | void JsonViewDlg::ShowContextMenu(HTREEITEM htiNode, LPPOINT lppScreen) |
| 743 | { |
nothing calls this directly
no test coverage detected