| 1486 | } |
| 1487 | |
| 1488 | void ShowSubplotsContextMenu(ImPlotSubplot& subplot) { |
| 1489 | if ((ImGui::BeginMenu("Linking"))) { |
| 1490 | if (ImGui::MenuItem("Link Rows",nullptr,ImHasFlag(subplot.Flags, ImPlotSubplotFlags_LinkRows))) |
| 1491 | ImFlipFlag(subplot.Flags, ImPlotSubplotFlags_LinkRows); |
| 1492 | if (ImGui::MenuItem("Link Cols",nullptr,ImHasFlag(subplot.Flags, ImPlotSubplotFlags_LinkCols))) |
| 1493 | ImFlipFlag(subplot.Flags, ImPlotSubplotFlags_LinkCols); |
| 1494 | if (ImGui::MenuItem("Link All X",nullptr,ImHasFlag(subplot.Flags, ImPlotSubplotFlags_LinkAllX))) |
| 1495 | ImFlipFlag(subplot.Flags, ImPlotSubplotFlags_LinkAllX); |
| 1496 | if (ImGui::MenuItem("Link All Y",nullptr,ImHasFlag(subplot.Flags, ImPlotSubplotFlags_LinkAllY))) |
| 1497 | ImFlipFlag(subplot.Flags, ImPlotSubplotFlags_LinkAllY); |
| 1498 | ImGui::EndMenu(); |
| 1499 | } |
| 1500 | if ((ImGui::BeginMenu("Settings"))) { |
| 1501 | BeginDisabledControls(!subplot.HasTitle); |
| 1502 | if (ImGui::MenuItem("Title",nullptr,subplot.HasTitle && !ImHasFlag(subplot.Flags, ImPlotSubplotFlags_NoTitle))) |
| 1503 | ImFlipFlag(subplot.Flags, ImPlotSubplotFlags_NoTitle); |
| 1504 | EndDisabledControls(!subplot.HasTitle); |
| 1505 | if (ImGui::MenuItem("Resizable",nullptr,!ImHasFlag(subplot.Flags, ImPlotSubplotFlags_NoResize))) |
| 1506 | ImFlipFlag(subplot.Flags, ImPlotSubplotFlags_NoResize); |
| 1507 | if (ImGui::MenuItem("Align",nullptr,!ImHasFlag(subplot.Flags, ImPlotSubplotFlags_NoAlign))) |
| 1508 | ImFlipFlag(subplot.Flags, ImPlotSubplotFlags_NoAlign); |
| 1509 | if (ImGui::MenuItem("Share Items",nullptr,ImHasFlag(subplot.Flags, ImPlotSubplotFlags_ShareItems))) |
| 1510 | ImFlipFlag(subplot.Flags, ImPlotSubplotFlags_ShareItems); |
| 1511 | ImGui::EndMenu(); |
| 1512 | } |
| 1513 | } |
| 1514 | |
| 1515 | void ShowPlotContextMenu(ImPlotPlot& plot) { |
| 1516 | ImPlotContext& gp = *GImPlot; |
no test coverage detected