Demo: Tweak. Comments. Metrics: Added some Drag and Drop info.
diff --git a/imgui.cpp b/imgui.cpp
index 10ef65b..2e16fb3 100644
--- a/imgui.cpp
+++ b/imgui.cpp
@@ -2914,7 +2914,7 @@
IM_ASSERT(g.CurrentWindowStack.Size == 1); // Mismatched Begin()/End() calls
if (g.CurrentWindow && !g.CurrentWindow->WriteAccessed)
g.CurrentWindow->Active = false;
- ImGui::End();
+ End();
if (g.ActiveId == 0 && g.HoveredId == 0)
{
@@ -3715,7 +3715,7 @@
void ImGui::EndTooltip()
{
IM_ASSERT(GetCurrentWindowRead()->Flags & ImGuiWindowFlags_Tooltip); // Mismatched BeginTooltip()/EndTooltip() calls
- ImGui::End();
+ End();
}
// Mark popup as open (toggle toward open state).
@@ -4011,7 +4011,7 @@
IM_ASSERT(window->Flags & ImGuiWindowFlags_ChildWindow); // Mismatched BeginChild()/EndChild() callss
if (window->BeginCount > 1)
{
- ImGui::End();
+ End();
}
else
{
@@ -4021,7 +4021,7 @@
sz.x = ImMax(4.0f, sz.x);
if (window->AutoFitChildAxises & (1 << ImGuiAxis_Y))
sz.y = ImMax(4.0f, sz.y);
- ImGui::End();
+ End();
ImGuiWindow* parent_window = GetCurrentWindow();
ImRect bb(parent_window->DC.CursorPos, parent_window->DC.CursorPos + sz);
@@ -11730,6 +11730,7 @@
ImGui::Text("ActiveId: 0x%08X/0x%08X (%.2f sec)", g.ActiveId, g.ActiveIdPreviousFrame, g.ActiveIdTimer);
ImGui::Text("ActiveIdWindow: '%s'", g.ActiveIdWindow ? g.ActiveIdWindow->Name : "NULL");
ImGui::Text("NavWindow: '%s'", g.NavWindow ? g.NavWindow->Name : "NULL");
+ ImGui::Text("DragDrop: %d, SourceId = 0x%08X, Payload \"%s\" (%d bytes)", g.DragDropActive, g.DragDropPayload.SourceId, g.DragDropPayload.DataType, g.DragDropPayload.DataSize);
ImGui::TreePop();
}
}
diff --git a/imgui_demo.cpp b/imgui_demo.cpp
index 94531a1..1ccc299 100644
--- a/imgui_demo.cpp
+++ b/imgui_demo.cpp
@@ -2365,6 +2365,7 @@
if (ImGui::MenuItem("Top-right", NULL, corner == 1)) corner = 1;
if (ImGui::MenuItem("Bottom-left", NULL, corner == 2)) corner = 2;
if (ImGui::MenuItem("Bottom-right", NULL, corner == 3)) corner = 3;
+ if (p_open && ImGui::MenuItem("Close")) *p_open = false;
ImGui::EndPopup();
}
ImGui::End();