MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / ShowLegendContextMenu

Function ShowLegendContextMenu

Source/3rdParty/implot/implot.cpp:1500–1524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1498}
1499
1500bool ShowLegendContextMenu(ImPlotLegend& legend, bool visible) {
1501 const float s = ImGui::GetFrameHeight();
1502 bool ret = false;
1503 if (ImGui::Checkbox("Show",&visible))
1504 ret = true;
1505 if (legend.CanGoInside)
1506 ImGui::CheckboxFlags("Outside",(unsigned int*)&legend.Flags, ImPlotLegendFlags_Outside);
1507 if (ImGui::RadioButton("H", ImHasFlag(legend.Flags, ImPlotLegendFlags_Horizontal)))
1508 legend.Flags |= ImPlotLegendFlags_Horizontal;
1509 ImGui::SameLine();
1510 if (ImGui::RadioButton("V", !ImHasFlag(legend.Flags, ImPlotLegendFlags_Horizontal)))
1511 legend.Flags &= ~ImPlotLegendFlags_Horizontal;
1512 ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(2,2));
1513 if (ImGui::Button("NW",ImVec2(1.5f*s,s))) { legend.Location = ImPlotLocation_NorthWest; } ImGui::SameLine();
1514 if (ImGui::Button("N", ImVec2(1.5f*s,s))) { legend.Location = ImPlotLocation_North; } ImGui::SameLine();
1515 if (ImGui::Button("NE",ImVec2(1.5f*s,s))) { legend.Location = ImPlotLocation_NorthEast; }
1516 if (ImGui::Button("W", ImVec2(1.5f*s,s))) { legend.Location = ImPlotLocation_West; } ImGui::SameLine();
1517 if (ImGui::InvisibleButton("C", ImVec2(1.5f*s,s))) { } ImGui::SameLine();
1518 if (ImGui::Button("E", ImVec2(1.5f*s,s))) { legend.Location = ImPlotLocation_East; }
1519 if (ImGui::Button("SW",ImVec2(1.5f*s,s))) { legend.Location = ImPlotLocation_SouthWest; } ImGui::SameLine();
1520 if (ImGui::Button("S", ImVec2(1.5f*s,s))) { legend.Location = ImPlotLocation_South; } ImGui::SameLine();
1521 if (ImGui::Button("SE",ImVec2(1.5f*s,s))) { legend.Location = ImPlotLocation_SouthEast; }
1522 ImGui::PopStyleVar();
1523 return ret;
1524}
1525
1526void ShowSubplotsContextMenu(ImPlotSubplot& subplot) {
1527 if ((ImGui::BeginMenu("Linking"))) {

Callers 3

ShowPlotContextMenuFunction · 0.85
EndPlotFunction · 0.85
EndSubplotsFunction · 0.85

Calls 8

CheckboxFunction · 0.85
RadioButtonFunction · 0.85
ImHasFlagFunction · 0.85
ImVec2Function · 0.85
InvisibleButtonFunction · 0.85
PopStyleVarFunction · 0.85
PushStyleVarFunction · 0.70
ButtonFunction · 0.50

Tested by

no test coverage detected