| 1524 | } |
| 1525 | |
| 1526 | void ShowSubplotsContextMenu(ImPlotSubplot& subplot) { |
| 1527 | if ((ImGui::BeginMenu("Linking"))) { |
| 1528 | if (ImGui::MenuItem("Link Rows",nullptr,ImHasFlag(subplot.Flags, ImPlotSubplotFlags_LinkRows))) |
| 1529 | ImFlipFlag(subplot.Flags, ImPlotSubplotFlags_LinkRows); |
| 1530 | if (ImGui::MenuItem("Link Cols",nullptr,ImHasFlag(subplot.Flags, ImPlotSubplotFlags_LinkCols))) |
| 1531 | ImFlipFlag(subplot.Flags, ImPlotSubplotFlags_LinkCols); |
| 1532 | if (ImGui::MenuItem("Link All X",nullptr,ImHasFlag(subplot.Flags, ImPlotSubplotFlags_LinkAllX))) |
| 1533 | ImFlipFlag(subplot.Flags, ImPlotSubplotFlags_LinkAllX); |
| 1534 | if (ImGui::MenuItem("Link All Y",nullptr,ImHasFlag(subplot.Flags, ImPlotSubplotFlags_LinkAllY))) |
| 1535 | ImFlipFlag(subplot.Flags, ImPlotSubplotFlags_LinkAllY); |
| 1536 | ImGui::EndMenu(); |
| 1537 | } |
| 1538 | if ((ImGui::BeginMenu("Settings"))) { |
| 1539 | BeginDisabledControls(!subplot.HasTitle); |
| 1540 | if (ImGui::MenuItem("Title",nullptr,subplot.HasTitle && !ImHasFlag(subplot.Flags, ImPlotSubplotFlags_NoTitle))) |
| 1541 | ImFlipFlag(subplot.Flags, ImPlotSubplotFlags_NoTitle); |
| 1542 | EndDisabledControls(!subplot.HasTitle); |
| 1543 | if (ImGui::MenuItem("Resizable",nullptr,!ImHasFlag(subplot.Flags, ImPlotSubplotFlags_NoResize))) |
| 1544 | ImFlipFlag(subplot.Flags, ImPlotSubplotFlags_NoResize); |
| 1545 | if (ImGui::MenuItem("Align",nullptr,!ImHasFlag(subplot.Flags, ImPlotSubplotFlags_NoAlign))) |
| 1546 | ImFlipFlag(subplot.Flags, ImPlotSubplotFlags_NoAlign); |
| 1547 | if (ImGui::MenuItem("Share Items",nullptr,ImHasFlag(subplot.Flags, ImPlotSubplotFlags_ShareItems))) |
| 1548 | ImFlipFlag(subplot.Flags, ImPlotSubplotFlags_ShareItems); |
| 1549 | ImGui::EndMenu(); |
| 1550 | } |
| 1551 | } |
| 1552 | |
| 1553 | void ShowPlotContextMenu(ImPlotPlot& plot) { |
| 1554 | ImPlotContext& gp = *GImPlot; |
no test coverage detected