|
@@ -600,8 +600,10 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
|
ImGui::SeparatorText("Debug");
|
|
ImGui::SeparatorText("Debug");
|
|
ImGui::Checkbox("io.ConfigDebugIsDebuggerPresent", &io.ConfigDebugIsDebuggerPresent);
|
|
ImGui::Checkbox("io.ConfigDebugIsDebuggerPresent", &io.ConfigDebugIsDebuggerPresent);
|
|
ImGui::SameLine(); HelpMarker("Enable various tools calling IM_DEBUG_BREAK().\n\nRequires a debugger being attached, otherwise IM_DEBUG_BREAK() options will appear to crash your application.");
|
|
ImGui::SameLine(); HelpMarker("Enable various tools calling IM_DEBUG_BREAK().\n\nRequires a debugger being attached, otherwise IM_DEBUG_BREAK() options will appear to crash your application.");
|
|
|
|
+ ImGui::Checkbox("io.ConfigDebugHighlightIdConflicts", &io.ConfigDebugHighlightIdConflicts);
|
|
|
|
+ ImGui::SameLine(); HelpMarker("Highlight and show an error message when multiple items have conflicting identifiers.");
|
|
ImGui::BeginDisabled();
|
|
ImGui::BeginDisabled();
|
|
- ImGui::Checkbox("io.ConfigDebugBeginReturnValueOnce", &io.ConfigDebugBeginReturnValueOnce); // .
|
|
|
|
|
|
+ ImGui::Checkbox("io.ConfigDebugBeginReturnValueOnce", &io.ConfigDebugBeginReturnValueOnce);
|
|
ImGui::EndDisabled();
|
|
ImGui::EndDisabled();
|
|
ImGui::SameLine(); HelpMarker("First calls to Begin()/BeginChild() will return false.\n\nTHIS OPTION IS DISABLED because it needs to be set at application boot-time to make sense. Showing the disabled option is a way to make this feature easier to discover.");
|
|
ImGui::SameLine(); HelpMarker("First calls to Begin()/BeginChild() will return false.\n\nTHIS OPTION IS DISABLED because it needs to be set at application boot-time to make sense. Showing the disabled option is a way to make this feature easier to discover.");
|
|
ImGui::Checkbox("io.ConfigDebugBeginReturnValueLoop", &io.ConfigDebugBeginReturnValueLoop);
|
|
ImGui::Checkbox("io.ConfigDebugBeginReturnValueLoop", &io.ConfigDebugBeginReturnValueLoop);
|
|
@@ -744,6 +746,7 @@ static void ShowDemoWindowMenuBar(ImGuiDemoWindowData* demo_data)
|
|
if (ImGui::BeginMenu("Tools"))
|
|
if (ImGui::BeginMenu("Tools"))
|
|
{
|
|
{
|
|
IMGUI_DEMO_MARKER("Menu/Tools");
|
|
IMGUI_DEMO_MARKER("Menu/Tools");
|
|
|
|
+ ImGuiIO& io = ImGui::GetIO();
|
|
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
|
|
#ifndef IMGUI_DISABLE_DEBUG_TOOLS
|
|
const bool has_debug_tools = true;
|
|
const bool has_debug_tools = true;
|
|
#else
|
|
#else
|
|
@@ -752,14 +755,16 @@ static void ShowDemoWindowMenuBar(ImGuiDemoWindowData* demo_data)
|
|
ImGui::MenuItem("Metrics/Debugger", NULL, &demo_data->ShowMetrics, has_debug_tools);
|
|
ImGui::MenuItem("Metrics/Debugger", NULL, &demo_data->ShowMetrics, has_debug_tools);
|
|
ImGui::MenuItem("Debug Log", NULL, &demo_data->ShowDebugLog, has_debug_tools);
|
|
ImGui::MenuItem("Debug Log", NULL, &demo_data->ShowDebugLog, has_debug_tools);
|
|
ImGui::MenuItem("ID Stack Tool", NULL, &demo_data->ShowIDStackTool, has_debug_tools);
|
|
ImGui::MenuItem("ID Stack Tool", NULL, &demo_data->ShowIDStackTool, has_debug_tools);
|
|
- ImGui::MenuItem("Style Editor", NULL, &demo_data->ShowStyleEditor);
|
|
|
|
- bool is_debugger_present = ImGui::GetIO().ConfigDebugIsDebuggerPresent;
|
|
|
|
|
|
+ bool is_debugger_present = io.ConfigDebugIsDebuggerPresent;
|
|
if (ImGui::MenuItem("Item Picker", NULL, false, has_debug_tools && is_debugger_present))
|
|
if (ImGui::MenuItem("Item Picker", NULL, false, has_debug_tools && is_debugger_present))
|
|
ImGui::DebugStartItemPicker();
|
|
ImGui::DebugStartItemPicker();
|
|
if (!is_debugger_present)
|
|
if (!is_debugger_present)
|
|
ImGui::SetItemTooltip("Requires io.ConfigDebugIsDebuggerPresent=true to be set.\n\nWe otherwise disable the menu option to avoid casual users crashing the application.\n\nYou can however always access the Item Picker in Metrics->Tools.");
|
|
ImGui::SetItemTooltip("Requires io.ConfigDebugIsDebuggerPresent=true to be set.\n\nWe otherwise disable the menu option to avoid casual users crashing the application.\n\nYou can however always access the Item Picker in Metrics->Tools.");
|
|
- ImGui::Separator();
|
|
|
|
|
|
+ ImGui::MenuItem("Style Editor", NULL, &demo_data->ShowStyleEditor);
|
|
ImGui::MenuItem("About Dear ImGui", NULL, &demo_data->ShowAbout);
|
|
ImGui::MenuItem("About Dear ImGui", NULL, &demo_data->ShowAbout);
|
|
|
|
+
|
|
|
|
+ ImGui::SeparatorText("Debug Options");
|
|
|
|
+ ImGui::MenuItem("Highlight ID Conflicts", NULL, &io.ConfigDebugHighlightIdConflicts, has_debug_tools);
|
|
ImGui::EndMenu();
|
|
ImGui::EndMenu();
|
|
}
|
|
}
|
|
ImGui::EndMenuBar();
|
|
ImGui::EndMenuBar();
|
|
@@ -2060,8 +2065,8 @@ static void ShowDemoWindowWidgets(ImGuiDemoWindowData* demo_data)
|
|
ImGui::SameLine();
|
|
ImGui::SameLine();
|
|
ImGui::SliderInt("Sample count", &display_count, 1, 400);
|
|
ImGui::SliderInt("Sample count", &display_count, 1, 400);
|
|
float (*func)(void*, int) = (func_type == 0) ? Funcs::Sin : Funcs::Saw;
|
|
float (*func)(void*, int) = (func_type == 0) ? Funcs::Sin : Funcs::Saw;
|
|
- ImGui::PlotLines("Lines", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0, 80));
|
|
|
|
- ImGui::PlotHistogram("Histogram", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0, 80));
|
|
|
|
|
|
+ ImGui::PlotLines("Lines##2", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0, 80));
|
|
|
|
+ ImGui::PlotHistogram("Histogram##2", func, NULL, display_count, 0, NULL, -1.0f, 1.0f, ImVec2(0, 80));
|
|
ImGui::Separator();
|
|
ImGui::Separator();
|
|
|
|
|
|
ImGui::Text("Need better plotting and graphing? Consider using ImPlot:");
|
|
ImGui::Text("Need better plotting and graphing? Consider using ImPlot:");
|
|
@@ -2656,6 +2661,11 @@ static void ShowDemoWindowWidgets(ImGuiDemoWindowData* demo_data)
|
|
IMGUI_DEMO_MARKER("Widgets/Drag and Drop/Drag to reorder items (simple)");
|
|
IMGUI_DEMO_MARKER("Widgets/Drag and Drop/Drag to reorder items (simple)");
|
|
if (ImGui::TreeNode("Drag to reorder items (simple)"))
|
|
if (ImGui::TreeNode("Drag to reorder items (simple)"))
|
|
{
|
|
{
|
|
|
|
+ // FIXME: there is temporary (usually single-frame) ID Conflict during reordering as a same item may be submitting twice.
|
|
|
|
+ // This code was always slightly faulty but in a way which was not easily noticeable.
|
|
|
|
+ // Until we fix this, enable ImGuiItemFlags_AllowDuplicateId to disable detecting the issue.
|
|
|
|
+ ImGui::PushItemFlag(ImGuiItemFlags_AllowDuplicateId, true);
|
|
|
|
+
|
|
// Simple reordering
|
|
// Simple reordering
|
|
HelpMarker(
|
|
HelpMarker(
|
|
"We don't use the drag and drop api at all here! "
|
|
"We don't use the drag and drop api at all here! "
|
|
@@ -2677,6 +2687,8 @@ static void ShowDemoWindowWidgets(ImGuiDemoWindowData* demo_data)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ ImGui::PopItemFlag();
|
|
ImGui::TreePop();
|
|
ImGui::TreePop();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -4300,7 +4312,7 @@ static void ShowDemoWindowLayout()
|
|
// down by FramePadding.y ahead of time)
|
|
// down by FramePadding.y ahead of time)
|
|
ImGui::AlignTextToFramePadding();
|
|
ImGui::AlignTextToFramePadding();
|
|
ImGui::Text("OK Blahblah"); ImGui::SameLine();
|
|
ImGui::Text("OK Blahblah"); ImGui::SameLine();
|
|
- ImGui::Button("Some framed item"); ImGui::SameLine();
|
|
|
|
|
|
+ ImGui::Button("Some framed item##2"); ImGui::SameLine();
|
|
HelpMarker("We call AlignTextToFramePadding() to vertically align the text baseline by +FramePadding.y");
|
|
HelpMarker("We call AlignTextToFramePadding() to vertically align the text baseline by +FramePadding.y");
|
|
|
|
|
|
// SmallButton() uses the same vertical padding as Text
|
|
// SmallButton() uses the same vertical padding as Text
|
|
@@ -7223,12 +7235,14 @@ static void ShowDemoWindowColumns()
|
|
{
|
|
{
|
|
if (h_borders && ImGui::GetColumnIndex() == 0)
|
|
if (h_borders && ImGui::GetColumnIndex() == 0)
|
|
ImGui::Separator();
|
|
ImGui::Separator();
|
|
|
|
+ ImGui::PushID(i);
|
|
ImGui::Text("%c%c%c", 'a' + i, 'a' + i, 'a' + i);
|
|
ImGui::Text("%c%c%c", 'a' + i, 'a' + i, 'a' + i);
|
|
ImGui::Text("Width %.2f", ImGui::GetColumnWidth());
|
|
ImGui::Text("Width %.2f", ImGui::GetColumnWidth());
|
|
ImGui::Text("Avail %.2f", ImGui::GetContentRegionAvail().x);
|
|
ImGui::Text("Avail %.2f", ImGui::GetContentRegionAvail().x);
|
|
ImGui::Text("Offset %.2f", ImGui::GetColumnOffset());
|
|
ImGui::Text("Offset %.2f", ImGui::GetColumnOffset());
|
|
ImGui::Text("Long text that is likely to clip");
|
|
ImGui::Text("Long text that is likely to clip");
|
|
ImGui::Button("Button", ImVec2(-FLT_MIN, 0.0f));
|
|
ImGui::Button("Button", ImVec2(-FLT_MIN, 0.0f));
|
|
|
|
+ ImGui::PopID();
|
|
ImGui::NextColumn();
|
|
ImGui::NextColumn();
|
|
}
|
|
}
|
|
ImGui::Columns(1);
|
|
ImGui::Columns(1);
|