| 23206 | } |
| 23207 | |
| 23208 | void ImGui::ShowDebugLogWindow(bool* p_open) |
| 23209 | { |
| 23210 | ImGuiContext& g = *GImGui; |
| 23211 | if ((g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasSize) == 0) |
| 23212 | SetNextWindowSize(ImVec2(0.0f, GetFontSize() * 12.0f), ImGuiCond_FirstUseEver); |
| 23213 | if (!Begin("Dear ImGui Debug Log", p_open) || GetCurrentWindow()->BeginCount > 1) |
| 23214 | { |
| 23215 | End(); |
| 23216 | return; |
| 23217 | } |
| 23218 | |
| 23219 | ImGuiDebugLogFlags all_enable_flags = ImGuiDebugLogFlags_EventMask_ & ~ImGuiDebugLogFlags_EventInputRouting; |
| 23220 | CheckboxFlags("All", &g.DebugLogFlags, all_enable_flags); |
| 23221 | SetItemTooltip("(except InputRouting which is spammy)"); |
| 23222 | |
| 23223 | ShowDebugLogFlag("Errors", ImGuiDebugLogFlags_EventError); |
| 23224 | ShowDebugLogFlag("ActiveId", ImGuiDebugLogFlags_EventActiveId); |
| 23225 | ShowDebugLogFlag("Clipper", ImGuiDebugLogFlags_EventClipper); |
| 23226 | ShowDebugLogFlag("Docking", ImGuiDebugLogFlags_EventDocking); |
| 23227 | ShowDebugLogFlag("Focus", ImGuiDebugLogFlags_EventFocus); |
| 23228 | ShowDebugLogFlag("IO", ImGuiDebugLogFlags_EventIO); |
| 23229 | ShowDebugLogFlag("Font", ImGuiDebugLogFlags_EventFont); |
| 23230 | ShowDebugLogFlag("Nav", ImGuiDebugLogFlags_EventNav); |
| 23231 | ShowDebugLogFlag("Popup", ImGuiDebugLogFlags_EventPopup); |
| 23232 | ShowDebugLogFlag("Selection", ImGuiDebugLogFlags_EventSelection); |
| 23233 | ShowDebugLogFlag("Viewport", ImGuiDebugLogFlags_EventViewport); |
| 23234 | ShowDebugLogFlag("InputRouting", ImGuiDebugLogFlags_EventInputRouting); |
| 23235 | |
| 23236 | if (SmallButton("Clear")) |
| 23237 | { |
| 23238 | g.DebugLogBuf.clear(); |
| 23239 | g.DebugLogIndex.clear(); |
| 23240 | g.DebugLogSkippedErrors = 0; |
| 23241 | } |
| 23242 | SameLine(); |
| 23243 | if (SmallButton("Copy")) |
| 23244 | SetClipboardText(g.DebugLogBuf.c_str()); |
| 23245 | SameLine(); |
| 23246 | if (SmallButton("Configure Outputs..")) |
| 23247 | OpenPopup("Outputs"); |
| 23248 | if (BeginPopup("Outputs")) |
| 23249 | { |
| 23250 | CheckboxFlags("OutputToTTY", &g.DebugLogFlags, ImGuiDebugLogFlags_OutputToTTY); |
| 23251 | #ifndef IMGUI_ENABLE_TEST_ENGINE |
| 23252 | BeginDisabled(); |
| 23253 | #endif |
| 23254 | CheckboxFlags("OutputToTestEngine", &g.DebugLogFlags, ImGuiDebugLogFlags_OutputToTestEngine); |
| 23255 | #ifndef IMGUI_ENABLE_TEST_ENGINE |
| 23256 | EndDisabled(); |
| 23257 | #endif |
| 23258 | EndPopup(); |
| 23259 | } |
| 23260 | |
| 23261 | BeginChild("##log", ImVec2(0.0f, 0.0f), ImGuiChildFlags_Borders, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar); |
| 23262 | |
| 23263 | const ImGuiDebugLogFlags backup_log_flags = g.DebugLogFlags; |
| 23264 | g.DebugLogFlags &= ~ImGuiDebugLogFlags_EventClipper; |
| 23265 |
nothing calls this directly
no test coverage detected