| 17876 | } |
| 17877 | |
| 17878 | void ImGui::ShowDebugLogWindow(bool* p_open) |
| 17879 | { |
| 17880 | ImGuiContext& g = *GImGui; |
| 17881 | if ((g.NextWindowData.HasFlags & ImGuiNextWindowDataFlags_HasSize) == 0) |
| 17882 | SetNextWindowSize(ImVec2(0.0f, GetFontSize() * 12.0f), ImGuiCond_FirstUseEver); |
| 17883 | if (!Begin("Dear ImGui Debug Log", p_open) || GetCurrentWindow()->BeginCount > 1) |
| 17884 | { |
| 17885 | End(); |
| 17886 | return; |
| 17887 | } |
| 17888 | |
| 17889 | ImGuiDebugLogFlags all_enable_flags = ImGuiDebugLogFlags_EventMask_ & ~ImGuiDebugLogFlags_EventInputRouting; |
| 17890 | CheckboxFlags("All", &g.DebugLogFlags, all_enable_flags); |
| 17891 | SetItemTooltip("(except InputRouting which is spammy)"); |
| 17892 | |
| 17893 | ShowDebugLogFlag("Errors", ImGuiDebugLogFlags_EventError); |
| 17894 | ShowDebugLogFlag("ActiveId", ImGuiDebugLogFlags_EventActiveId); |
| 17895 | ShowDebugLogFlag("Clipper", ImGuiDebugLogFlags_EventClipper); |
| 17896 | ShowDebugLogFlag("Focus", ImGuiDebugLogFlags_EventFocus); |
| 17897 | ShowDebugLogFlag("IO", ImGuiDebugLogFlags_EventIO); |
| 17898 | ShowDebugLogFlag("Font", ImGuiDebugLogFlags_EventFont); |
| 17899 | ShowDebugLogFlag("Nav", ImGuiDebugLogFlags_EventNav); |
| 17900 | ShowDebugLogFlag("Popup", ImGuiDebugLogFlags_EventPopup); |
| 17901 | ShowDebugLogFlag("Selection", ImGuiDebugLogFlags_EventSelection); |
| 17902 | ShowDebugLogFlag("InputRouting", ImGuiDebugLogFlags_EventInputRouting); |
| 17903 | |
| 17904 | if (SmallButton("Clear")) |
| 17905 | { |
| 17906 | g.DebugLogBuf.clear(); |
| 17907 | g.DebugLogIndex.clear(); |
| 17908 | g.DebugLogSkippedErrors = 0; |
| 17909 | } |
| 17910 | SameLine(); |
| 17911 | if (SmallButton("Copy")) |
| 17912 | SetClipboardText(g.DebugLogBuf.c_str()); |
| 17913 | SameLine(); |
| 17914 | if (SmallButton("Configure Outputs..")) |
| 17915 | OpenPopup("Outputs"); |
| 17916 | if (BeginPopup("Outputs")) |
| 17917 | { |
| 17918 | CheckboxFlags("OutputToTTY", &g.DebugLogFlags, ImGuiDebugLogFlags_OutputToTTY); |
| 17919 | CheckboxFlags("OutputToDebugger", &g.DebugLogFlags, ImGuiDebugLogFlags_OutputToDebugger); |
| 17920 | #ifndef IMGUI_ENABLE_TEST_ENGINE |
| 17921 | BeginDisabled(); |
| 17922 | #endif |
| 17923 | CheckboxFlags("OutputToTestEngine", &g.DebugLogFlags, ImGuiDebugLogFlags_OutputToTestEngine); |
| 17924 | #ifndef IMGUI_ENABLE_TEST_ENGINE |
| 17925 | EndDisabled(); |
| 17926 | #endif |
| 17927 | EndPopup(); |
| 17928 | } |
| 17929 | |
| 17930 | BeginChild("##log", ImVec2(0.0f, 0.0f), ImGuiChildFlags_Borders, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar); |
| 17931 | |
| 17932 | const ImGuiDebugLogFlags backup_log_flags = g.DebugLogFlags; |
| 17933 | g.DebugLogFlags &= ~ImGuiDebugLogFlags_EventClipper; |
| 17934 | |
| 17935 | ImGuiListClipper clipper; |
nothing calls this directly
no test coverage detected