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