MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / OnRclickEventTree

Method OnRclickEventTree

editor/DallasMainDlg.cpp:1052–1074  ·  view source on GitHub ↗

Displays a context sensitive pop-up menu

Source from the content-addressed store, hash-verified

1050
1051// Displays a context sensitive pop-up menu
1052void CDallasMainDlg::OnRclickEventTree(NMHDR *pNMHDR, LRESULT *pResult) {
1053 POINT pt;
1054 TVHITTESTINFO hit_info;
1055
1056 ::GetCursorPos(&pt);
1057 m_ScriptTree.ScreenToClient(&pt);
1058 hit_info.pt = pt;
1059
1060 // Check to see if the mouse is lined up with a tree item
1061 m_ScriptTree.HitTest(&hit_info);
1062 if (hit_info.flags & TVHT_ONITEM || hit_info.flags & TVHT_ONITEMRIGHT || hit_info.flags & TVHT_ONITEMINDENT) {
1063
1064 // Select the item
1065 m_ScriptTree.SelectItem(hit_info.hItem);
1066
1067 // Convert back to screen coordinates for displaying the menu
1068 m_ScriptTree.ClientToScreen(&pt);
1069
1070 DisplayFloatingPopupMenu(hit_info.hItem, pt);
1071 }
1072
1073 *pResult = 0;
1074}
1075
1076// Displays a context sensitive pop-up menu for the given node at the given screen pt
1077void CDallasMainDlg::DisplayFloatingPopupMenu(HTREEITEM node, POINT &pt) {

Callers

nothing calls this directly

Calls 1

SelectItemMethod · 0.45

Tested by

no test coverage detected