Display context menu for the Document
| 10536 | |
| 10537 | // Display context menu for the Document |
| 10538 | void DisplayDocContextMenu(MyDocument* doc) |
| 10539 | { |
| 10540 | if (!ImGui::BeginPopupContextItem()) |
| 10541 | return; |
| 10542 | |
| 10543 | char buf[256]; |
| 10544 | sprintf(buf, "Save %s", doc->Name); |
| 10545 | if (ImGui::MenuItem(buf, "Ctrl+S", false, doc->Open)) |
| 10546 | doc->DoSave(); |
| 10547 | if (ImGui::MenuItem("Rename...", "Ctrl+R", false, doc->Open)) |
| 10548 | RenamingDoc = doc; |
| 10549 | if (ImGui::MenuItem("Close", "Ctrl+W", false, doc->Open)) |
| 10550 | CloseQueue.push_back(doc); |
| 10551 | ImGui::EndPopup(); |
| 10552 | } |
| 10553 | |
| 10554 | // [Optional] Notify the system of Tabs/Windows closure that happened outside the regular tab interface. |
| 10555 | // If a tab has been closed programmatically (aka closed from another source such as the Checkbox() in the demo, |
no test coverage detected