Skip to content

Commit dd3aa4d

Browse files
committed
Add doc / context menus
1 parent be38655 commit dd3aa4d

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
@@ -389,6 +389,24 @@ IMGUI_NODE_EDITOR_API int BreakLinks(PinId pinId); // Break all links connected
389389
IMGUI_NODE_EDITOR_API void NavigateToContent(float duration = -1);
390390
IMGUI_NODE_EDITOR_API void NavigateToSelection(bool zoomIn = false, float duration = -1);
391391

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

0 commit comments

Comments
 (0)