| 87 | } |
| 88 | |
| 89 | std::optional<String> CPropertySystemMenu::ShowMenu(CWnd* pParentWnd, UINT idFirst, const String& format) |
| 90 | { |
| 91 | std::optional<String> result; |
| 92 | CMenu menu; |
| 93 | menu.CreatePopupMenu(); |
| 94 | PropertySystem ps(PropertySystem::VIEWABLE); |
| 95 | CreatePropertyMenu(menu.m_hMenu, ps.GetCanonicalNames(), idFirst, format); |
| 96 | |
| 97 | CPoint pt; |
| 98 | GetCursorPos(&pt); |
| 99 | const int command = menu.TrackPopupMenu( |
| 100 | TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, pParentWnd); |
| 101 | if (command == 0) |
| 102 | { |
| 103 | // User cancelled the menu |
| 104 | } |
| 105 | else |
| 106 | { |
| 107 | result = ps.GetCanonicalNames()[command - idFirst]; |
| 108 | } |
| 109 | |
| 110 | DestroyMenu(); |
| 111 | |
| 112 | return result; |
| 113 | } |
nothing calls this directly
no test coverage detected