[DEBUG] Display contents of ImDockNode
| 17989 | |
| 17990 | // [DEBUG] Display contents of ImDockNode |
| 17991 | void ImGui::DebugNodeDockNode(ImGuiDockNode* node, const char* label) |
| 17992 | { |
| 17993 | ImGuiContext& g = *GImGui; |
| 17994 | const bool is_alive = (g.FrameCount - node->LastFrameAlive < 2); // Submitted with ImGuiDockNodeFlags_KeepAliveOnly |
| 17995 | const bool is_active = (g.FrameCount - node->LastFrameActive < 2); // Submitted |
| 17996 | if (!is_alive) { PushStyleColor(ImGuiCol_Text, GetStyleColorVec4(ImGuiCol_TextDisabled)); } |
| 17997 | bool open; |
| 17998 | if (node->Windows.Size > 0) |
| 17999 | open = TreeNode((void*)(intptr_t)node->ID, "%s 0x%04X%s: %d windows (vis: '%s')", label, node->ID, node->IsVisible ? "" : " (hidden)", node->Windows.Size, node->VisibleWindow ? node->VisibleWindow->Name : "NULL"); |
| 18000 | else |
| 18001 | open = TreeNode((void*)(intptr_t)node->ID, "%s 0x%04X%s: %s split (vis: '%s')", label, node->ID, node->IsVisible ? "" : " (hidden)", (node->SplitAxis == ImGuiAxis_X) ? "horizontal" : (node->SplitAxis == ImGuiAxis_Y) ? "vertical" : "n/a", node->VisibleWindow ? node->VisibleWindow->Name : "NULL"); |
| 18002 | if (!is_alive) { PopStyleColor(); } |
| 18003 | if (is_active && IsItemHovered()) |
| 18004 | if (ImGuiWindow* window = node->HostWindow ? node->HostWindow : node->VisibleWindow) |
| 18005 | GetForegroundDrawList(window)->AddRect(node->Pos, node->Pos + node->Size, IM_COL32(255, 255, 0, 255)); |
| 18006 | if (open) |
| 18007 | { |
| 18008 | IM_ASSERT(node->ChildNodes[0] == NULL || node->ChildNodes[0]->ParentNode == node); |
| 18009 | IM_ASSERT(node->ChildNodes[1] == NULL || node->ChildNodes[1]->ParentNode == node); |
| 18010 | BulletText("Pos (%.0f,%.0f), Size (%.0f, %.0f) Ref (%.0f, %.0f)", |
| 18011 | node->Pos.x, node->Pos.y, node->Size.x, node->Size.y, node->SizeRef.x, node->SizeRef.y); |
| 18012 | DebugNodeWindow(node->HostWindow, "HostWindow"); |
| 18013 | DebugNodeWindow(node->VisibleWindow, "VisibleWindow"); |
| 18014 | BulletText("SelectedTabID: 0x%08X, LastFocusedNodeID: 0x%08X", node->SelectedTabId, node->LastFocusedNodeId); |
| 18015 | BulletText("Misc:%s%s%s%s%s%s", |
| 18016 | node->IsDockSpace() ? " IsDockSpace" : "", |
| 18017 | node->IsCentralNode() ? " IsCentralNode" : "", |
| 18018 | is_alive ? " IsAlive" : "", is_active ? " IsActive" : "", |
| 18019 | node->WantLockSizeOnce ? " WantLockSizeOnce" : "", |
| 18020 | node->HasCentralNodeChild ? " HasCentralNodeChild" : ""); |
| 18021 | if (TreeNode("flags", "Flags Merged: 0x%04X, Local: 0x%04X, InWindows: 0x%04X, Shared: 0x%04X", node->MergedFlags, node->LocalFlags, node->LocalFlagsInWindows, node->SharedFlags)) |
| 18022 | { |
| 18023 | if (BeginTable("flags", 4)) |
| 18024 | { |
| 18025 | TableNextColumn(); DebugNodeDockNodeFlags(&node->MergedFlags, "MergedFlags", false); |
| 18026 | TableNextColumn(); DebugNodeDockNodeFlags(&node->LocalFlags, "LocalFlags", true); |
| 18027 | TableNextColumn(); DebugNodeDockNodeFlags(&node->LocalFlagsInWindows, "LocalFlagsInWindows", false); |
| 18028 | TableNextColumn(); DebugNodeDockNodeFlags(&node->SharedFlags, "SharedFlags", true); |
| 18029 | EndTable(); |
| 18030 | } |
| 18031 | TreePop(); |
| 18032 | } |
| 18033 | if (node->ParentNode) |
| 18034 | DebugNodeDockNode(node->ParentNode, "ParentNode"); |
| 18035 | if (node->ChildNodes[0]) |
| 18036 | DebugNodeDockNode(node->ChildNodes[0], "Child[0]"); |
| 18037 | if (node->ChildNodes[1]) |
| 18038 | DebugNodeDockNode(node->ChildNodes[1], "Child[1]"); |
| 18039 | if (node->TabBar) |
| 18040 | DebugNodeTabBar(node->TabBar, "TabBar"); |
| 18041 | TreePop(); |
| 18042 | } |
| 18043 | } |
| 18044 | |
| 18045 | // [DEBUG] Display contents of ImDrawList |
| 18046 | // Note that both 'window' and 'viewport' may be NULL here. Viewport is generally null of destroyed popups which previously owned a viewport. |
nothing calls this directly
no test coverage detected