| 22494 | } |
| 22495 | |
| 22496 | void ImGui::ShowDebugLogWindow(bool* p_open) |
| 22497 | { |
| 22498 | ImGuiContext& g = *GImGui; |
| 22499 | if ((g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasSize) == 0) |
| 22500 | SetNextWindowSize(ImVec2(0.0f, GetFontSize() * 12.0f), ImGuiCond_FirstUseEver); |
| 22501 | if (!Begin("Dear ImGui Debug Log", p_open) || GetCurrentWindow()->BeginCount > 1) |
| 22502 | { |
| 22503 | End(); |
| 22504 | return; |
| 22505 | } |
| 22506 | |
| 22507 | ImGuiDebugLogFlags all_enable_flags = ImGuiDebugLogFlags_EventMask_ & ~ImGuiDebugLogFlags_EventInputRouting; |
| 22508 | CheckboxFlags("All", &g.DebugLogFlags, all_enable_flags); |
| 22509 | SetItemTooltip("(except InputRouting which is spammy)"); |
| 22510 | |
| 22511 | ShowDebugLogFlag("Errors", ImGuiDebugLogFlags_EventError); |
| 22512 | ShowDebugLogFlag("ActiveId", ImGuiDebugLogFlags_EventActiveId); |
| 22513 | ShowDebugLogFlag("Clipper", ImGuiDebugLogFlags_EventClipper); |
| 22514 | ShowDebugLogFlag("Docking", ImGuiDebugLogFlags_EventDocking); |
| 22515 | ShowDebugLogFlag("Focus", ImGuiDebugLogFlags_EventFocus); |
| 22516 | ShowDebugLogFlag("IO", ImGuiDebugLogFlags_EventIO); |
| 22517 | //ShowDebugLogFlag("Font", ImGuiDebugLogFlags_EventFont); |
| 22518 | ShowDebugLogFlag("Nav", ImGuiDebugLogFlags_EventNav); |
| 22519 | ShowDebugLogFlag("Popup", ImGuiDebugLogFlags_EventPopup); |
| 22520 | ShowDebugLogFlag("Selection", ImGuiDebugLogFlags_EventSelection); |
| 22521 | ShowDebugLogFlag("Viewport", ImGuiDebugLogFlags_EventViewport); |
| 22522 | ShowDebugLogFlag("InputRouting", ImGuiDebugLogFlags_EventInputRouting); |
| 22523 | |
| 22524 | if (SmallButton("Clear")) |
| 22525 | { |
| 22526 | g.DebugLogBuf.clear(); |
| 22527 | g.DebugLogIndex.clear(); |
| 22528 | g.DebugLogSkippedErrors = 0; |
| 22529 | } |
| 22530 | SameLine(); |
| 22531 | if (SmallButton("Copy")) |
| 22532 | SetClipboardText(g.DebugLogBuf.c_str()); |
| 22533 | SameLine(); |
| 22534 | if (SmallButton("Configure Outputs..")) |
| 22535 | OpenPopup("Outputs"); |
| 22536 | if (BeginPopup("Outputs")) |
| 22537 | { |
| 22538 | CheckboxFlags("OutputToTTY", &g.DebugLogFlags, ImGuiDebugLogFlags_OutputToTTY); |
| 22539 | #ifndef IMGUI_ENABLE_TEST_ENGINE |
| 22540 | BeginDisabled(); |
| 22541 | #endif |
| 22542 | CheckboxFlags("OutputToTestEngine", &g.DebugLogFlags, ImGuiDebugLogFlags_OutputToTestEngine); |
| 22543 | #ifndef IMGUI_ENABLE_TEST_ENGINE |
| 22544 | EndDisabled(); |
| 22545 | #endif |
| 22546 | EndPopup(); |
| 22547 | } |
| 22548 | |
| 22549 | BeginChild("##log", ImVec2(0.0f, 0.0f), ImGuiChildFlags_Borders, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar); |
| 22550 | |
| 22551 | const ImGuiDebugLogFlags backup_log_flags = g.DebugLogFlags; |
| 22552 | g.DebugLogFlags &= ~ImGuiDebugLogFlags_EventClipper; |
| 22553 |
nothing calls this directly
no test coverage detected