PlotHistogram, PlotLines: register item ID in a more idiomatic manner. (#7935, #3072)
diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt
index 066a61f..54b3e8c 100644
--- a/docs/CHANGELOG.txt
+++ b/docs/CHANGELOG.txt
@@ -92,6 +92,8 @@
- TextLink(), TextLinkOpenURL(): change mouse cursor to Hand shape when hovered. (#7885, #7660)
- Tooltips, Drag and Drop: made it possible to override BeginTooltip() position while inside
a drag and drop source or target: a SetNextWindowPos() call won't be overriden. (#6973)
+- PlotHistogram, PlotLines: register item ID in a more idiomatic manner, fixes preventing
+ e.g. GetItemID() and other ID-based helper to work. (#7935, #3072)
- Style: added PushStyleVarX(), PushStyleVarY() helpers to modify only one component of a ImVec2 var.
- Fonts: made it possible to use PushFont()/PopFont() calls accross Begin() calls. (#3224, #3875, #6398, #7903)
- Backends:
diff --git a/imgui_demo.cpp b/imgui_demo.cpp
index fe38ebf..b83cf29 100644
--- a/imgui_demo.cpp
+++ b/imgui_demo.cpp
@@ -2004,6 +2004,10 @@
ImGui::PlotHistogram("Histogram", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0, 80));
ImGui::Separator();
+ ImGui::Text("Need better plotting and graphing? Consider using ImPlot:");
+ ImGui::TextLinkOpenURL("https://github.com/epezent/implot");
+ ImGui::Separator();
+
ImGui::TreePop();
}
@@ -6448,6 +6452,7 @@
ImGui::CheckboxFlags("_ScrollX", &table_flags, ImGuiTableFlags_ScrollX);
ImGui::CheckboxFlags("_ScrollY", &table_flags, ImGuiTableFlags_ScrollY);
ImGui::CheckboxFlags("_Resizable", &table_flags, ImGuiTableFlags_Resizable);
+ ImGui::CheckboxFlags("_Sortable", &table_flags, ImGuiTableFlags_Sortable);
ImGui::CheckboxFlags("_NoBordersInBody", &table_flags, ImGuiTableFlags_NoBordersInBody);
ImGui::CheckboxFlags("_HighlightHoveredColumn", &table_flags, ImGuiTableFlags_HighlightHoveredColumn);
ImGui::SetNextItemWidth(ImGui::GetFontSize() * 8);
diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp
index b550e8d..99992a7 100644
--- a/imgui_widgets.cpp
+++ b/imgui_widgets.cpp
@@ -8224,7 +8224,7 @@
const ImRect inner_bb(frame_bb.Min + style.FramePadding, frame_bb.Max - style.FramePadding);
const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0));
ItemSize(total_bb, style.FramePadding.y);
- if (!ItemAdd(total_bb, 0, &frame_bb))
+ if (!ItemAdd(total_bb, id, &frame_bb, ImGuiItemFlags_NoNav))
return -1;
const bool hovered = ItemHoverable(frame_bb, id, g.LastItemData.InFlags);