MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / DisplayDocContextMenu

Method DisplayDocContextMenu

3rdparty/imgui/src/imgui_demo.cpp:10538–10552  ·  view source on GitHub ↗

Display context menu for the Document

Source from the content-addressed store, hash-verified

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,

Callers 1

ShowExampleAppDocumentsFunction · 0.80

Calls 3

sprintfFunction · 0.85
DoSaveMethod · 0.80
push_backMethod · 0.45

Tested by

no test coverage detected