| 23594 | } |
| 23595 | |
| 23596 | void ImGui::DebugNodeWindow(ImGuiWindow* window, const char* label) |
| 23597 | { |
| 23598 | if (window == NULL) |
| 23599 | { |
| 23600 | BulletText("%s: NULL", label); |
| 23601 | return; |
| 23602 | } |
| 23603 | |
| 23604 | ImGuiContext& g = *GImGui; |
| 23605 | const bool is_active = window->WasActive; |
| 23606 | ImGuiTreeNodeFlags tree_node_flags = (window == g.NavWindow) ? ImGuiTreeNodeFlags_Selected : ImGuiTreeNodeFlags_None; |
| 23607 | if (!is_active) { PushStyleColor(ImGuiCol_Text, GetStyleColorVec4(ImGuiCol_TextDisabled)); } |
| 23608 | const bool open = TreeNodeEx(label, tree_node_flags, "%s '%s'%s", label, window->Name, is_active ? "" : " *Inactive*"); |
| 23609 | if (!is_active) { PopStyleColor(); } |
| 23610 | if (IsItemHovered() && is_active) |
| 23611 | GetForegroundDrawList(window)->AddRect(window->Pos, window->Pos + window->Size, IM_COL32(255, 255, 0, 255)); |
| 23612 | if (!open) |
| 23613 | return; |
| 23614 | |
| 23615 | if (window->MemoryCompacted) |
| 23616 | TextDisabled("Note: some memory buffers have been compacted/freed."); |
| 23617 | |
| 23618 | if (g.IO.ConfigDebugIsDebuggerPresent && DebugBreakButton("**DebugBreak**", "in Begin()")) |
| 23619 | g.DebugBreakInWindow = window->ID; |
| 23620 | |
| 23621 | ImGuiWindowFlags flags = window->Flags; |
| 23622 | DebugNodeDrawList(window, window->Viewport, window->DrawList, "DrawList"); |
| 23623 | BulletText("Pos: (%.1f,%.1f), Size: (%.1f,%.1f), ContentSize (%.1f,%.1f) Ideal (%.1f,%.1f)", window->Pos.x, window->Pos.y, window->Size.x, window->Size.y, window->ContentSize.x, window->ContentSize.y, window->ContentSizeIdeal.x, window->ContentSizeIdeal.y); |
| 23624 | BulletText("Flags: 0x%08X (%s%s%s%s%s%s%s%s%s..)", flags, |
| 23625 | (flags & ImGuiWindowFlags_ChildWindow) ? "Child " : "", (flags & ImGuiWindowFlags_Tooltip) ? "Tooltip " : "", (flags & ImGuiWindowFlags_Popup) ? "Popup " : "", |
| 23626 | (flags & ImGuiWindowFlags_Modal) ? "Modal " : "", (flags & ImGuiWindowFlags_ChildMenu) ? "ChildMenu " : "", (flags & ImGuiWindowFlags_NoSavedSettings) ? "NoSavedSettings " : "", |
| 23627 | (flags & ImGuiWindowFlags_NoMouseInputs)? "NoMouseInputs":"", (flags & ImGuiWindowFlags_NoNavInputs) ? "NoNavInputs" : "", (flags & ImGuiWindowFlags_AlwaysAutoResize) ? "AlwaysAutoResize" : ""); |
| 23628 | if (flags & ImGuiWindowFlags_ChildWindow) |
| 23629 | BulletText("ChildFlags: 0x%08X (%s%s%s%s..)", window->ChildFlags, |
| 23630 | (window->ChildFlags & ImGuiChildFlags_Borders) ? "Borders " : "", |
| 23631 | (window->ChildFlags & ImGuiChildFlags_ResizeX) ? "ResizeX " : "", |
| 23632 | (window->ChildFlags & ImGuiChildFlags_ResizeY) ? "ResizeY " : "", |
| 23633 | (window->ChildFlags & ImGuiChildFlags_NavFlattened) ? "NavFlattened " : ""); |
| 23634 | BulletText("WindowClassId: 0x%08X", window->WindowClass.ClassId); |
| 23635 | BulletText("Scroll: (%.2f/%.2f,%.2f/%.2f) Scrollbar:%s%s", window->Scroll.x, window->ScrollMax.x, window->Scroll.y, window->ScrollMax.y, window->ScrollbarX ? "X" : "", window->ScrollbarY ? "Y" : ""); |
| 23636 | BulletText("Active: %d/%d, WriteAccessed: %d, BeginOrderWithinContext: %d", window->Active, window->WasActive, window->WriteAccessed, (window->Active || window->WasActive) ? window->BeginOrderWithinContext : -1); |
| 23637 | BulletText("Appearing: %d, Hidden: %d (CanSkip %d Cannot %d), SkipItems: %d", window->Appearing, window->Hidden, window->HiddenFramesCanSkipItems, window->HiddenFramesCannotSkipItems, window->SkipItems); |
| 23638 | for (int layer = 0; layer < ImGuiNavLayer_COUNT; layer++) |
| 23639 | { |
| 23640 | ImRect r = window->NavRectRel[layer]; |
| 23641 | if (r.Min.x >= r.Max.x && r.Min.y >= r.Max.y) |
| 23642 | BulletText("NavLastIds[%d]: 0x%08X", layer, window->NavLastIds[layer]); |
| 23643 | else |
| 23644 | BulletText("NavLastIds[%d]: 0x%08X at +(%.1f,%.1f)(%.1f,%.1f)", layer, window->NavLastIds[layer], r.Min.x, r.Min.y, r.Max.x, r.Max.y); |
| 23645 | DebugLocateItemOnHover(window->NavLastIds[layer]); |
| 23646 | } |
| 23647 | const ImVec2* pr = window->NavPreferredScoringPosRel; |
| 23648 | for (int layer = 0; layer < ImGuiNavLayer_COUNT; layer++) |
| 23649 | BulletText("NavPreferredScoringPosRel[%d] = (%.1f,%.1f)", layer, (pr[layer].x == FLT_MAX ? -99999.0f : pr[layer].x), (pr[layer].y == FLT_MAX ? -99999.0f : pr[layer].y)); // Display as 99999.0f so it looks neater. |
| 23650 | BulletText("NavLayersActiveMask: %X, NavLastChildNavWindow: %s", window->DC.NavLayersActiveMask, window->NavLastChildNavWindow ? window->NavLastChildNavWindow->Name : "NULL"); |
| 23651 | |
| 23652 | BulletText("Viewport: %d%s, ViewportId: 0x%08X, ViewportPos: (%.1f,%.1f)", window->Viewport ? window->Viewport->Idx : -1, window->ViewportOwned ? " (Owned)" : "", window->ViewportId, window->ViewportPos.x, window->ViewportPos.y); |
| 23653 | BulletText("ViewportMonitor: %d", window->Viewport ? window->Viewport->PlatformMonitor : -1); |
nothing calls this directly
no test coverage detected