Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
244288f
Add custom right-click context menu
moe93 Feb 20, 2025
fe62178
Fixes for internal API changes in 1.92.x: ImFontBaked, ImGuiWindow::C…
ocornut Mar 5, 2025
494a4d9
Fixes for internal API changes in 1.92.x: PlotImage() uses ImTextureR…
ocornut Mar 19, 2025
9b6c70e
various typo fixes (#642)
bostick Nov 6, 2025
16e5ff7
chore: bump minimum required cmake version for CI
brenocq Nov 7, 2025
35407e3
feat: implot example
brenocq Nov 8, 2025
61ac306
chore: update copyright notice
brenocq Nov 8, 2025
12955f0
style: rename drag functions argument held to out_held in header (#641)
mihaly-sisak Nov 8, 2025
2992339
feat: add IMPLOT_VERSION_NUM
brenocq Nov 8, 2025
6ad10b0
fix: add missing default constructors (#645)
brenocq Nov 8, 2025
6484872
fix: remove extra ; and trailing whitespaces
brenocq Nov 8, 2025
c8a982c
fix: missing IMPLOT_API in some functions (#549)
Cidolfas Nov 8, 2025
ef63222
feat: add ImPlotLegendFlags_Reverse (#640)
howprice Nov 9, 2025
e60fee3
chore: ignore llm instruction files
brenocq Nov 11, 2025
049b090
fix: digital plots do not respect axis inversion (#522)
ozlb Nov 11, 2025
c5d42ba
feat: remove 60 FPS assumption from realtime plots
brenocq Nov 11, 2025
d90583b
fix: dpi scaling for hardcoded plot sizes in demo (#636)
prybicki Nov 11, 2025
bcf5ace
docs: add issue templates
brenocq Nov 14, 2025
12abeee
feat: add reverse flag to legend options demo
brenocq Nov 15, 2025
baa0370
chore: decrease example c++ standard version to 11
brenocq Nov 28, 2025
f2a2b2c
chore: update version to v0.17
brenocq Nov 30, 2025
56e6898
chore: bump version to v0.18 WIP
brenocq Dec 3, 2025
dc0b1f3
fix: `DragRect` resizing when its size is zero (#661)
JunkyoLee Dec 3, 2025
de8bf9f
merge: branch 'master' into feat/custom-context-menu
brenocq Feb 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 33 additions & 1 deletion implot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3236,7 +3236,8 @@ void EndPlot() {


// main ctx menu
if (can_ctx && plot.Hovered)
// if (can_ctx && plot.Hovered) <-- old line // OdehM 2025-02-20
if (can_ctx && !ImHasFlag(plot.Flags, ImPlotFlags_NoCentralMenu) && plot.Hovered) // <-- new line // OdehM 2025-02-20
ImGui::OpenPopup("##PlotContext");
if (ImGui::BeginPopup("##PlotContext")) {
ShowPlotContextMenu(plot);
Expand Down Expand Up @@ -5890,6 +5891,37 @@ void StyleColorsLight(ImPlotStyle* dst) {
colors[ImPlotCol_Crosshairs] = ImVec4(0.00f, 0.00f, 0.00f, 0.50f);
}

//-----------------------------------------------------------------------------
// [SECTION] Context Menu // OdehM 2025-02-20
//-----------------------------------------------------------------------------

bool BeginCustomContext()
{
ImPlotContext& gp = *GImPlot;

if (gp.CurrentPlot == nullptr) return false;

ImPlotPlot &plot = *gp.CurrentPlot;

const bool can_ctx = plot.Hovered &&
!plot.Items.Legend.Hovered &&
!plot.ContextLocked && // <-- added
ImGui::IsMouseReleased(ImGuiMouseButton_Right);

// main ctx menu
if (can_ctx)
ImGui::OpenPopup("##CustomPlotContext");

return ImGui::BeginPopup("##CustomPlotContext");
}

void EndCustomContext(bool include_default)
{
if (include_default)
ShowPlotContextMenu(*(GImPlot->CurrentPlot));
ImGui::EndPopup();
}

//-----------------------------------------------------------------------------
// [SECTION] Obsolete Functions/Types
//-----------------------------------------------------------------------------
Expand Down
13 changes: 12 additions & 1 deletion implot.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
// [SECTION] Input Mapping
// [SECTION] Miscellaneous
// [SECTION] Demo
// [SECTION] Context Menu // OdehM 2025-02-20
// [SECTION] Obsolete API

#pragma once
Expand Down Expand Up @@ -162,6 +163,7 @@ enum ImPlotFlags_ {
ImPlotFlags_NoFrame = 1 << 6, // the ImGui frame will not be rendered
ImPlotFlags_Equal = 1 << 7, // x and y axes pairs will be constrained to have the same units/pixel
ImPlotFlags_Crosshairs = 1 << 8, // the default mouse cursor will be replaced with a crosshair when hovered
ImPlotFlags_NoCentralMenu = 1 << 9, // disable the central menu, but allow other menus (such as legends and axis) // OdehM 2025_02_20
ImPlotFlags_CanvasOnly = ImPlotFlags_NoTitle | ImPlotFlags_NoLegend | ImPlotFlags_NoMenus | ImPlotFlags_NoBoxSelect | ImPlotFlags_NoMouseText
};

Expand Down Expand Up @@ -1274,7 +1276,7 @@ IMPLOT_API void BustColorCache(const char* plot_title_id = nullptr);
//-----------------------------------------------------------------------------
// [SECTION] Input Mapping
//-----------------------------------------------------------------------------

// Provides access to input mapping structure for permanent modifications to controls for pan, select, etc.
IMPLOT_API ImPlotInputMap& GetInputMap();

Expand Down Expand Up @@ -1319,6 +1321,15 @@ IMPLOT_API void ShowMetricsWindow(bool* p_popen = nullptr);
// Shows the ImPlot demo window (add implot_demo.cpp to your sources!)
IMPLOT_API void ShowDemoWindow(bool* p_open = nullptr);

//-----------------------------------------------------------------------------
// [SECTION] Context Menu // OdehM 2025-02-20
//-----------------------------------------------------------------------------

// Begin a custom central plot context menu
IMPLOT_API bool BeginCustomContext();
// End a custom central plot context menu
IMPLOT_API void EndCustomContext(bool include_default = false); // if include_default is true, the normal context menu will be appended

} // namespace ImPlot

//-----------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions implot_items.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3015,6 +3015,7 @@ void PlotDigitalEx(const char* label_id, Getter getter, const ImPlotSpec& spec)
// do not extend plot outside plot range
pMin.x = ImClamp(pMin.x, !x_axis.IsInverted() ? x_axis.PixelMin : x_axis.PixelMax, !x_axis.IsInverted() ? x_axis.PixelMax - 1 : x_axis.PixelMin - 1);
pMax.x = ImClamp(pMax.x, !x_axis.IsInverted() ? x_axis.PixelMin : x_axis.PixelMax, !x_axis.IsInverted() ? x_axis.PixelMax - 1 : x_axis.PixelMin - 1);

//plot a rectangle that extends up to x2 with y1 height
if ((gp.CurrentPlot->PlotRect.Contains(pMin) || gp.CurrentPlot->PlotRect.Contains(pMax))) {
// ImVec4 colAlpha = item->Color;
Expand Down