| 17441 | } |
| 17442 | |
| 17443 | void ImGui::ShowDebugLogWindow(bool* p_open) |
| 17444 | { |
| 17445 | ImGuiContext& g = *GImGui; |
| 17446 | if ((g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasSize) == 0) |
| 17447 | SetNextWindowSize(ImVec2(0.0f, GetFontSize() * 12.0f), ImGuiCond_FirstUseEver); |
| 17448 | if (!Begin("Dear ImGui Debug Log", p_open) || GetCurrentWindow()->BeginCount > 1) |
| 17449 | { |
| 17450 | End(); |
| 17451 | return; |
| 17452 | } |
| 17453 | |
| 17454 | ImGuiDebugLogFlags all_enable_flags = ImGuiDebugLogFlags_EventMask_ & ~ImGuiDebugLogFlags_EventInputRouting; |
| 17455 | CheckboxFlags("All", &g.DebugLogFlags, all_enable_flags); |
| 17456 | SetItemTooltip("(except InputRouting which is spammy)"); |
| 17457 | |
| 17458 | ShowDebugLogFlag("Errors", ImGuiDebugLogFlags_EventError); |
| 17459 | ShowDebugLogFlag("ActiveId", ImGuiDebugLogFlags_EventActiveId); |
| 17460 | ShowDebugLogFlag("Clipper", ImGuiDebugLogFlags_EventClipper); |
| 17461 | ShowDebugLogFlag("Focus", ImGuiDebugLogFlags_EventFocus); |
| 17462 | ShowDebugLogFlag("IO", ImGuiDebugLogFlags_EventIO); |
| 17463 | ShowDebugLogFlag("Font", ImGuiDebugLogFlags_EventFont); |
| 17464 | ShowDebugLogFlag("Nav", ImGuiDebugLogFlags_EventNav); |
| 17465 | ShowDebugLogFlag("Popup", ImGuiDebugLogFlags_EventPopup); |
| 17466 | ShowDebugLogFlag("Selection", ImGuiDebugLogFlags_EventSelection); |
| 17467 | ShowDebugLogFlag("InputRouting", ImGuiDebugLogFlags_EventInputRouting); |
| 17468 | |
| 17469 | if (SmallButton("Clear")) |
| 17470 | { |
| 17471 | g.DebugLogBuf.clear(); |
| 17472 | g.DebugLogIndex.clear(); |
| 17473 | g.DebugLogSkippedErrors = 0; |
| 17474 | } |
| 17475 | SameLine(); |
| 17476 | if (SmallButton("Copy")) |
| 17477 | SetClipboardText(g.DebugLogBuf.c_str()); |
| 17478 | SameLine(); |
| 17479 | if (SmallButton("Configure Outputs..")) |
| 17480 | OpenPopup("Outputs"); |
| 17481 | if (BeginPopup("Outputs")) |
| 17482 | { |
| 17483 | CheckboxFlags("OutputToTTY", &g.DebugLogFlags, ImGuiDebugLogFlags_OutputToTTY); |
| 17484 | #ifndef IMGUI_ENABLE_TEST_ENGINE |
| 17485 | BeginDisabled(); |
| 17486 | #endif |
| 17487 | CheckboxFlags("OutputToTestEngine", &g.DebugLogFlags, ImGuiDebugLogFlags_OutputToTestEngine); |
| 17488 | #ifndef IMGUI_ENABLE_TEST_ENGINE |
| 17489 | EndDisabled(); |
| 17490 | #endif |
| 17491 | EndPopup(); |
| 17492 | } |
| 17493 | |
| 17494 | BeginChild("##log", ImVec2(0.0f, 0.0f), ImGuiChildFlags_Borders, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar); |
| 17495 | |
| 17496 | const ImGuiDebugLogFlags backup_log_flags = g.DebugLogFlags; |
| 17497 | g.DebugLogFlags &= ~ImGuiDebugLogFlags_EventClipper; |
| 17498 | |
| 17499 | ImGuiListClipper clipper; |
| 17500 | clipper.Begin(g.DebugLogIndex.size()); |
nothing calls this directly
no test coverage detected