Skip to content

Commit 06892b1

Browse files
committed
Add doc / context menus
1 parent 6d5ab7b commit 06892b1

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

imgui_node_editor.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,24 @@ IMGUI_NODE_EDITOR_API int BreakLinks(PinId pinId); // Break all links connected
385385
IMGUI_NODE_EDITOR_API void NavigateToContent(float duration = -1);
386386
IMGUI_NODE_EDITOR_API void NavigateToSelection(bool zoomIn = false, float duration = -1);
387387

388+
// Shows context menu for node, link or background
389+
// Typical usage (this should happen inside ed::Begin/ed::End block):
390+
// ed::Begin();
391+
// ... (Show nodes)
392+
// ed::Suspend();
393+
// if (ed::ShowNodeContextMenu(&contextNodeId))
394+
// ImGui::OpenPopup("Node Context Menu");
395+
// ed::Resume();
396+
// ...
397+
// ed::Suspend();
398+
// if (ImGui::BeginPopup("Node Context Menu"))
399+
// {
400+
// ImGui::Text("Node Context Menu, node ID: %d", contextNodeId);
401+
// ImGui::EndPopup();
402+
// }
403+
// ed::Resume();
404+
// ...
405+
// ed::End();
388406
IMGUI_NODE_EDITOR_API bool ShowNodeContextMenu(NodeId* nodeId);
389407
IMGUI_NODE_EDITOR_API bool ShowPinContextMenu(PinId* pinId);
390408
IMGUI_NODE_EDITOR_API bool ShowLinkContextMenu(LinkId* linkId);

0 commit comments

Comments
 (0)